Skip to content

Commit

Permalink
Top level Pipfile sys_platform markers should be transitive (#5892)
Browse files Browse the repository at this point in the history
* Top level Pipfile sys_platform markers should be transitive
* Add platform_machine top level specifier
* Handle case where markers is None
* more safety checks
* relock on python 3.7

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
matteius and cclauss committed Sep 1, 2023
1 parent 56d1e1c commit 7520f69
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 146 deletions.
15 changes: 9 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ sphinx-click = "==4.*"
sphinxcontrib-spelling = "==7.*"
click = "==8.0.3"
pypiserver = "==1.*"
stdeb = {version="*", markers="sys_platform == 'linux'"}
stdeb = {version="*", sys_platform = "== 'linux'"}
zipp = {version = "==3.6.0", markers = "python_version < '3.10'"}
pre-commit = "==2.*"
atomicwrites = {version = "*", markers="sys_platform == 'win32'"}
atomicwrites = {version = "*", sys_platform = "== 'win32'"}
pytest-cov = "==3.*"
pluggy = "==1.2.0" # Can be removed from Pipfile when dropping py 3.7
filelock = "==3.12.2" # Can be removed from Pipfile when dropping py 3.7
coverage = "==7.2.7" # Can be removed from Pipfile when dropping py 3.7
typing-extensions = "==4.*"
waitress = {version = "*", markers="sys_platform == 'win32'"}
gunicorn = {version = "*", markers="sys_platform == 'linux'"}
waitress = {version = "*", sys_platform = "== 'win32'"}
gunicorn = {version = "*", sys_platform = "== 'linux'"}
parse = "*"
importlib-metadata = {version = "*", markers="python_version < '3.8'"}
colorama= {version = "*", markers="sys_platform == 'win32'"}
importlib-metadata = {version = "*"}
colorama= {version = "*", sys_platform = "== 'win32'"}
myst-parser = {extras = ["linkify"], version = "*"}
invoke = "==2.0.0"
exceptiongroup = "==1.1.0"
Expand Down
156 changes: 16 additions & 140 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions news/5892.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Top level Pipfile sys_platform markers should be transitive; adds top level platform_machine entries that are also transitive. Marker entries continue to operate the same as before.
2 changes: 2 additions & 0 deletions pipenv/utils/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def from_pipfile(cls, name, pipfile):
marker_strings.append(pipfile.get("markers"))
if pipfile.get("sys_platform"):
marker_strings.append(f"sys_platform '{pipfile['sys_platform']}'")
if pipfile.get("platform_machine"):
marker_strings.append(f"platform_machine '{pipfile['platform_machine']}'")
markers = set()
for marker in marker_strings:
markers.add(marker)
Expand Down

0 comments on commit 7520f69

Please sign in to comment.