Example #1
0
 def test_resolve(req_name, req_version, platform, substr, extra_flags=None):
   pex_path, results = do_resolve(req_name, req_version, platform, extra_flags)
   results.assert_success()
   included_dists = get_dep_dist_names_from_pex(pex_path, req_name.replace('-', '_'))
   assert any(
     substr in d for d in included_dists
   ), 'couldnt find {} in {}'.format(substr, included_dists)
Example #2
0
def test_pex_multi_resolve():
    """Tests multi-interpreter + multi-platform resolution."""
    with temporary_dir() as output_dir:
        pex_path = os.path.join(output_dir, 'pex.pex')
        results = run_pex_command([
            '--disable-cache', 'lxml==3.8.0', '--no-build',
            '--platform=linux-x86_64', '--platform=macosx-10.6-x86_64',
            '--python=python2.7', '--python=python3.6', '-o', pex_path
        ])
        results.assert_success()

        included_dists = get_dep_dist_names_from_pex(pex_path, 'lxml')
        assert len(included_dists) == 4
        for dist_substr in ('-cp27-', '-cp36-', '-manylinux1_x86_64',
                            '-macosx_'):
            assert any(dist_substr in f for f in included_dists)
Example #3
0
def test_pex_multi_resolve():
  """Tests multi-interpreter + multi-platform resolution."""
  with temporary_dir() as output_dir:
    pex_path = os.path.join(output_dir, 'pex.pex')
    results = run_pex_command(['--disable-cache',
                               'lxml==3.8.0',
                               '--platform=manylinux1-x86_64',
                               '--platform=macosx-10.6-x86_64',
                               '--python=python2.7',
                               '--python=python3.6',
                               '-o', pex_path])
    results.assert_success()

    included_dists = get_dep_dist_names_from_pex(pex_path, 'lxml')
    assert len(included_dists) == 4
    for dist_substr in ('-cp27-', '-cp36-', '-manylinux1_x86_64', '-macosx_'):
      assert any(dist_substr in f for f in included_dists)
Example #4
0
def test_pex_multi_resolve_2():
    """Tests multi-interpreter + multi-platform resolution using extended platform notation."""
    with temporary_dir() as output_dir:
        pex_path = os.path.join(output_dir, 'pex.pex')
        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=macosx-10.6-x86_64-cp-36-m',
            '--platform=macosx-10.6-x86_64-cp-27-m', '-o', pex_path
        ])
        results.assert_success()

        included_dists = get_dep_dist_names_from_pex(pex_path, 'lxml')
        assert len(included_dists) == 4
        for dist_substr in ('-cp27-', '-cp36-', '-manylinux1_x86_64',
                            '-macosx_'):
            assert any(dist_substr in f for f in included_dists), (
                '{} was not found in wheel'.format(dist_substr))