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

Allow for looser restrictions on require python version #4025

Open
alexanderepstein opened this issue Nov 14, 2019 · 3 comments
Open

Allow for looser restrictions on require python version #4025

alexanderepstein opened this issue Nov 14, 2019 · 3 comments
Labels
triage Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@alexanderepstein
Copy link

Is your feature request related to a problem? Please describe.

I constantly switch machines when developing a python project and between machines there are minor differences in the version of python installed on these machines. However my project only requires that I work in python 3 it does not matter if I work in python 3.6 or python 3.7.5.

Please let me know if something like this already exists as I am having trouble finding any documentation regarding this behavior.

Describe the solution you'd like

To use specific characters to signify what version of python I require.

Doing things like:

python_version = "3*" to signify any version that starts with 3

python_version = "3.6.*" to signify any version that starts with 3.6

python_version = "3.6+" to signify at least 3.6 or greater

python_version = "3.6.1+" to signify at least 3.6.1 or greater

I think those examples cover all the cases I can think of, but there could be more.

@alexanderepstein
Copy link
Author

One edge case would be if the user used

python_version = "3.6.1*"

I don't think this should be allowed because according to my examples above this means pipenv would allow 3.6.10 but not allow 3.6.2 and that just doesn't seem to make any sense.

@nicktimko
Copy link

Duplicate of #1050 which indicated the maintainers will not consider this.

#1050 (comment)
#1050 (comment)

If they did, I'd suggest semantics identical to package versions, rather than anything new (like the +)

@matteius matteius added the Type: Enhancement 💡 This is a feature or enhancement request. label Aug 22, 2022
@matteius
Copy link
Member

I have been playing around with a concept related to this and I have opened a draft PR: #5931

This patches the environment method used by the resolver for the duration of the resolve phase allowing overrides to be read in from the Pipfile resolver section (which would be a new reserved category). Here is an example.

[resolver]
python_full_version = "3.7.13"  # Markers evaluate to True that require any python_full_version markers in this range (in theory)
python_version = "3.7"   # Markers evaluate to True that require any python_version markers in this range (in theory)
finder_python = "3.7"  # The base python version to resolve against (used in the package finder)
os_name="win32"  # What operating system markers should evaluate to true (in theory)

Would appreciate if anyone has time to try it out and provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

3 participants