-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
How do I exclude Pip selecting any pre-release? #12470
Comments
We don't have the ability to do that, as far as I know. It's a "should", so the spec doesn't require that capability - we could add it as a new feature, but it's not something there has been much interest in until now. |
Well no part of "Handling of pre-releases" uses a word stronger than "SHOULD" and in previous discussion on handeling of pre-releases you've used the word "MAY" to mean it is required by the spec, and I would consider "MAY" to be weaker than "SHOULD": #12049 (comment) So it is unclear to me if the spec is only willing to use words like SHOULD or MAY if any specifc line is required at all. |
I would be strongly interested in this feature as I don't want pre-releases unexpectedly. However I think another part of the fact there hasn't been much interest from users is that Pip often doesn't select a pre-release even when according to the spec it reads to me as though it "SHOULD", e.g. #12469 I would make the assumption that if this happened more frequently, then a lot more users would also be interested in not unexpectedly getting pre-releases. |
My reading of the spec is that only the text
is required, as only that part of the text avoids the terms "SHOULD" or "MAY". But I'll happily concede that the spec is unclear, if that helps. I certainly don't feel that I have a good understanding of what the "right" behaviour around pre-releases should be (or even whether what the spec says is the best thing to do in practice).
I would support a hard-line stance of never selecting pre-releases under any circumstances unless Anything else is always some form of "do what I mean" approach, and as such is likely to have problematic edge cases at a minimum.
Hmm, to me that argues in favour of leaving pip's behaviour as it is. I certainly don't see any great advantage in implementing stricter conformance to the spec, along with a flag that allows you to (in effect) opt out of that behaviour, while expecting most users to prefer to add the flag... (We're both responding here and on Discourse - can I suggest we find a single place to have the discussion until we get some form of consensus?) |
Speaking of interest - I wanted to just document a case where more selective We would be rather interested in Airflow (to the point of maybe proposing an implementation in I know our case is rather niche, but let me explain it, maybe it will be useful for others. Or maybe someone will direct us in finding a better way of doing what we are doing (maybe there are better ways already that I am not aware of). In Airflow's CI we always build many packges together from our monorepo: airflow + ~90 providers. Sometimes in main version we build packages that will depend on the FUTURE version of core airflow. For example (recently) a) we prepare During our CI we want to install both, because we want to run tests with both packages installed as part of the future PROD container image where both are installed. With the current So what I would love to have is to be able to specify for which packages we accept pre-release versions. BTW. It's not a high priority issue for us and lack of this (optional and niche, I understand) feature is not blocking us. We currently do that by custom pre-processing of all the .dev0 providers to replace BTW. It's very similar story when we have two providers and one of them depends on the "future" version of the other provider - and we solve it in similar way. |
Tagently to your use case, but of maybe useful context, it's trying to install |
Very tangently to that one... The So technically what you are trying to do there is not supported by Airflow and if you want to install all extras of Airflow (so far) you really need to use all individual extras - especially if you want to install airflow with constraints - rather than From https://airflow.apache.org/docs/apache-airflow/stable/extra-packages-ref.html#bundle-extras :
Luckily the big change I am about to merge for 2.9 line (and possibly even cherry-pick for 2.8.1 release of Airflow) apache/airflow#36537 - which you were commenting on :) - makes Airflow compatible with PEP-440 PEP-517 PEP-518 PEP-561 PEP-621 PEP-660 PEP-685 in one go and we will hopefully be on the "forefront" of Python packaging - including using Hatchling as build backend and recommending Hatch as front-end. And a side-effect is that |
Good to know, but my main use case for |
Oh yeah. I imagine that our case is a good one to test on - with 650+ "all" dependencies and things like botocore dependency with 100s of applicable versions :). I've spend a lot of time scratching my head trying to solve some of the backtracking issues there. The bad news (for your tests - but good news for our users) is that as part of my PR I bumped a lot of min-versions for a lot of our old dependencies which will make it easier for resolver (i.e. far less number of candidates to consider). But you can still use older versions of Airflow for that. But even there, I'd recommend to do your tests all the resolve algorithms in a bit different way:
Or equivlent. This was the To be honest I am seriously impressed with the way how the PEPs made it possible (I read all of them + accompanying discussions and I'd say some of the decisions made and especially rejected alternatives were great). It's a marvel of a design - complex on the inside - for good, historical reasons - but very customizable / extensible and rather simple on the outside once you understand the purpose of it and why it's implemented the way it is. Kudos for the whole |
Description
According to the documentation:
Pip implements the first bullet point with the
--pre
flag. But I am unsure how to get Pip to follow the second flag, for example if installed "opentelemetry-exporter-prometheus" I will get a pre-release, but I would like it to give an error with some option.Expected behavior
ERROR: Could not find a version that satisfies the requirement opentelemetry-exporter-prometheus
pip version
23.3.2
Python version
3.11
OS
Linux
How to Reproduce
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: