summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2015-06-23 18:36:10 +0200
committerFlorian Bruhin <git@the-compiler.org>2015-06-23 23:31:28 +0200
commit3dbf3f9e0ab69bfe33d3f8ead90026df6a3c57b0 (patch)
tree5cab5cb4dfa68b06b620bb1632c88653ca6b0dca
parentd02b63a847c78729514c4d815c128cf8d2353027 (diff)
downloadqutebrowser-3dbf3f9e0ab69bfe33d3f8ead90026df6a3c57b0.tar.gz
qutebrowser-3dbf3f9e0ab69bfe33d3f8ead90026df6a3c57b0.zip
Use tox/virtualenv to build Windows packages.
This makes sure we have all needed dependencies installed in the version which is in requirements.txt. Fixes #776.
-rwxr-xr-xscripts/build_release.py26
-rw-r--r--tox.ini10
2 files changed, 30 insertions, 6 deletions
diff --git a/scripts/build_release.py b/scripts/build_release.py
index 9f051ff18..f76f6bf27 100755
--- a/scripts/build_release.py
+++ b/scripts/build_release.py
@@ -46,6 +46,20 @@ def call_script(name, *args, python=sys.executable):
subprocess.check_call([python, path] + list(args))
+def call_freeze(*args, python=sys.executable):
+ """Call freeze.py via tox.
+
+ Args:
+ *args: The arguments to pass.
+ python: The python interpreter to use.
+ """
+ env = os.environ.copy()
+ env['PYTHON'] = python
+ subprocess.check_call(
+ [sys.executable, '-m', 'tox', '-e', 'cxfreeze-windows'] + list(args),
+ env=env)
+
+
def build_common(args):
"""Common buildsteps used for all OS'."""
utils.print_title("Running asciidoc2html.py")
@@ -69,17 +83,17 @@ def build_windows():
parts = str(sys.version_info.major), str(sys.version_info.minor)
ver = ''.join(parts)
dotver = '.'.join(parts)
- python_x86 = r'C:\Python{}_x32\python.exe'.format(ver)
- python_x64 = r'C:\Python{}\python.exe'.format(ver)
+ python_x86 = r'C:\Python{}_x32'.format(ver)
+ python_x64 = r'C:\Python{}'.format(ver)
utils.print_title("Running 32bit freeze.py build_exe")
- call_script('freeze.py', 'build_exe', python=python_x86)
+ call_freeze('build_exe', python=python_x86)
utils.print_title("Running 64bit freeze.py build_exe")
- call_script('freeze.py', 'build_exe', python=python_x64)
+ call_freeze('build_exe', python=python_x64)
utils.print_title("Running 32bit freeze.py bdist_msi")
- call_script('freeze.py', 'bdist_msi', python=python_x86)
+ call_freeze('bdist_msi', python=python_x86)
utils.print_title("Running 64bit freeze.py bdist_msi")
- call_script('freeze.py', 'bdist_msi', python=python_x64)
+ call_freeze('bdist_msi', python=python_x64)
destdir = os.path.join('dist', 'zip')
_maybe_remove(destdir)
diff --git a/tox.ini b/tox.ini
index 5af03e938..af44b9b00 100644
--- a/tox.ini
+++ b/tox.ini
@@ -170,6 +170,16 @@ commands =
{envpython} scripts/freeze.py build_exe --qute-skip-html -b {envdir}/build
{envdir}/build/qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit"
+[testenv:cxfreeze-windows]
+# PYTHON is actually required when using this env, but the entire tox.ini would
+# fail if we didn't have a fallback defined.
+basepython = {env:PYTHON:}/python.exe
+skip_install = true
+deps = {[testenv:smoke-frozen]deps}
+commands =
+ {envpython} scripts/link_pyqt.py --tox {envdir}
+ {envpython} scripts/freeze.py {posargs}
+
[pytest]
norecursedirs = .tox .venv
markers =