Skip to content

Commit

Permalink
Implement pantsbuild#6450
Browse files Browse the repository at this point in the history
Although our solution is going to end up releasing a separate wheel for Py2 vs Py3 for pantsbuild.pants, this is a good starting point for the changes we need to make.
  • Loading branch information
Eric-Arellano committed Feb 1, 2019
1 parent 619586e commit 1b556c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/python/pants/backend/python/pants_requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def __call__(self, name=None, dist=None):
msg='The {} target only works for pantsbuild.pants '
'distributions, given {}'.format(self.alias, dist))

# Update the environment marker in lockstep with other changes as described in
# https://github.com/pantsbuild/pants/issues/6450
env_marker = "python_version>='2.7' and python_version<'3'"
env_marker = "python_version>='3.6' or (python_version>='2.7' and python_version<'3')"

requirement = PythonRequirement(requirement="{key}=={version} ; {env_marker}"
.format(key=dist,
Expand Down
6 changes: 2 additions & 4 deletions src/python/pants/releases/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class Package(object):
def __init__(self, name, target, bdist_wheel_flags=None):
self.name = name
self.target = target
# Update the --python-tag default in lockstep with other changes as described in
# https://github.com/pantsbuild/pants/issues/6450
self.bdist_wheel_flags = bdist_wheel_flags or ("--python-tag", "py27")
self.bdist_wheel_flags = bdist_wheel_flags or ("--python-tag", "py27.py36.py37")

def __lt__(self, other):
return self.name < other.name
Expand Down Expand Up @@ -93,7 +91,7 @@ def find_platform_name():
Package(
"pantsbuild.pants",
"//src/python/pants:pants-packaged",
bdist_wheel_flags=("--python-tag", "cp27", "--plat-name", find_platform_name()),
bdist_wheel_flags=("--python-tag", "cp27.cp36.cp37", "--plat-name", find_platform_name()),
),
Package("pantsbuild.pants.testinfra", "//tests/python/pants_test:test_infra"),
}
Expand Down

0 comments on commit 1b556c9

Please sign in to comment.