From 28e844dd1ba1f7c7052bc872b632a5c5d943b295 Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Sun, 17 May 2020 16:18:29 +0100 Subject: added deps and instructions for building with pyinstaller on windows 10 --- BUILDING.md | 10 ++++++++++ dm.spec | 33 +++++++++++++++++++++++++++++++++ pyproject.toml | 2 ++ 3 files changed, 45 insertions(+) create mode 100644 dm.spec diff --git a/BUILDING.md b/BUILDING.md index 83ffcd0..7d6d2d5 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -2,6 +2,7 @@ * `git pull` * Activate virtualenv (on Windows `.venv\Scripts\activate.bat`) + * (MAKE SURE YOU HAVE A PYTHON 3.7 virtualenv to hand!) * Remove `bcompiler-engine` and `datamaps` (`pip uninstall bcompiler-engine datamaps`) * `pip install -e .` to reinstall in developer mode @@ -9,3 +10,12 @@ directory. * Upload to target download site +### Building on Windows 10 (using PowerShell) + +* Activate a Python 3.7 virtualenv + * If needed, do so with: + * `C:\Users\lemon\AppData\Local\Programs\Python\Python37\python.exe -m venv /tmp/datamaps-build` + * `C:\tmp\datamaps-build\Scripts\Activate.ps1` + * Ensure `pefile` and `pywin32-ctypes` are installed + * `pyinstaller cli.py --name "dm" --onefile` + * `dm.exe` is built inside `dist/` \ No newline at end of file diff --git a/dm.spec b/dm.spec new file mode 100644 index 0000000..894b93b --- /dev/null +++ b/dm.spec @@ -0,0 +1,33 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['cli.py'], + pathex=['C:\\Users\\lemon\\code\\python\\datamaps'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='dm', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True ) diff --git a/pyproject.toml b/pyproject.toml index 17cefc2..df183fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,8 @@ coverage = "^5.1" nox = "^2019.11.9" pyinstaller = "^3.6" wheel = "^0.34.2" +pefile = "^2019.4.18" +pywin32-ctypes = "^0.2.0" [tools.black] max-length-length=88 -- cgit v1.2.3