Skip to content

Commit

Permalink
Kill --manylinux, expect this in exact platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Nov 13, 2019
1 parent 26bc5bb commit f0bd57f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 41 deletions.
10 changes: 0 additions & 10 deletions pex/bin/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,6 @@ def configure_clp_pex_resolution(parser):
callback=parse_bool,
help='Whether to allow building of distributions from source; Default: allow builds')

group.add_option(
'--manylinux', '--no-manylinux', '--no-use-manylinux',
dest='use_manylinux',
default=True,
action='callback',
callback=parse_bool,
help='Whether to allow resolution of manylinux dists for linux target platforms; '
'Default: allow manylinux')

group.add_option(
'--transitive', '--no-transitive', '--intransitive',
dest='transitive',
Expand Down Expand Up @@ -554,7 +545,6 @@ def walk_and_do(fn, src_dir):
requirement_files=options.requirement_files,
constraint_files=options.constraint_files,
allow_prereleases=options.allow_prereleases,
use_manylinux=options.use_manylinux,
transitive=options.transitive,
interpreters=interpreters,
platforms=options.platforms,
Expand Down
14 changes: 1 addition & 13 deletions pex/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from __future__ import absolute_import, print_function

import os
import re
import sys
from collections import deque

Expand Down Expand Up @@ -77,7 +76,6 @@ def download_distributions(target,
requirement_files=None,
constraint_files=None,
allow_prereleases=False,
use_manylinux=True,
transitive=True,
interpreter=None,
platform=None,
Expand All @@ -103,17 +101,7 @@ def download_distributions(target,
# We're either resolving for a different host / platform or a different interpreter for the
# current platform that we have no access to; so we need to let pip know and not otherwise
# pickup platform info from the interpreter we execute pip with.

platform_name = platform_info.platform
# TODO(John Sirois): Consider killing; The extended platform should simply be written this
# way by the caller in the 1st place - no need to carry around a bool:
# 1. It's redundant.
# 2. It's lossy. There are actually, currently, manylinux1, manylinux2010 and manylinux2014
# psuedo-platforms that can be specified.
if use_manylinux:
platform_name = re.sub(r'^linux_', 'manylinux1_', platform_name)

download_cmd.extend(['--platform', platform_name])
download_cmd.extend(['--platform', platform_info.platform])
download_cmd.extend(['--implementation', platform_info.impl])
download_cmd.extend(['--python-version', platform_info.version])
download_cmd.extend(['--abi', platform_info.abi])
Expand Down
3 changes: 0 additions & 3 deletions pex/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def resolve(requirements=None,
requirement_files=None,
constraint_files=None,
allow_prereleases=False,
use_manylinux=True,
transitive=True,
interpreter=None,
platform=None,
Expand Down Expand Up @@ -147,7 +146,6 @@ def resolve(requirements=None,
requirement_files=requirement_files,
constraint_files=constraint_files,
allow_prereleases=allow_prereleases,
use_manylinux=use_manylinux,
transitive=transitive,
interpreter=interpreter,
platform=platform,
Expand Down Expand Up @@ -249,7 +247,6 @@ def resolve_multi(requirements=None,
requirement_files=None,
constraint_files=None,
allow_prereleases=False,
use_manylinux=True,
transitive=True,
interpreters=None,
platforms=None,
Expand Down
1 change: 0 additions & 1 deletion pex/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
IS_LINUX = "platform.system() == 'Linux'"
IS_NOT_LINUX = "platform.system() != 'Linux'"
NOT_CPYTHON27_OR_OSX = "%s or %s" % (NOT_CPYTHON27, IS_NOT_LINUX)
NOT_CPYTHON27_OR_LINUX = "%s or %s" % (NOT_CPYTHON27, IS_LINUX)
NOT_CPYTHON36_OR_LINUX = "%s or %s" % (NOT_CPYTHON36, IS_LINUX)


Expand Down
35 changes: 21 additions & 14 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,8 @@ def test_pex_multi_resolve_2():
results = run_pex_command(['--disable-cache',
'lxml==3.8.0',
'--no-build',
'--platform=linux-x86_64-cp-36-m',
'--platform=linux-x86_64-cp-27-m',
'--platform=manylinux1-x86_64-cp-36-m',
'--platform=manylinux1-x86_64-cp-27-m',
'--platform=macosx-10.6-x86_64-cp-36-m',
'--platform=macosx-10.6-x86_64-cp-27-m',
'-o', pex_path])
Expand Down Expand Up @@ -822,8 +822,8 @@ def test_resolve(req_name, req_version, platform, substr, extra_flags=None):
substr in d for d in included_dists
), 'couldnt find {} in {}'.format(substr, included_dists)

def ensure_failure(req_name, req_version, platform, extra_flags):
pex_path, results = do_resolve(req_name, req_version, platform, extra_flags)
def ensure_failure(req_name, req_version, platform):
pex_path, results = do_resolve(req_name, req_version, platform)
results.assert_failure()

yield test_resolve, ensure_failure
Expand All @@ -841,19 +841,26 @@ def test_pex_manylinux_and_tag_selection_linux_msgpack():
if current_version != (3, 3) and current_version < (3, 6):
ver = '{}{}'.format(*current_version)
test_msgpack(
'linux-x86_64-cp-{}-m'.format(ver),
'manylinux1-x86_64-cp-{}-m'.format(ver),
'msgpack_python-0.4.7-cp{ver}-cp{ver}m-manylinux1_x86_64.whl'.format(ver=ver)
)

test_msgpack('linux-x86_64-cp-27-m', 'msgpack_python-0.4.7-cp27-cp27m-manylinux1_x86_64.whl')
test_msgpack('linux-x86_64-cp-27-mu', 'msgpack_python-0.4.7-cp27-cp27mu-manylinux1_x86_64.whl')
test_msgpack('linux-i686-cp-27-m', 'msgpack_python-0.4.7-cp27-cp27m-manylinux1_i686.whl')
test_msgpack('linux-i686-cp-27-mu', 'msgpack_python-0.4.7-cp27-cp27mu-manylinux1_i686.whl')
test_msgpack('linux-x86_64-cp-27-mu', 'msgpack_python-0.4.7-cp27-cp27mu-manylinux1_x86_64.whl')
test_msgpack('linux-x86_64-cp-34-m', 'msgpack_python-0.4.7-cp34-cp34m-manylinux1_x86_64.whl')
test_msgpack('linux-x86_64-cp-35-m', 'msgpack_python-0.4.7-cp35-cp35m-manylinux1_x86_64.whl')
test_msgpack('manylinux1-x86_64-cp-27-m',
'msgpack_python-0.4.7-cp27-cp27m-manylinux1_x86_64.whl')
test_msgpack('manylinux2010-x86_64-cp-27-mu',
'msgpack_python-0.4.7-cp27-cp27mu-manylinux1_x86_64.whl')
test_msgpack('manylinux2014-i686-cp-27-m',
'msgpack_python-0.4.7-cp27-cp27m-manylinux1_i686.whl')
test_msgpack('manylinux1-i686-cp-27-mu',
'msgpack_python-0.4.7-cp27-cp27mu-manylinux1_i686.whl')
test_msgpack('manylinux2010-x86_64-cp-27-mu',
'msgpack_python-0.4.7-cp27-cp27mu-manylinux1_x86_64.whl')
test_msgpack('manylinux2014-x86_64-cp-34-m',
'msgpack_python-0.4.7-cp34-cp34m-manylinux1_x86_64.whl')
test_msgpack('manylinux1-x86_64-cp-35-m',
'msgpack_python-0.4.7-cp35-cp35m-manylinux1_x86_64.whl')

ensure_failure(msgpack, msgpack_ver, 'linux-x86_64-cp-27-m', '--no-manylinux')
ensure_failure(msgpack, msgpack_ver, 'linux-x86_64-cp-27-m')


def test_pex_manylinux_and_tag_selection_lxml_osx():
Expand Down Expand Up @@ -1011,7 +1018,7 @@ def test_multiplatform_entrypoint():
'--no-build',
'--python={}'.format(interpreter),
'--python-shebang=#!{}'.format(interpreter),
'--platform=linux-x86_64-cp-36-m',
'--platform=manylinux1-x86_64-cp-36-m',
'--platform=macosx-10.13-x86_64-cp-36-m',
'-c', 'p537',
'-o', pex_out_path,
Expand Down

0 comments on commit f0bd57f

Please sign in to comment.