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

As a developer I want a consistent use of requirements.txt and install_requires across repos #21

Closed
MJJoyce opened this issue Aug 4, 2021 · 4 comments · Fixed by #23
Assignees
Labels
B12.0 enhancement New feature or request

Comments

@MJJoyce
Copy link
Contributor

MJJoyce commented Aug 4, 2021

💪 Motivation

Our current use of requirements.txt somewhat blurs the line between requirements.txt and install_requires in our template repo. This can be confusing and result in devs / teams applying unique (and occasionally unnecessary) solutions that lead to further inconsistencies across repositories.

📖 Additional Details

PyPA has the the following to say on these options.

install_requires [...] should be used to specify what a project minimally needs to run correctly.

[...]

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.

[...]

⚙️ Engineering Details

Our current setup.py reads everything from requirements.txt and shoves it into install_requires. Since they're currently duplicates of each other I'd suggest that we baseline on a few things:

  • install_requires should specify what the project minimally needs to run correctly per the PyPA recommendations. This should be explicit and not hidden in another file.
  • extra_requires should be used to handle non-critical dev dependencies under the dev "keyword". This should also be explicit and not hidden in another file.
  • If we want to keep requirements.txt around (and really confuse people) we can specify that it should install the package in editable mode with the dev extra_requires. I'd argue that it's not really needed in the majority of cases as is and we could just drop it entirely from the template repo.
@MJJoyce
Copy link
Contributor Author

MJJoyce commented Aug 4, 2021

@nutjob4life, I know we chatted about this a bit on Slack. If you think I'm missing some of the take aways there please let me know

@nutjob4life
Copy link
Member

I would love to see requirements.txt go away. I suspect it's a vestige of the separate, parallel development tracks between PEAK, easy_install, and later the distribute fork with pip and folding everything back together with Python Packaging Authority.

Especially now as the trend is to put everything into one file, setup.cfg, having to maintain three files (setup.cfg, MANIFEST.in, and requirements.txt) feels messy.

@jordanpadams
Copy link
Member

@nutjob4life let's do it. down with requirements.txt is fine with me.

@MJJoyce
Copy link
Contributor Author

MJJoyce commented Aug 5, 2021

Note, I forgot to mention it but since it's related ...

We should probably put in a pyproject.toml file as well so we're up-to-date with the latest and greatest stuff. At least I assume this is still the latest and greatest ...

https://www.python.org/dev/peps/pep-0518/

MJJoyce added a commit that referenced this issue Aug 5, 2021
Move template repo over to setup.cfg for package metadata management and
pyproject.toml for up-to-date build system management. Development
dependencies are now grouped under `extras_require.dev` and
`requirements.txt` has been dropped.

Resolve #21
MJJoyce added a commit that referenced this issue Aug 5, 2021
Move template repo over to setup.cfg for package metadata management and
pyproject.toml for up-to-date build system management. Development
dependencies are now grouped under `extras_require.dev` and
`requirements.txt` has been dropped.

Resolve #21
MJJoyce added a commit that referenced this issue Aug 6, 2021
Move template repo over to setup.cfg for package metadata management and
pyproject.toml for up-to-date build system management. Development
dependencies are now grouped under `extras_require.dev` and
`requirements.txt` has been dropped.

Resolve #21
MJJoyce added a commit that referenced this issue Aug 6, 2021
Issue #21 - Move install to setup.cfg and pyproject.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B12.0 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants