mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-02 02:37:15 +00:00
pyinstaller: move hooks into package
This commit is contained in:
parent
661b756520
commit
87d3d1cb88
8 changed files with 11 additions and 6 deletions
7
mitmproxy/utils/pyinstaller/__init__.py
Normal file
7
mitmproxy/utils/pyinstaller/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from pathlib import Path
|
||||
|
||||
here = Path(__file__).parent.absolute()
|
||||
|
||||
|
||||
def hook_dirs() -> list[str]:
|
||||
return [here]
|
||||
|
|
@ -357,7 +357,6 @@ def build_pyinstaller(be: BuildEnviron) -> None: # pragma: no cover
|
|||
click.echo("Building pyinstaller package...")
|
||||
|
||||
PYINSTALLER_SPEC = be.release_dir / "specs"
|
||||
PYINSTALLER_HOOKS = be.release_dir / "hooks"
|
||||
PYINSTALLER_TEMP = be.build_dir / "pyinstaller"
|
||||
PYINSTALLER_DIST = be.build_dir / "binaries" / be.platform_tag
|
||||
|
||||
|
|
@ -407,8 +406,6 @@ def build_pyinstaller(be: BuildEnviron) -> None: # pragma: no cover
|
|||
PYINSTALLER_TEMP,
|
||||
"--distpath",
|
||||
PYINSTALLER_DIST,
|
||||
"--additional-hooks-dir",
|
||||
PYINSTALLER_HOOKS,
|
||||
"--onefile",
|
||||
"--console",
|
||||
"--icon",
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ from pathlib import Path
|
|||
from PyInstaller.building.api import PYZ, EXE, COLLECT
|
||||
from PyInstaller.building.build_main import Analysis
|
||||
|
||||
assert SPECPATH == "."
|
||||
|
||||
here = Path(r".")
|
||||
tools = ["mitmproxy", "mitmdump", "mitmweb"]
|
||||
|
||||
|
|
@ -12,7 +10,6 @@ analysis = Analysis(
|
|||
tools,
|
||||
excludes=["tcl", "tk", "tkinter"],
|
||||
pathex=[str(here)],
|
||||
hookspath=[str(here / ".." / "hooks")],
|
||||
)
|
||||
|
||||
pyz = PYZ(analysis.pure, analysis.zipped_data)
|
||||
|
|
|
|||
3
setup.py
3
setup.py
|
|
@ -63,6 +63,9 @@ setup(
|
|||
"mitmproxy = mitmproxy.tools.main:mitmproxy",
|
||||
"mitmdump = mitmproxy.tools.main:mitmdump",
|
||||
"mitmweb = mitmproxy.tools.main:mitmweb",
|
||||
],
|
||||
"pyinstaller40": [
|
||||
"hook-dirs = mitmproxy.utils.pyinstaller:hook_dirs",
|
||||
]
|
||||
},
|
||||
python_requires=">=3.9",
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ def check_src_files_have_test():
|
|||
"mitmproxy/test/",
|
||||
"mitmproxy/tools/",
|
||||
"mitmproxy/platform/",
|
||||
"mitmproxy/utils/pyinstaller/",
|
||||
]
|
||||
src_files = glob.glob("mitmproxy/**/*.py", recursive=True)
|
||||
src_files = [f for f in src_files if os.path.basename(f) != "__init__.py"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue