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.

Allow creating requirements.txt files without dev-packages

See original GitHub issue

To install a set of pinned packages in remote systems, there is:

pipenv install --system  # won't install dev dependencies

However, this requires both Pipfile and Pipfile.lock to be present, and also pipenv to be installed in the target system. It’s way more inconvenient than just being able to (maybe first copy package wheel into remote system and) say pip install <mypackage> (and letting pip to pull in the pinned dependencies specified in setup.py’s install_requires).

(Or is there some benefit in using pipenv install --system instead?)

To be able to generate pinned requiremets.txt that excludes development packages, add --no-dev option to pipenv lock, that seems to by default include also dev packages. Or maybe even change to default to match that of pipenv install, and exclude dev-packages by default?

As per https://github.com/kennethreitz/pipenv/issues/209#issuecomment-278185133 this is already supported in code:

from pipenv.project import Project
from pipenv.utils import convert_deps_to_pip

pfile = Project(chdir=False).parsed_pipfile
requirements = convert_deps_to_pip(pfile['packages'], r=False)

Although there is workaround for this need already, supporting it right in the cli would/could be nice.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gregbrowndevcommented, Oct 2, 2018

-r -d

@uranusjr thanks but that creates a requirements file with just the development dependencies. I think the best solution is to use --system option and ensure the lock file is up-to-date.

1reaction
nateprewittcommented, Dec 14, 2017

@wooyek this was a regression in 9.0.0 and will be fixed in the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How to avoid putting dev packages in requirements.txt
I use pip freeze > requirements.txt to make sure that others in my project can install all the relevant libraries via pip install...
Read more >
Why and How to make a Requirements.txt - Robert Boscacci
In short, we generate and share requirements.txt files to make it easier for other developers to install the correct versions of the required...
Read more >
Pipenv: A Guide to the New Python Packaging Tool
Watch Now This tutorial has a related video course created by the Real ... Let's say you've got a requirements.txt file that looks...
Read more >
The Python Requirements File and How to Create it
Learn what a Python requirements.txt file is, how to create it, and how to maintain it with a list of required modules.
Read more >
Advanced Usage of Pipenv - Read the Docs
Dependencies of wheels provided in a Pipfile will not be captured by ... You can convert a Pipfile and Pipfile.lock into a requirements.txt...
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