Feature Request: Allow reading dependencies (and dev-dependencies) from `requirements.txt` file
See original GitHub issueWhile it isn’t a huge maintanance burden it would be nice if we could share our requirements files between tox, CI & packaging.
I guess this should either be done by adding tox
/PIP-style syntax to for requires
:
requires = -r requirements.txt
or adding a separate requires-file
option. I’d prefer the first option because it is similar to how tox
handles this stuff (it was the first thing I tried anyways) and because it makes it more obvious that the external file belongs to the same requirement list as the other stuff possibly listed.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Feature Request: Allow reading dependencies (and ... - GitHub
The other question is how to do things the right way: requirements.txt is mostly to pin dependencies for applications, so should (in theory)...
Read more >Managing Python Dependencies with Requirements.txt
When installing a Python package using pip install, pip will attempt to automatically work out the dependencies of the requested packages.
Read more >How to import requirements.txt from an existing project using ...
Run poetry-add-requirements.txt , optionally specify your requirements.txt files and --dev for dev dependencies.
Read more >Manage dependencies using requirements.txt | IntelliJ IDEA ...
In the Package requirements file field, type the name of the requirements file or click the browse button and locate the desired file....
Read more >Dependency Management with Pip, Python's Package Manager
txt file, which allows for the pinning of packages and their dependencies to specific versions (details below). Dependency Management with Pip.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe tox now supports PEP 517, so it should be able to get requirements from a flit package.
The requirements you specify with flit are abstract requirements (see Donald’s blog post about this).
requirements.txt
is typically used to specify concrete, pinned dependencies. So reading that doesn’t make sense.You could write a tool which reads dependencies specified for Flit and creates a list of pinned versions for them. They’re configured in Flit’s section of the
pyproject.toml
file, so you’re at the mercy of Flit changing the format for dependencies, but I don’t see that happening in the near future.Or look at other tools like poetry and pipenv which handle translating abstract dependencies into concrete ones.
leaving comment here just in case it helps someone; I’m using the following which works
credit: https://stackoverflow.com/questions/32688688/how-to-write-setup-py-to-include-a-git-repository-as-a-dependency
I find the distinction between abstract/concrete dependencies to be way too abstract to be pragmatic and/or useful; when we are developing libraries we also tend to develop applications that use those libraries; it’s a messy world, so our tools need to be simple but not simpler than necessary…