From 3398bdc3785c4631c89b14ae1e6b64ec45435fe2 Mon Sep 17 00:00:00 2001 From: SignIn-SignUp <52702303+SignIn-SignUp@users.noreply.github.com> Date: Sat, 14 Aug 2021 13:04:37 +0200 Subject: [PATCH 1/2] create python-app.yml --- .github/workflows/python-app.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..e559e1c --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest From e2afca021e27ec62e21413061f156d2266e413aa Mon Sep 17 00:00:00 2001 From: chacha Date: Tue, 31 Aug 2021 01:26:41 +0200 Subject: [PATCH 2/2] added packaging of tow --- .github/workflows/python-app.yml | 30 +++++++++++++++++++++--- .gitignore | 3 +++ tow.spec | 40 ++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 tow.spec diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e559e1c..e37085c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -31,6 +31,30 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest + # - name: Test with pytest + # run: | + # pytest + + - name: Package tow Windows + uses: JackMcKew/pyinstaller-action-windows@main + with: + path: ./ + spec: tow.spec + requirements: requirements.txt + + - uses: actions/upload-artifact@v2 + with: + name: tow-windows + path: src/dist/windows + + - name: Package tow Linux + uses: JackMcKew/pyinstaller-action-linux@main + with: + path: ./ + spec: tow.spec + requirements: requirements.txt + + - uses: actions/upload-artifact@v2 + with: + name: tow-linux + path: src/dist/linux diff --git a/.gitignore b/.gitignore index c18dd8d..233eebd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ __pycache__/ + +build/ +dist/ \ No newline at end of file diff --git a/tow.spec b/tow.spec new file mode 100644 index 0000000..33ff853 --- /dev/null +++ b/tow.spec @@ -0,0 +1,40 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis(['tow.py'], + pathex=['./'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + 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='tow', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None )