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

Add support for multiple categories in exported requirements #5397

Closed
oz123 opened this issue Oct 10, 2022 · 6 comments · Fixed by #5431
Closed

Add support for multiple categories in exported requirements #5397

oz123 opened this issue Oct 10, 2022 · 6 comments · Fixed by #5431

Comments

@oz123
Copy link
Contributor

oz123 commented Oct 10, 2022

Now that Pipfile supports multiple categories, it would be nice if I could create different requirements files for these categories.
Let's say my Pipfile has categoires: tests, documentation, foo, bar.
I would like to create the following files: requirements-tests.txt, requirements-documentation.txt, requirements-foo.txt and requirements-bar.txt.

I would like to export them with:

pipenv requirements --category tests > requirements-tests.txt

And so on ...

However, right now only these options are supported:

 $ pipenv requirements -h
Usage: pipenv requirements [OPTIONS]

Options:
  --dev              Also add development requirements.
  --dev-only         Only add development requirements.
  --hash             Add package hashes.
  --exclude-markers  Exclude markers.
  -h, --help         Show this message and exit.
@BAllbeeDHI
Copy link

I would find this immensely helpful as well.

@dojutsu-user
Copy link
Contributor

HI @oz123,
I would like to take this up. First time here, can you help me on how to start with this?

@oz123
Copy link
Contributor Author

oz123 commented Oct 22, 2022

I would start with the following:

Add the command line options.
Look where this leads you inside pipenv.
You'll bump into a library we maintain called requirementslib that does the real work of parsing Pipfile. Change the code here.
One your prototype works, you'll need (probably) to open a PR in requirementslib.
It's probably not a good first issue. But you can try 💪

@dojutsu-user
Copy link
Contributor

dojutsu-user commented Oct 22, 2022

Thank you.
I would like to give it a try.

@dojutsu-user
Copy link
Contributor

HI @oz123,
Raised a PR with probable fix. Can you please check it once if the approach looks fine to you.

@BAllbeeDHI
Copy link

Thank you for taking that on, @dojutsu-user — Looking forward to having that capability as soon as it's released. :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants