this post was submitted on 01 Aug 2026
121 points (99.2% liked)

Programmer Humor

43838 readers
102 users here now

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

Rules:

founded 7 years ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[–] eager_eagle@lemmy.world 37 points 2 months ago (23 children)

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

[–] Mickkc@lmy.ndu.wtf 14 points 2 months ago (22 children)

What should I use instead? pyproject.toml?

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

[–] bamboo@lemmy.blahaj.zone 4 points 2 months ago (6 children)

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

[–] Mickkc@lmy.ndu.wtf 2 points 2 months ago (2 children)

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!

[–] scrion@lemmy.world 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.

[–] Mickkc@lmy.ndu.wtf 2 points 2 months ago* (last edited 2 months ago) (1 children)

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...

[–] bamboo@lemmy.blahaj.zone 3 points 2 months ago

Yes exactly, like if I know my app needs the requests library, I will just put that in requirements.in but after compile requirements.txt will include the exact version of requests and every version of each dependency. So that every time pip install is run, all dependencies are always the same despite what happens upstream

load more comments (3 replies)
load more comments (18 replies)
load more comments (18 replies)