Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review setup.py and requirements.txt constraints #56

Open
laurentdavid opened this issue May 12, 2022 · 0 comments
Open

Review setup.py and requirements.txt constraints #56

laurentdavid opened this issue May 12, 2022 · 0 comments

Comments

@laurentdavid
Copy link

laurentdavid commented May 12, 2022

Following #55 pull request, we started a discussion on the constraints that we should set in the respective dependencies/setup script. This needs to be reviewed in order to insure that development environment matches the test/git workflow test environment.

Abstract from the exchanges (#55 (comment)):
"
Regarding setup.py vs requirements.txt, it got this way because I added requirements.txt for the CI, and left setup.py alone on the assumption it was the distillation of accumulated wisdom, fitting a common use pattern, etc. In development I initially used direct pip installs, and now in deployment we use requirements.txt.

According to the Python canon, the two files are supposed to be different. https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/ says of setup.py (referred to as install_requires):

It is not considered best practice to use install_requires to pin dependencies to specific versions, or to specify sub-dependencies (i.e. dependencies of your dependencies). This is overly-restrictive, and prevents the user from gaining the benefit of dependency upgrades.

and of requirements.txt:

Whereas install_requires defines the dependencies for a single project, Requirements Files are often used to define the requirements for a complete Python environment.

Whereas install_requires requirements are minimal, requirements files often contain an exhaustive listing of pinned versions for the purpose of achieving repeatable installations of a complete environment.

This is the reverse of what we do: we generally have stricter pinning in setup.py than in requirements.txt.
"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant