-
-
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
new 'pre' syntax in Pipfile #1760
Comments
I am assigning myself to this task, but I might take some time to enter into the code |
@frostming how does this proposal interact with the changes you made here recently? |
The change in my PR is: when installing wildcard versions from CLI, Pipfile won't be modified. With the proposal here, when we do I am glad to help when it comes true. |
Hello! Any updates or estimates on this? |
If there's no progress on this I'd like to make it happen, otherwise I will revert to virtualenv/pip. @frostming With your proposal, how would that end up looking in the Pipfile? I'm not familiar with how requirements are really parsed, briefly browsed some code. Completely ballparking, please correct me. Would it have to follow syntax akin to:
|
I was on it, but there have been some change in the resolver I need to redo it completly. I would be glad to get some help on it |
This unfortunately sets allow_prereleases = true. black is only in pre-release on pypi and there is no way to only set a single package to pre-release in a Pipfile. See pypa/pipenv#1760 Introduces #2.
I found that pin to specific prerelease version works for even |
This avoids `piping update` allowing packages other than Black to be installed from pre-release candidates prior to either one of these issues being resolved: pypa/pipenv#1760 psf/black#517 This commit back-levels pyyaml to the last release along with the coverage developer tool and locks all current non-major updates.
@gsemet where are you with making this a reality? Would be happy to help push this along ive solved it in a weird way, definitely should make it available like @gsemet has suggested. However, you can fix a single package as a prerelease without wrecking the rest of the pipfile by going the editable route and directly specifying the release tag rather than the package in pypa i.e.
|
Thanks for the workaround. I will note that this also works without
|
@ekhaydarov Did nothing really, sorry :( had a baby, and has been lost in the resolver once :( not have many will to dig into it for this damned resolver for the moment :'( |
Okay so what I'm about to outline might either be a bug or a stronger incentive for this feature request... Assume we have this Pipfile:
And the package in
Which is either a bug, because if people specify You tell me if, I should rather open another issue to have pre-releases be considered if |
Hi. But I actually stopped using this feature for current module, too complex to maintain. Just have
Bonus:
|
Ha! Thanks, you helped me realize that my problem is something slightly different. Locking failes because the project in |
If I take the road of specifying versions explicitly, is there a way to specify versions loosely without allowing pre-releases when |
By "loosely" I mean something like |
yes only for non-prerelease:
I agree that ==1.2 should means every bugfix version (1.2.1, 1.2.2, 1.2.3,...), but we don't want to have all the mess npm have with this. |
I could reformulate: is there a way to turn the problem around and use But then I'm realizing that this wouldn't solve the problem for subdependencies. Seems to me this issue is pretty critical. It doesn't actually make sense to allow prerelease versions for all your dependencies, since the usability of prerelease versions depends on each project. Some projects have very stable prereleases while others don't, and using their prerelease versions will break your app. Isn't there a workable fix which could at least allow a pinned version to be a prerelease, without requiring the global |
Is there really no effective workaround or progress on this? I'd like to be able to use pre-releases for internally-generated artifacts during development, but still depend on release versions of public libraries. I'm not sure pipenv is suited for this (trivial and common) workflow while this issue persists. |
Just switch to some other tool like poetry, there is little hope this will get solved soon given the history. |
Yeah in fact I was just in progress of trying out poetry. |
Is this issue still valid for the latest 2020 releases? I might be misunderstanding the issue, or lucky with my dependencies. I am pinning a rc-specific version of a package in my pipfile, and allow_prereleases = true.
In this case, <PACKAGE_NAME> is the only package with a pre-release version. Is the issue that one wishes to allow for "*" and including the latest pre-release in that version identifier, on a per-package level, and not entire pipenv environment? |
I believe pipenv will always allow you to pin pre-releases explicitly with an This is limiting in an interesting way that unfortunately comes up often (e.g. with the
The |
Currently, I need to include In this case I have a rc version of <PACKAGE_NAME>, with another package having a requirement on <PACKAGE_NAME> as well:
Then I get a list of "Tried" where it actually lists |
@kristang are you certain about your Pipfile syntax?
it doesn't make sense to have a compound conditional if you have an exact version requirement |
@bryan5989 yeah I made some error somewhere. I think I confused myself with a number of conflating issues and versioning breaking from an internal Python feed. I have since gotten things to work as expected. |
Any progress on this? |
I believe there should be a test-case where the Pipfile has this enabled for PKG-A set to a pre-release version range (VR1), and another PKG-B includes PKG-A as a dep w/ a non pre-release version w/in the range of VR1. Right now this is marked as |
This would be great actually |
We rely on the |
@matteius thanks for the explanation and all your hard work!
|
@joshsleeper I think if you or someone can take point on opening an issue with |
oh for sure, 0% interest in you all crafting a bespoke replacement resolver just for this edge case 😅 |
For individual packages, https://peps.python.org/pep-0440/#handling-of-pre-releases already requires filters like "> last.final.release" to accept pre-releases when no matching final release is available, which is the specifier you're going to need anyway if relying on a feature or fix that's only available in an upcoming release. Is there a use case for accepting all pre-releases of a package in all situations, rather than only needing to allow their use when the newest final release doesn't meet a project's needs? |
@ncoghlan Thanks for the reference, I had not read that prior.
I would say that in the case of pipenv, the resolution likely would not happen due to the package already being installed, so the happy path behavior is we accept remotely available pre-releases for version specifiers where there is no final or post release that satisfies the version specifier. Also the current pip resolver does accept or deny prereleases for all version specifiers, so it meets the should criteria. The reason this ticket exists is the statement:
The tool may allow that, but pip resolver does not currently, and there may be some mild use cases for it. Trying to think of one, but I think it more described a behavior of the old pip resolver, that for a long while I think it just comes down to supporting more user preferences -- there are other things that ideally could be specified on a package level, such as what index it is resolved/installed from, without requiring multiple invocations of pip, but that is out of scope of this issue report, but just thinking out loud about things I would want from the next great iteration of the pip and its amazing resolver. |
Placeholder ticket for the proposition we talk with Kenneth.
Add the following syntax in the
Pipfile
:This would allow to allow prerelease resolution for one package only.
Change the
pipenv install mypkg --pre
behavior. It will set the setting described above only for this very package. Today it turns on a general 'pre' setting for the whole Pipfile, leading other packages to also resolve to prerelease.Change the
pipenv update
andpipenv lock
behavior. They should take into account the presence of thepre=true
setting for some package.Here are some impact I think might happen
>=1.0
in one dependency, and another package define thepre=true
while a new version 2.0.0.b1 is available on pypi,pipenv install
should take itpre
setting in the Pipfile. Maybe we can document users need to do apipenv update --pre
orpipenv lock --pre
to turn the general 'pre' settings on.The text was updated successfully, but these errors were encountered: