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

pipenv requirements sub-command based on Pipfile #6130

Open
RicNord opened this issue Apr 14, 2024 · 0 comments
Open

pipenv requirements sub-command based on Pipfile #6130

RicNord opened this issue Apr 14, 2024 · 0 comments
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. good first issue Issues suitable as a newcomer to get familiar with Pipenv! Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@RicNord
Copy link

RicNord commented Apr 14, 2024

Is your feature request related to a problem? Please describe.

I develop both projects which purpose is applications (where I want to pin all dependencies) and libraries (were I do not want to pin my dependencies, since it has to be in an environment with other packages selected by the developer whom also want to use my library, without causing a conflict).

It would be fantastic if I could use pipenv for both of these purposes. And the only feature missing from pipenv is currently the ability to generate a requierments.txt file with only the root of the dependency tree. That can be referenced as a list of dependencies when building my package python -m build and various CI and development workflows. So to clarify: what I would like to do is generate a file based on the content of the Pipfile, not the Pipfile.lock.

Example:

#Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "*"
pydantic = "==1.10.14"

[style]
ruff = "<=0.3.5"

Draft of desired output:

$ pipenv requirements --NEW_OPTION
requests
pydantic==1.10.14

$ pipenv requirements --NEW_OPTION --categories style
ruff<=0.3.5

I need to have the option of installing packages from a requirements.txt file. And with this new proposed feature I do not need to maintain the package dependencies in more than one place when changes happens and risk them being out of sync with each-other. I can simply have this command being ran in a pipeline or similar and fellow developers/CI-runners whom might not have pipenv installed can also use my project.

I also use these requirements.txt files for dynamic specification of requirements in setuptools.

Describe the solution you'd like

I would like an additional flag added to the pipenv requirements sub-command that reads from the Pipfile, not the Pipfile.lock and only takes the root packages of the dependency tree into account.

Describe alternatives you've considered

Developing a new application to support this scenario. With help of pkg_resources, however the API is "deprecated". And I would like to avoid introducing additional dependencies.

pip does not support anything similar as well.

Additional context

N/A

@matteius matteius added Type: Enhancement 💡 This is a feature or enhancement request. good first issue Issues suitable as a newcomer to get familiar with Pipenv! Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. good first issue Issues suitable as a newcomer to get familiar with Pipenv! Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

2 participants