pipenv
pipenv copied to clipboard
sys_platform = "== 'win32'" no longer works
Issue description
We are building our project for different platforms, but we have modules that should only be installed on certain platforms. So far we have used the following notation:
sys_platform = "== 'win32'"
This worked fine with release 2018.11.26, but not with release 2020.5.28 anymore.
Expected result
A module with the limitation for a certain platform should not be installed on all other platforms.
Actual result
The limitation for a certain platform is ignored.
Steps to replicate
Write a module with the restriction for a specific platform in the notation sys_platform = "== 'win32'" into a pipfile and install pipfile.
Please fill out the entire bug report including your Pipfile
where you are having this issue. I cannot reproduce this issue locally.
To confirm, this is not specified in the report, but this is about using this syntax in a Pipfile
, correct?
I think I am also having this issue with sys_platform = "== 'Linux'"
.
Here is a Pipfile which works on pipenv==2018.11.26
but fails with pipenv==2020.6.2
:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[packages]
google-python-cloud-debugger = {version = "*",sys_platform = "== 'Linux'"}
[dev-packages]
[requires]
python_version = "3.7"
Output:
pipenv lock
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✘ Locking Failed!
Ignoring error when setting locale: unsupported locale setting
Ignoring error when setting locale: unsupported locale setting
Traceback (most recent call last):
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/resolver.py", line 807, in <module>
main()
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/resolver.py", line 803, in main
parsed.requirements_dir, parsed.packages, parse_only=parsed.parse_only)
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/resolver.py", line 785, in _main
resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/resolver.py", line 753, in resolve_packages
requirements_dir=requirements_dir,
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/resolver.py", line 736, in resolve
req_dir=requirements_dir
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/utils.py", line 1386, in resolve_deps
req_dir=req_dir,
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/utils.py", line 1091, in actually_resolve_deps
deps, index_lookup, markers_lookup, project, sources, req_dir, clear, pre
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/utils.py", line 649, in create
pre=pre, clear=clear
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/utils.py", line 463, in get_metadata
req, resolver=transient_resolver
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/utils.py", line 610, in get_deps_from_req
best_match = pypi.find_best_match(req.ireq) if pypi else None
File "/Users/dhendry/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 202, in find_best_match
raise NoCandidateFound(ireq, all_candidates, self.finder)
pipenv.patched.piptools.exceptions.NoCandidateFound: Could not find a version that matches google-python-cloud-debugger
No versions found
Was https://pypi.org/simple reachable?
Misc other notes:
uname -sr
Darwin 19.5.0
Just chiming in to say I'm seeing this issue too
@dhendry the issues don't look the same. Did you access pypi behind a proxy? Was https://pypi.org/simple reachable?
@frostming No proxy, no problems with other packages, pypi.org is reachable:
Any update on this? Its pretty annoying
@frostming you earlier commented that the issues do not look the same. Do you want me to open a new issue?
@techalchemy This issue still has a Status: Needs More Information
label. I believe I have included a simple example to reproduce the issue. Is there any additional information I could provide to help you out?
any updates?
Sorry, I do not have an update at this time. Possibly related: https://github.com/pypa/pipenv/issues/5239
I would ask, could this be rechecked with pipenv==2022.8.19
and if possible provide a reproduction example?