Skip to content

Commit

Permalink
Merge pull request #1056 from tjguk/make_use_venv
Browse files Browse the repository at this point in the history
Ensure that, if we're developing inside a venv, the venv python is used
  • Loading branch information
tjguk committed Jun 11, 2020
2 parents e3b7191 + a1db1a4 commit 7564b56
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions make.py
Expand Up @@ -60,7 +60,7 @@ def _process_code(executable, use_python, *args):
in the codebase, skipping docs and build artefacts
"""
if use_python:
execution = ["python", executable]
execution = [sys.executable, executable]
else:
execution = [executable]
returncodes = set()
Expand Down Expand Up @@ -219,7 +219,7 @@ def translateall():

result = subprocess.run(
[
"python",
sys.executable,
PYGETTEXT,
"mu/*",
"mu/debugger/*",
Expand All @@ -244,7 +244,7 @@ def run():
raise RuntimeError(
"Cannot run Mu;" "your Python virtualenv is not activated"
)
return subprocess.run(["python", "-m", "mu"]).returncode
return subprocess.run([sys.executable, "-m", "mu"]).returncode


@export
Expand All @@ -254,7 +254,7 @@ def dist():
check()
print("Checks pass; good to package")
return subprocess.run(
["python", "setup.py", "sdist", "bdist_wheel"]
[sys.executable, "setup.py", "sdist", "bdist_wheel"]
).returncode


Expand Down Expand Up @@ -285,7 +285,7 @@ def win32():
check()
print("Building 32-bit Windows installer")
return subprocess.run(
["python", "win_installer.py", "32", "setup.py"]
[sys.executable, "win_installer.py", "32", "setup.py"]
).returncode


Expand All @@ -296,7 +296,7 @@ def win64():
check()
print("Building 64-bit Windows installer")
return subprocess.run(
["python", "win_installer.py", "64", "setup.py"]
[sys.executable, "win_installer.py", "64", "setup.py"]
).returncode


Expand Down
12 changes: 6 additions & 6 deletions setup.py
Expand Up @@ -21,9 +21,9 @@


install_requires = [
'PyQt5==5.12.1;"arm" not in platform_machine',
'QScintilla==2.11.1;"arm" not in platform_machine',
'PyQtChart==5.12;"arm" not in platform_machine',
'PyQt5==5.15;"arm" not in platform_machine',
'QScintilla==2.11.4;"arm" not in platform_machine',
'PyQtChart==5.15;"arm" not in platform_machine',
# `flake8` is actually a testing/packaging dependency that, among other
# packages, brings in `pycodestyle` and `pyflakes` which are runtime
# dependencies. For the sake of "locality", it is being declared here,
Expand All @@ -33,13 +33,13 @@
"pycodestyle >= 2.5.0, < 2.6.0",
"pyflakes >= 2.1.0, < 2.2.0",
"pyserial==3.4",
"qtconsole==4.4.3",
"qtconsole==4.7.4",
"pgzero==1.2",
"appdirs>=1.4.3",
"semver>=2.8.0",
"nudatus>=0.0.3",
'black>=18.9b0;python_version > "3.5"',
"Flask==1.0.2",
"Flask==1.1.2",
]


Expand All @@ -57,7 +57,7 @@
"wheel",
"twine",
# Windows native packaging (see win_installer.py).
'requests==2.21.0;platform_system == "Windows"',
'requests==2.23.0;platform_system == "Windows"',
'yarg==0.1.9;platform_system == "Windows"',
# macOS native packaging (see Makefile)
'briefcase==0.2.9;platform_system == "Darwin"',
Expand Down
2 changes: 2 additions & 0 deletions win_installer.py
Expand Up @@ -152,6 +152,8 @@ def pypi_wheels_in(requirements):
print("-", requirement, end=" ")
package = yarg.get(name)
releases = package.release(version)
if not releases:
raise RuntimeError(f"No releases found for {package}")
if any(r.package_type == "wheel" for r in releases):
wheels.append(requirement)
feedback = "ok"
Expand Down

0 comments on commit 7564b56

Please sign in to comment.