diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edb9cdbf..62ccdd0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,13 +108,22 @@ jobs: poetry-version: ${{ env.POETRY_VERSION }} python-version: ${{ env.PYTHON_VERSION }} without: test - - name: Run PyInstaller + - name: Run PyInstaller (linux/macos) + if: matrix.tag == 'linux' || matrix.tag == 'macos' run: | poetry run pyinstaller scanner.spec cp ./config.sample.ini ./dist/config.ini cp ./README.md ./dist/README.md cp ./LICENSE ./dist/LICENSE ./dist/scanner -v + - name: Run PyInstaller (win) + if: matrix.tag == 'win' + run: | + poetry run pyinstaller scanner_win.spec + cp ./config.sample.ini ./dist/scanner/config.ini + cp ./README.md ./dist/scanner/README.md + cp ./LICENSE ./dist/scanner/LICENSE + ./dist/scanner/scanner -v - name: Make filename for archive id: filename shell: bash @@ -124,7 +133,7 @@ jobs: run: zip -j ./${{ steps.filename.outputs.FILENAME }} ./dist/* - name: Zip files (win) if: matrix.tag == 'win' - run: Compress-Archive ./dist/* ./${{ steps.filename.outputs.FILENAME }} + run: Compress-Archive ./dist/scanner/* ./${{ steps.filename.outputs.FILENAME }} - name: Upload archive uses: actions/upload-artifact@v4 with: diff --git a/Makefile b/Makefile index 7ae0abd8..a1c4ef4f 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,8 @@ tox: executable: rm -rf ./build ./dist poetry run pyinstaller ./scanner.spec - cp ./config.sample.ini ./dist/config.ini - zip -j ./dist/scanner.zip ./dist/* + cp ./config.sample.ini ./dist/scanner/config.ini + cd ./dist/scanner; zip -r ../scanner.zip * images: docker build -f ./docker/Dockerfile -t tgtg-scanner:latest . diff --git a/poetry.lock b/poetry.lock index 9a6a3859..0ad62932 100644 --- a/poetry.lock +++ b/poetry.lock @@ -145,13 +145,13 @@ trio = ["trio (>=0.23)"] [[package]] name = "apprise" -version = "1.7.6" +version = "1.8.0" description = "Push Notifications that work with just about every platform!" optional = false python-versions = ">=3.6" files = [ - {file = "apprise-1.7.6-py3-none-any.whl", hash = "sha256:a98d815dbf950c92b5d8e7c2a4ec30e86257cece26a38ae62ec8fd8f7c551cb0"}, - {file = "apprise-1.7.6.tar.gz", hash = "sha256:077f09309cc8a6c9063dbd614b343807d527d546693b7fe8fc5a4433502fea6c"}, + {file = "apprise-1.8.0-py3-none-any.whl", hash = "sha256:29307f9b7eeb5db70de13bd19f7f98700ad75369d14d1dcc49a6fcc06ed8a546"}, + {file = "apprise-1.8.0.tar.gz", hash = "sha256:e8f58cebfea1a34f569cb4c68809a3175be80ec06f0a2ec473522b92023212c5"}, ] [package.dependencies] @@ -931,13 +931,13 @@ files = [ [[package]] name = "platformdirs" -version = "4.2.1" +version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.1-py3-none-any.whl", hash = "sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1"}, - {file = "platformdirs-4.2.1.tar.gz", hash = "sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf"}, + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, ] [package.extras] @@ -962,13 +962,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.7.0" +version = "3.7.1" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.9" files = [ - {file = "pre_commit-3.7.0-py2.py3-none-any.whl", hash = "sha256:5eae9e10c2b5ac51577c3452ec0a490455c45a0533f7960f993a0d01e59decab"}, - {file = "pre_commit-3.7.0.tar.gz", hash = "sha256:e209d61b8acdcf742404408531f0c37d49d2c734fd7cff2d6076083d191cb060"}, + {file = "pre_commit-3.7.1-py2.py3-none-any.whl", hash = "sha256:fae36fd1d7ad7d6a5a1c0b0d5adb2ed1a3bda5a21bf6c3e5372073d7a11cd4c5"}, + {file = "pre_commit-3.7.1.tar.gz", hash = "sha256:8ca3ad567bc78a4972a3f1a477e94a79d4597e8140a6e0b651c5e33899c3654a"}, ] [package.dependencies] @@ -1049,13 +1049,13 @@ hook-testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"] [[package]] name = "pyinstaller-hooks-contrib" -version = "2024.5" +version = "2024.6" description = "Community maintained hooks for PyInstaller" optional = false python-versions = ">=3.7" files = [ - {file = "pyinstaller_hooks_contrib-2024.5-py2.py3-none-any.whl", hash = "sha256:0852249b7fb1e9394f8f22af2c22fa5294c2c0366157969f98c96df62410c4c6"}, - {file = "pyinstaller_hooks_contrib-2024.5.tar.gz", hash = "sha256:aa5dee25ea7ca317ad46fa16b5afc8dba3b0e43f2847e498930138885efd3cab"}, + {file = "pyinstaller_hooks_contrib-2024.6-py2.py3-none-any.whl", hash = "sha256:6cc88dad75261d9e1a7e0c6385139f35dcdbb16640c911a27f6078fe924a38cf"}, + {file = "pyinstaller_hooks_contrib-2024.6.tar.gz", hash = "sha256:3c188b3a79f5cd46d96520df3934642556a1b6ce8988ec5bbce820ada424bc2b"}, ] [package.dependencies] @@ -1357,13 +1357,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.26.1" +version = "20.26.2" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.26.1-py3-none-any.whl", hash = "sha256:7aa9982a728ae5892558bff6a2839c00b9ed145523ece2274fad6f414690ae75"}, - {file = "virtualenv-20.26.1.tar.gz", hash = "sha256:604bfdceaeece392802e6ae48e69cec49168b9c5f4a44e483963f9242eb0e78b"}, + {file = "virtualenv-20.26.2-py3-none-any.whl", hash = "sha256:a624db5e94f01ad993d476b9ee5346fdf7b9de43ccaee0e0197012dc838a0e9b"}, + {file = "virtualenv-20.26.2.tar.gz", hash = "sha256:82bf0f4eebbb78d36ddaee0283d43fe5736b53880b8a8cdcd37390a07ac3741c"}, ] [package.dependencies] @@ -1480,18 +1480,18 @@ multidict = ">=4.0" [[package]] name = "zipp" -version = "3.18.1" +version = "3.18.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.18.1-py3-none-any.whl", hash = "sha256:206f5a15f2af3dbaee80769fb7dc6f249695e940acca08dfb2a4769fe61e538b"}, - {file = "zipp-3.18.1.tar.gz", hash = "sha256:2884ed22e7d8961de1c9a05142eb69a247f120291bc0206a00a7642f09b5b715"}, + {file = "zipp-3.18.2-py3-none-any.whl", hash = "sha256:dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e"}, + {file = "zipp-3.18.2.tar.gz", hash = "sha256:6278d9ddbcfb1f1089a88fde84481528b07b0e10474e09dcfe53dad4069fa059"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [metadata] lock-version = "2.0" diff --git a/requirements.txt b/requirements.txt index f5bbf146..13b40d2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ aiohttp==3.9.5 ; python_version >= "3.9" and python_version < "3.13" aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "3.13" anyio==4.3.0 ; python_version >= "3.9" and python_version < "3.13" -apprise==1.7.6 ; python_version >= "3.9" and python_version < "3.13" +apprise==1.8.0 ; python_version >= "3.9" and python_version < "3.13" async-timeout==4.0.3 ; python_version >= "3.9" and python_version < "3.11" attrs==23.2.0 ; python_version >= "3.9" and python_version < "3.13" cachetools==5.3.3 ; python_version >= "3.9" and python_version < "3.13" @@ -38,4 +38,4 @@ sniffio==1.3.1 ; python_version >= "3.9" and python_version < "3.13" typing-extensions==4.11.0 ; python_version >= "3.9" and python_version < "3.11" urllib3==2.2.1 ; python_version >= "3.9" and python_version < "3.13" yarl==1.9.4 ; python_version >= "3.9" and python_version < "3.13" -zipp==3.18.1 ; python_version >= "3.9" and python_version < "3.10" +zipp==3.18.2 ; python_version >= "3.9" and python_version < "3.10" diff --git a/scanner_win.spec b/scanner_win.spec new file mode 100644 index 00000000..07f4da73 --- /dev/null +++ b/scanner_win.spec @@ -0,0 +1,58 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import collect_all, copy_metadata + +datas = [] +binaries = [] +hiddenimports = [] +tmp_ret = collect_all('apprise') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] +tmp_ret = collect_all('humanize') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] +tmp_ret = collect_all('cron_descriptor') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] +datas += copy_metadata('tgtg_scanner') + +a = Analysis( + ['tgtg_scanner/__main__.py'], + pathex=[], + binaries=binaries, + datas=datas, + hiddenimports=hiddenimports, + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='scanner', + debug=False, + bootloader_ignore_signals=True, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon='icon.ico', +) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='scanner', +)