-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
A library should not pin specific dependency versions using "==" in setup.py.
I see that this was done based on #40, but I think that the solution is far from optimal.
There are a couple of issues if a user wants to integrate the framework into his project which also has other dependencies:
- pip will have a tough time resolving the versions leading to long install times and possibly fail to resolve some deps
- if there is another dependency with pinned versions, it's inevitable that the installation will fail with an unresolvable version conflict
In general, the "best practice" is to make library dependency versions as "loose" as possible so that the library can be easily integrated with other projects. If it's known that the library doesn't work on newer/older versions of some dependency, use ">=" and "<=" to handle that, instead of "==". Or it's also possible to exclude a specific version.
Here are some resources which share this view:
- Python packaing guide states that pinning "is not considered best practice": https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/
- Some stack overflow discussion with good points: https://stackoverflow.com/questions/28509481/should-i-pin-my-python-dependencies-versions
- Example in another open source framework - https://github.com/behave/behave/blob/main/setup.py
Metadata
Metadata
Assignees
Labels
No labels