aboutsummaryrefslogtreecommitdiffstats
path: root/release
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-11-25 16:46:49 +0100
committerGitHub <noreply@github.com>2016-11-25 16:46:49 +0100
commite3dc46a8cd835671ff2a5a85ef9fcbfa70030f5e (patch)
tree4fa86dfcae6838682f3db7187219f25ef264d2a5 /release
parentde9e724a66bea077d33446adbef9dc259d7814c5 (diff)
downloadmitmproxy-e3dc46a8cd835671ff2a5a85ef9fcbfa70030f5e.tar.gz
mitmproxy-e3dc46a8cd835671ff2a5a85ef9fcbfa70030f5e.tar.bz2
mitmproxy-e3dc46a8cd835671ff2a5a85ef9fcbfa70030f5e.zip
fix pyinstaller (#1788)
Diffstat (limited to 'release')
-rw-r--r--release/hooks/hook-mitmproxy.addons.onboardingapp.py3
-rw-r--r--release/hooks/hook-pydivert.py3
-rwxr-xr-xrelease/rtool.py22
-rw-r--r--release/setup.py6
-rw-r--r--release/specs/mitmdump.spec23
-rw-r--r--release/specs/mitmproxy.spec23
-rw-r--r--release/specs/mitmweb.spec23
-rw-r--r--release/specs/pathoc.spec23
-rw-r--r--release/specs/pathod.spec23
9 files changed, 27 insertions, 122 deletions
diff --git a/release/hooks/hook-mitmproxy.addons.onboardingapp.py b/release/hooks/hook-mitmproxy.addons.onboardingapp.py
new file mode 100644
index 00000000..1587f40a
--- /dev/null
+++ b/release/hooks/hook-mitmproxy.addons.onboardingapp.py
@@ -0,0 +1,3 @@
+from PyInstaller.utils.hooks import collect_data_files
+
+datas = collect_data_files('mitmproxy.addons.onboardingapp') \ No newline at end of file
diff --git a/release/hooks/hook-pydivert.py b/release/hooks/hook-pydivert.py
new file mode 100644
index 00000000..3fe8c552
--- /dev/null
+++ b/release/hooks/hook-pydivert.py
@@ -0,0 +1,3 @@
+from PyInstaller.utils.hooks import collect_data_files
+
+datas = collect_data_files('pydivert.windivert_dll') \ No newline at end of file
diff --git a/release/rtool.py b/release/rtool.py
index fbca40e2..3bc3fdaa 100755
--- a/release/rtool.py
+++ b/release/rtool.py
@@ -40,6 +40,8 @@ BUILD_DIR = join(RELEASE_DIR, "build")
DIST_DIR = join(RELEASE_DIR, "dist")
PYINSTALLER_SPEC = join(RELEASE_DIR, "specs")
+# PyInstaller 3.2 does not bundle pydivert's Windivert binaries
+PYINSTALLER_HOOKS = join(RELEASE_DIR, "hooks")
PYINSTALLER_TEMP = join(BUILD_DIR, "pyinstaller")
PYINSTALLER_DIST = join(BUILD_DIR, "binaries")
@@ -166,7 +168,7 @@ def make_wheel():
print("Creating wheel...")
subprocess.check_call(
[
- "python", "./setup.py", "-q",
+ "python3", "./setup.py", "-q",
"bdist_wheel", "--dist-dir", DIST_DIR, "--universal"
],
cwd=ROOT_DIR
@@ -175,7 +177,7 @@ def make_wheel():
print("Creating virtualenv for test install...")
if exists(VENV_DIR):
shutil.rmtree(VENV_DIR)
- subprocess.check_call(["virtualenv", "-q", VENV_DIR])
+ subprocess.check_call(["python3", "-m", "virtualenv", "-q", VENV_DIR])
with chdir(DIST_DIR):
print("Install wheel into virtualenv...")
@@ -198,7 +200,11 @@ def make_wheel():
@cli.command("bdist")
@click.option("--use-existing-wheel/--no-use-existing-wheel", default=False)
-@click.argument("pyinstaller_version", envvar="PYINSTALLER_VERSION", default="PyInstaller~=3.1.1")
+@click.argument(
+ "pyinstaller_version",
+ envvar="PYINSTALLER_VERSION",
+ default="git+https://github.com/pyinstaller/pyinstaller.git@483c819d6a256b58db6740696a901bd41c313f0c"
+)
@click.argument("setuptools_version", envvar="SETUPTOOLS_VERSION", default="setuptools>=25.1.0,!=25.1.1")
@click.pass_context
def make_bdist(ctx, use_existing_wheel, pyinstaller_version, setuptools_version):
@@ -230,12 +236,20 @@ def make_bdist(ctx, use_existing_wheel, pyinstaller_version, setuptools_version)
"--clean",
"--workpath", PYINSTALLER_TEMP,
"--distpath", PYINSTALLER_DIST,
+ "--additional-hooks-dir", PYINSTALLER_HOOKS,
+ # PyInstaller 3.2 does not handle Python 3.5's ucrt correctly.
+ "-p", r"C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86",
+ "--onefile",
+ "--console",
+ "--icon", "icon.ico",
# This is PyInstaller, so setting a
# different log level obviously breaks it :-)
# "--log-level", "WARN",
- "%s.spec" % tool
+ tool
]
)
+ # Delete the spec file - we're good without.
+ os.remove("{}.spec".format(tool))
# Test if it works at all O:-)
executable = join(PYINSTALLER_DIST, tool)
diff --git a/release/setup.py b/release/setup.py
index 5781ff9b..d784a4a5 100644
--- a/release/setup.py
+++ b/release/setup.py
@@ -6,10 +6,10 @@ setup(
py_modules=["rtool"],
install_requires=[
"click>=6.2, <7.0",
- "twine>=1.6.5, <1.8",
- "virtualenv>=14.0.5, <15.1",
+ "twine>=1.6.5, <1.9",
+ "virtualenv>=14.0.5, <15.2",
"wheel>=0.29.0, <0.30",
- "pysftp>=0.2.8, !=0.2.9, <0.3",
+ "pysftp==0.2.8",
],
entry_points={
"console_scripts": [
diff --git a/release/specs/mitmdump.spec b/release/specs/mitmdump.spec
deleted file mode 100644
index 5314137d..00000000
--- a/release/specs/mitmdump.spec
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- mode: python -*-
-
-from PyInstaller.utils.hooks import collect_data_files
-
-a = Analysis(['mitmdump'],
- binaries=None,
- datas=collect_data_files("mitmproxy.addons.onboardingapp"),
- hiddenimports=[],
- hookspath=None,
- runtime_hooks=None,
- excludes=None)
-pyz = PYZ(a.pure, a.zipped_data)
-exe = EXE(pyz,
- a.scripts,
- a.binaries,
- a.zipfiles,
- a.datas,
- name='mitmdump',
- debug=False,
- strip=None,
- upx=True,
- console=True,
- icon='icon.ico' )
diff --git a/release/specs/mitmproxy.spec b/release/specs/mitmproxy.spec
deleted file mode 100644
index b0141e5e..00000000
--- a/release/specs/mitmproxy.spec
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- mode: python -*-
-
-from PyInstaller.utils.hooks import collect_data_files
-
-a = Analysis(['mitmproxy'],
- binaries=None,
- datas=collect_data_files("mitmproxy.addons.onboardingapp"),
- hiddenimports=[],
- hookspath=None,
- runtime_hooks=None,
- excludes=None)
-pyz = PYZ(a.pure, a.zipped_data)
-exe = EXE(pyz,
- a.scripts,
- a.binaries,
- a.zipfiles,
- a.datas,
- name='mitmproxy',
- debug=False,
- strip=None,
- upx=True,
- console=True,
- icon='icon.ico' )
diff --git a/release/specs/mitmweb.spec b/release/specs/mitmweb.spec
deleted file mode 100644
index ea6192a4..00000000
--- a/release/specs/mitmweb.spec
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- mode: python -*-
-
-from PyInstaller.utils.hooks import collect_data_files
-
-a = Analysis(['mitmweb'],
- binaries=None,
- datas=collect_data_files("mitmproxy"),
- hiddenimports=[],
- hookspath=None,
- runtime_hooks=None,
- excludes=None)
-pyz = PYZ(a.pure, a.zipped_data)
-exe = EXE(pyz,
- a.scripts,
- a.binaries,
- a.zipfiles,
- a.datas,
- name='mitmweb',
- debug=False,
- strip=None,
- upx=True,
- console=True,
- icon='icon.ico' )
diff --git a/release/specs/pathoc.spec b/release/specs/pathoc.spec
deleted file mode 100644
index d4f4d0d9..00000000
--- a/release/specs/pathoc.spec
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- mode: python -*-
-
-from PyInstaller.utils.hooks import collect_data_files
-
-a = Analysis(['pathoc'],
- binaries=None,
- datas=None,
- hiddenimports=['_cffi_backend'],
- hookspath=None,
- runtime_hooks=None,
- excludes=None)
-pyz = PYZ(a.pure, a.zipped_data)
-exe = EXE(pyz,
- a.scripts,
- a.binaries,
- a.zipfiles,
- a.datas,
- name='pathoc',
- debug=False,
- strip=None,
- upx=True,
- console=True,
- icon='icon.ico' )
diff --git a/release/specs/pathod.spec b/release/specs/pathod.spec
deleted file mode 100644
index f3a977f2..00000000
--- a/release/specs/pathod.spec
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- mode: python -*-
-
-from PyInstaller.utils.hooks import collect_data_files
-
-a = Analysis(['pathod'],
- binaries=None,
- datas=collect_data_files("pathod"),
- hiddenimports=['_cffi_backend'],
- hookspath=None,
- runtime_hooks=None,
- excludes=None)
-pyz = PYZ(a.pure, a.zipped_data)
-exe = EXE(pyz,
- a.scripts,
- a.binaries,
- a.zipfiles,
- a.datas,
- name='pathod',
- debug=False,
- strip=None,
- upx=True,
- console=True,
- icon='icon.ico' )