-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 ability to have custom package sets. pipenv --install --pack=dev --pack=test #2987
Comments
This is sort of related to #1353. Although in my use-case I want the different package sets to have versions that are as similar as possible. Whereas you want to have deliberately different versions of packages. Both cases result in different dependency trees which means you need a new lock file per set of packages (and also per platform, as it turns out). I extracted this out of our repo as an example for the other issue, you might find the same templating approach helpful too (it would need some modifications to be a more general tool but the basic idea is there). |
Hi, could you convert this to PEEP format? You already have most of the content ready, but by organising it in a document, it helps to effectively summarise and record discussions. Thanks for putting this together! |
This is an excellently structured proposal, but Kenneth needs to look it over and he only reads PR's submitted against the |
@uranusjr, @techalchemy: PEEP-001 is a bit ambiguous about starting the PEEP process. Should I just create PEEP-003 in a local branch and submit a PR? It would seem that this process would create some contention if there were multiple, unmerged PEEPs at a given time. However, at the moment, this doesn't seem to be a problem. From what I can tell, it looks like PEEP-002 followed this process in #2819. Or, is there an informal, "preliminary" phase to hammer out the text before making the PR. While I wait for clarification, I'll just assume the former by writing "PEEP-003" and pushing it to a branch to my personal fork. cc: @kennethreitz |
The number does not need to be the lowest possible, you can choose whatever you think is appropriate. The maintainers may request you to change the number before it is merged. |
is there any progress on this? |
@marco-silva0000: Sorry, no. I haven't taken the opportunity to write-up the PEP for my own request. If you have the need and motivation to start the write up, then I'll be more than happy to help review drafts and, if necessary, suggest edits. |
Interesting -- so was this ever supported? There has been a bug starting in pipenv |
It seems like the original requestors of this are no longer with us, but I think there is some merits to someone considering this type of enhancement. I think the complicated thing is there are already possible discrepancies between package versions in groups such as the default and dev dependencies. However it could make parts of the code more generic too where right now we specifically are checking default or dev related groups. Other benefits would be fixing bugs like #4866. I am not going to have time in the near term to get to this, so I have marked it as a |
* Add test, ensure dev lock use default packages as constraints. * Use default packages as constraints when locking develop packages. * Add test, ensure installing dev-packages use default packages as constraints. (#4371) (#2987) * Use default packages as constraints when installing provided dev packages. * change vistir.path.normalize_path to pipenv.utils.shell.normalize_path * Add function that get contraints from packages. * Add test for get_constraints_from_deps function * Use get_constraints_from_deps to get constraints * Use @cached_property instead of @Property * Use standalone utility to write constraints file * prepare_constraint_file use precomputed constraints. * Add news fragment.
This is very close to being a reality -- please track with #4745 |
* Add test, ensure dev lock use default packages as constraints. * Use default packages as constraints when locking develop packages. * Add test, ensure installing dev-packages use default packages as constraints. (pypa#4371) (pypa#2987) * Use default packages as constraints when installing provided dev packages. * change vistir.path.normalize_path to pipenv.utils.shell.normalize_path * Add function that get contraints from packages. * Add test for get_constraints_from_deps function * Use get_constraints_from_deps to get constraints * Use @cached_property instead of @Property * Use standalone utility to write constraints file * prepare_constraint_file use precomputed constraints. * Add news fragment.
Feature: Custom Package Sets
It would be nice to be able to create custom package sets. For instance,
pipenv
already has support for two package sets "default" and "dev". However, I can see use cases where it would be nice to have multiple package sets.Description of Problem
For me, I have a use case where I want to test the changes made in a another package, DependencyProject, to see the effects it in MainProject before I release it (DependencyProject).
In MainProject, I want everyone to have DependencyProject.
For
--dev
work, I want contributors to install testing tools.But, normal contributors (nor the CI release process) shouldn't have pre-alpha releases of DependencyProject installed. This should be reserved experienced contributors (or, "coordinated" contributors), so they should use a different package set; not "default", not "dev".
Current Workaround
To be honest, I haven't attempted a workaround yet. I've used Pipenv sparingly over the past year, but over the past month, I have made it part of my standard process. And, I'm seeing this scenario (as described above) coming. So, at the moment, it is a hypothetical problem, but I do have a real workaround.
Use
pipenv run pip install ...
when I need to do alpha testing.Then run
pipenv install --dev
to go back to the standard development environment.I've tested this scenario by installing
requests
andrequests==2.9.1
. (NOTE: The that the current version of Requests==2._19_.1
is very similar to the older version==2._9_.1
.)Existing Problems
In my hypothetical problem, I am trying to add two different version of the same package into the Pipfile. Because Pipenv does have two package set options (default and dev) I can attempt the scenario using them. As it turns out, it isn't currently possible to have differing versions between the two package sets. Again, I'll demonstrate with Requests.
Explicit Default, Relaxed Dev
Explicit Dev, Relaxed Default
NOTE: This problem is, likely, a combination problem, so I should test scenarios for "Relaxed Dev, Explicit Default" and "Relaxed Default, Explicit Dev" as well (And, there's likely more cases that I haven't conceptualized yet.) But, I think the two scenarios show an inconsistency.
So, just to get to my desired feature, this problem will have to be solved first. (I have not researched the Issues about this potential bug, so I haven't created a new one. I can, and will, upon request. ~"When Duplicate Dependencies exists, the dependency defined in the Default package set always wins.")
Conclusion
Despite my specific use case (and the current limitations that prevent it), there's potential for this feature.
I suppose, conceptually, my request is most similar to
extra_requires
as found insetuptools
. Most notably projects like IPython (setup.py) depend on this functionality to provide different levels of dependencies to their users; ex:pip install ipython['all']
.A project like Tox allows for multiple "package sets", so conceptually the expectation exists. Although, I'll concede that Tox implements this scenario by having multiple virtualenvs. That's a potential solution to the problem, but by separating sets into virtualenvs, that creates a combination problem between each set. (Does
pipenv install --pack=test
imply installing--pack=dev
too?)... I'm doing a terrible job of concluding this request because now I have more questions pertaining to resolution scenarios between multiple sets. So, in order to stop my digressions, I'll stop here to say, ...
I think this would be a great feature. I can't possibly think up of all the cases where it would be amazing. And, I can't conceive of all the cases where it becomes hard to implement, so I'm just putting it out there. Let's discus.
Due Dilligence
I haven't been able to find any mention of this capability in the Basic Usage, Advanced Usage, nor in the Issues, (is:issue label:enhancement dev packages), so I created this request.
The text was updated successfully, but these errors were encountered: