Skip to content

Commit

Permalink
Merge pull request #197 from mayeut/cibw-dir
Browse files Browse the repository at this point in the history
Use specific cibw directory on Windows to prevent collisions with installed software
  • Loading branch information
joerick authored Nov 10, 2019
2 parents 42d1610 + c82330b commit 053a154
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_nuget_args(configuration):
python_name = "python" if configuration.version[0] == '3' else "python2"
if configuration.arch == "32":
python_name = python_name + "x86"
return [python_name, "-Version", configuration.version, "-OutputDirectory", "C:/python"]
return [python_name, "-Version", configuration.version, "-OutputDirectory", "C:/cibw/python"]

def get_python_configurations(build_selector):
PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'arch', 'identifier'])
Expand Down Expand Up @@ -65,6 +65,9 @@ def simple_shell(args, env=None, cwd=None):
return subprocess.check_call(' '.join(args), env=env, cwd=cwd)
def download(url, dest):
print('+ Download ' + url + ' to ' + dest)
dest_dir = os.path.dirname(dest)
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
response = urlopen(url)
try:
with open(dest, 'wb') as file:
Expand All @@ -89,10 +92,10 @@ def shell(args, env=None, cwd=None):
built_wheel_dir = os.path.join(temp_dir, 'built_wheel')

# install nuget as best way to provide python
nuget = 'C:\\nuget.exe'
nuget = 'C:\\cibw\\nuget.exe'
download('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', nuget)
# get pip fo this installation which not have.
get_pip_script = 'C:\\get-pip.py'
get_pip_script = 'C:\\cibw\\get-pip.py'
download('https://bootstrap.pypa.io/get-pip.py', get_pip_script)

python_configurations = get_python_configurations(build_selector)
Expand Down

0 comments on commit 053a154

Please sign in to comment.