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

Can't specify minimal python version requirement #87

Open
matthieudelaro opened this issue Oct 25, 2017 · 7 comments
Open

Can't specify minimal python version requirement #87

matthieudelaro opened this issue Oct 25, 2017 · 7 comments

Comments

@matthieudelaro
Copy link

Hi all,

Sorry for this stupid question, still... I didn't find the answer anywhere.
According to this page, I should be able to specify a minimal python version requirement in Pipfile. Unfortunately, while I can specify an exact python version, it seems like I can't use >= at all. I tried other stuff such as >, 3.6+, etc. But nothing did the job. Any idea? Or is it an issue after all?

[requires]
python_version = "3.6" # works
python_version >= "3.6" #doesn't work => see error message below
# I also tried stuff like python_full_version >= "3.6"
 File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/pipfile/api.py", line 126, in load
    pipfile.data = p.parse()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/pipfile/api.py", line 82, in parse
    config.update(toml.loads(content))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/vendor/toml.py", line 176, in loads
    item + "'. Try quoting the key name.")
toml.TomlDecodeError: Found invalid character in key name: '>'. Try quoting the key name.

Here are the version installed on my system:

$pipenv run pip --version
pip 9.0.1 from /somepath/lib/python3.6/site-packages (python 3.6)
$ pipenv --version
pipenv, version 8.2.7
$ pipenv run python --version
Python 3.6.3
@pradyunsg
Copy link
Member

Maybe try:

python_version = "> 3.6"

?

@nateprewitt
Copy link
Member

Thanks for opening this issue, @matthieudelaro! So this has already been noted in a few other places in the issue tracker but we only support hard version pins for Python at the moment. We've had requests for ranges but it's unclear what the maintainer consensus is on this.

If you feel like making a doc change specifying our current limitations, I'm happy to review it.

@matthieudelaro
Copy link
Author

Thanks @pradyunsg, that gives the following:

$pipenv check
Checking PEP 508 requirements…
Specifier python_version does not match > 3.6 (3.6).
Failed!

Replacing > 3.6 with > 3.5 doesn't do the trick:

$ pipenv check
Checking PEP 508 requirements…
Specifier python_version does not match > 3.5 (3.6).
Failed!

Thanks @nateprewitt. So you mean reporting the problem with more details?

@pradyunsg
Copy link
Member

It's a simple comparison then, not a rich one. :/

Well, I was guessing anyway. :)

@nateprewitt
Copy link
Member

@matthieudelaro, no not quite, we're aware that this functionality does not work and it isn't supported by pipenv at this time. We may address this in the future but it's not on the immediate roadmap.

If you feel the docs are misleading about this, I'm happy to review a PR that makes corrections.

@nateprewitt
Copy link
Member

@matthieudelaro, sorry this is also the pipfile repo and this is a functionality question for pipenv. Please feel free to move the discussion over there.

@gsemet
Copy link

gsemet commented Nov 18, 2017

Ticket opened in pipenv#1050

jtmoon79 added a commit to jtmoon79/coverlovin2 that referenced this issue Feb 21, 2021
Does not allow range of python_version
pypa/pipfile#87
jtmoon79 added a commit to jtmoon79/coverlovin2 that referenced this issue Feb 21, 2021
Does not allow range of python_version
pypa/pipfile#87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants