Skip to content

Commit

Permalink
deps.py fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Aug 15, 2021
1 parent 3aa0f04 commit dd0d119
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions dev/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ def _extract_package(deps_dir, pkg_path, pkg_dir):
root = os.path.abspath(os.path.join(deps_dir, '..'))
install_lib = os.path.basename(deps_dir)

# Ensure we pick up previously installed packages when running
# setup.py. This is important for things like setuptools.
env = os.environ.copy()
if sys.version_info >= (3,):
env['PYTHONPATH'] = deps_dir
else:
env[b'PYTHONPATH'] = deps_dir.encode('utf-8')

_execute(
[
sys.executable,
Expand All @@ -364,7 +372,8 @@ def _extract_package(deps_dir, pkg_path, pkg_dir):
'--install-lib=%s' % install_lib,
'--no-compile'
],
setup_dir
setup_dir,
env=env
)

finally:
Expand Down Expand Up @@ -661,7 +670,7 @@ def _parse_requires(path):
return packages


def _execute(params, cwd, retry=None):
def _execute(params, cwd, retry=None, env=None):
"""
Executes a subprocess
Expand All @@ -682,7 +691,8 @@ def _execute(params, cwd, retry=None):
params,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=cwd
cwd=cwd,
env=env
)
stdout, stderr = proc.communicate()
code = proc.wait()
Expand Down Expand Up @@ -845,12 +855,13 @@ def _pep425tags():
if sys.platform == 'win32':
if 'amd64' in sys.version.lower():
arches = ['win_amd64']
arches = [sys.platform]
else:
arches = [sys.platform]
elif hasattr(os, 'uname'):
(plat, _, _, _, machine) = os.uname()
plat = plat.lower().replace('/', '')
machine.replace(' ', '_').replace('/', '_')
if plat == 'linux' and sys.maxsize == 2147483647:
if plat == 'linux' and sys.maxsize == 2147483647 and 'arm' not in machine:
machine = 'i686'
arch = '%s_%s' % (plat, machine)
if _pep425_supports_manylinux():
Expand Down

0 comments on commit dd0d119

Please sign in to comment.