question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Allow reading dependencies (and dev-dependencies) from `requirements.txt` file

See original GitHub issue

While 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
takluyvercommented, Nov 4, 2019

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.

0reactions
romanchylacommented, Dec 19, 2021

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

[project]
...
dependencies = [
    'rutils @ git+https://github.com/romanchyla/rutils@#egg=rutils',
]

[build-system]
requires = ["setuptools >= 58.6.0", "wheel", "flit_core >=3.2,<4", "ppsetuptools==2.0.2"]
#build-backend = "setuptools.build_meta"
build-backend = "flit_core.buildapi"

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…

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found