Pipenv: Is there a way to have multiple package lists in adition to [packages] and [dev-packages] in our Pipfile?

Created on 7 May 2018  Â·  5Comments  Â·  Source: pypa/pipenv

Been searching all around but my google skills are failing me.

I have a project in which I have a client and a server which have different package requirements, I'd like to be able to have them be separate in my Pipfile (like its done in [packages] vs [dev-packages]), or maybe have different Pipfiles, not sure how this is usually solved in pipenv. Normally I would have just created several requirements.txt files, but I really really like pipenv's Pipfiles!

So ideally I would be able to do pipenv install --server or pipenv install --client much in the same way I can now do pipenv install/pipenv install --dev.

Is this possible atm?

Duplicate help wanted

Most helpful comment

Yes, and you can set up some scripts to help improving the setup experience:

[scripts]
install-client = "pip install client-requirements.txt"
install-server = "pip install server-requirements.txt"

This way the set up (for a server) would be

pipenv install
pipenv run install-server

All 5 comments

Hi! This has been mentioned quite a few times in the issue tracker, and the resolution was to put off this proposal, so we can keep the maintenance surface small, and work on the general user experience and actual package resolution first.

For anyone interested in this feature, here’s the recommended route to take toward this:

  • Open a “discussion” issue.
  • Survey how this is done in other package managers (not just the interface, but the implementation). List them in the issue, compare them, and try to come up with a solution for Pipenv.
  • Discuss this with others, and adjust things according to suggestions, until a consensus is reached on how this should be done.
  • Implement it.
  • Further discussion about the implementation, pull request, code review.
  • Landing.

If this sounds like a lot of work—it is. Which is exactly why this is put off in the first place: No current maintainers see this as essential, and people who want it haven’t put in work toward it. We welcome suggestions, but only if someone wants to actually do it.

FYI Kenneth has already rejected this a number of times. It’s going to take a persuasive use case to move him (and me for that matter) on this point. Too many knobs is likely to cause more harm than good.

Hey @uranusjr and @techalchemy thanks a lot for the fast answer! Is there a currently recommended way to handle this while the feature gets added? I am guessing its just probably using multiple requirements.txt files?

Yes, and you can set up some scripts to help improving the setup experience:

[scripts]
install-client = "pip install client-requirements.txt"
install-server = "pip install server-requirements.txt"

This way the set up (for a server) would be

pipenv install
pipenv run install-server

Great, I really like that as a temp solution, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacebrowning picture jacebrowning  Â·  3Comments

marc-fez picture marc-fez  Â·  3Comments

bgjelstrup picture bgjelstrup  Â·  3Comments

jakul picture jakul  Â·  3Comments

jacek-jablonski picture jacek-jablonski  Â·  3Comments