Thank you IntelliJ

2 months ago by mickkc to c/programmerhumor

I was just editing my Dockerfile and suddenly IntelliJ showed me the message "No" without any context.

eager_eagle 38 points 2 months ago

It's right, you shouldn't be using requirements.txt in 2026

path: 0 25064904, hotness: undefined, score: 38, children: 23
Mickkc 14 points 2 months ago

What should I use instead? pyproject.toml?

I am pretty new to Python so I'm not very familiar with the ecosystem yet...

path: 0 25064904 25065011, hotness: undefined, score: 14, children: 22
aBundleOfFerrets 27 points 2 months ago

It’s not important what you should be doing, just that requirements.txt ‘No’

path: 0 25064904 25065011 25065040, hotness: undefined, score: 27, children: 2
Mickkc 22 points 2 months ago

path: 0 25064904 25065011 25065040 25065652, hotness: undefined, score: 22, children: 1
eldavi 5 points 2 months ago

I'm a dinosaur still using vim but I'd consider switching IDE's if they had this much snarky behavior. Lol

path: 0 25064904 25065011 25065040 25065652 25066034, hotness: undefined, score: 5, children: 0
eager_eagle 20 points 2 months ago path: 0 25064904 25065011 25065056, hotness: undefined, score: 20, children: 8
BlameTheAntifa 7 points 2 months ago path: 0 25064904 25065011 25065056 25066377, hotness: undefined, score: 7, children: 6
eager_eagle 13 points 2 months ago

I used poetry for years before uv, but uv is just a better tool. If openai enshittifies it, I have no doubt it'll be forked instantly.

path: 0 25064904 25065011 25065056 25066377 25066414, hotness: undefined, score: 13, children: 4
jtrek 8 points 2 months ago

Fuck. Fuck all this AI slop.

path: 0 25064904 25065011 25065056 25066377 25076105, hotness: undefined, score: 8, children: 0
Mickkc 4 points 2 months ago

That looks really convenient, especially when installing and switching Python versions. I'll keep that in mind. Thanks!

path: 0 25064904 25065011 25065056 25065209, hotness: undefined, score: 4, children: 0
bamboo 5 points 2 months ago

Curious what others have to say, but my go to is to have a requirements.in with direct packages I need for the project, and then run pip-compile to generate all the dependencies with their exact version at the time so that deployments are repeatable. This works well for deployment, but if I were writing a library for others to use, I think you put the direct dependencies in setup.py

path: 0 25064904 25065011 25065081, hotness: undefined, score: 5, children: 6
Mickkc 2 points 2 months ago

I don't quite understand that. I did some research, and I read that the requirements.txt is somehow generated from requirements.in. But what is the difference between the two files then? Could you give me an example of what a requirements.in file would look like?

Thank you!

path: 0 25064904 25065011 25065081 25065269, hotness: undefined, score: 2, children: 3
scrion 5 points 2 months ago

Please use a pyproject.toml file for both project setup and dependency management. It actually is standardized now in PEPs.

uv is a great tool, now comes with a build tool as well. It has become a de-facto standard.

path: 0 25064904 25065011 25065081 25065269 25066363, hotness: undefined, score: 5, children: 0
Mickkc 2 points 2 months ago

Ohhh now I get it. It's basically like package.json and package-lock.json in node, but for Python.

It's a bit strange to me that this isn't the default in Python...

path: 0 25064904 25065011 25065081 25065269 25065435, hotness: undefined, score: 2, children: 1
AnnaFrankfurter 1 point 2 months ago

Why not put all dependencies and all with versions. I do that

path: 0 25064904 25065011 25065081 25066203, hotness: undefined, score: 1, children: 1
bamboo 4 points 2 months ago

Well if the requirements.txt is pinned to a specific version of a dependency of a dependency, you might not know or really care why that's set. But then this becomes a nightmare and dependency hell laterif you want a newer version of some package, and that newer version requires a bunch of newer packages and loses the others. At that point you probably will toss your old file and start a new one from scratch piecing together all the requirements with like pip freeze in a new virtual environment.

Sure you could omit the versions, but then everytime you deploy, you don't know what you're going to get and a deployment today would be very different next week with a whole bunch of different versions of dependencies.

path: 0 25064904 25065011 25065081 25066203 25066335, hotness: undefined, score: 4, children: 0
assaultpotato 4 points 2 months ago

uv + pyproject.toml. and any other answers like "poetry" are objectively wrong

path: 0 25064904 25065011 25075498, hotness: undefined, score: 4, children: 0
assaultpotato 4 points 2 months ago

also ty + ruff for linting and type checking, basically if Astral makes it its probably worth using.

path: 0 25064904 25065011 25075528, hotness: undefined, score: 4, children: 0
pineapple 1 point 2 months ago

uv and pyproject.toml is so much easier than pip and requirements.txt

path: 0 25064904 25065011 25083628, hotness: undefined, score: 1, children: 0
programmerhumor
programmerhumor

@lemmy.ml

login for more options
43730
1627
1156

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

go to feed...