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.

Install just dependencies from pyproject.toml like from requirements with -r

See original GitHub issue

What’s the problem this feature will solve?

Python encourage user to put all project infomation into one file: pyproject.toml , including dependencies.

But currently, users who want to just install dependencies and run a project, I mean not install it into site-packages, could not do this just with pip.

People have to use pip-tools generate requirements.txt first.

Describe the solution you’d like

pip install -r pyproject.toml

Alternative Solutions

$ pip install pip-tools
$ python -m piptools compile \
    -o requirements.txt \
    pyproject.toml
$ pip install -r requirements.txt 

Additional context

No

Code of Conduct

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
pfmoorecommented, Nov 8, 2022

I don’t think that installing dependencies and running a project uninstalled is a pattern we want to encourage. If you’re running your project uninstalled, it’s probably an application, not a library, and applications should be using a requirements file. See https://caremad.io/posts/2013/07/setup-vs-requirement/

1reaction
uranusjrcommented, Nov 8, 2022

See discussions in #4783. The final comment mentioned container image layers, which I think is a use case that’s more relevant now than back then. I still believe this belongs to workflow tools (e.g. pip-tools, poetry, pdm) instead of pip, however.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Download dependencies declared in pyproject.toml using Pip
As of version 10.0, pip supports projects declaring dependencies that are required at install time using a pyproject.toml file, in the form ...
Read more >
pip-tools Supports pyproject.toml - Hynek Schlawack
Technically, you only need to pass -r dev-requirements.txt here, since it contains all main dependencies too. I pass them both to ensure I'm ......
Read more >
How to download Python dependencies - ActiveState
Use the pipdeptree utility to gather a list of all dependencies, create a requirements.txt file listing all the dependencies, and then download ...
Read more >
Manually adding dependencies to pyproject.toml - Packaging
First, you can use pip list --not-required to only list your top level dependencies. However, my usual workflow is to always add a...
Read more >
Commands | Documentation | Poetry - Python dependency ...
When --only is specified, --with and --without options are ignored. add #. The add command adds required packages to your pyproject.toml and installs...
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