diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..b3ab4796 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: deploy + +on: + push: + tags: + - '*' + +env: + SRC_DIR: zxlive + +jobs: + build_and_deploy: + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + python-version: [ 3.11 ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install base package + run: pip install cx_freeze + - name: Deploy + run: | + python deploy.py build + - name: Publish + run: | + ls build + echo "TODO: publish build/zxlive and the related files" \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..81de81bf --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,35 @@ +name: test + +on: + push: + +env: + SRC_DIR: zxlive + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ 3.9 ] + steps: + - uses: actions/checkout@v3 + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependecies + run: + python -m pip install ".[test]" + - name: Flake8 + continue-on-error: true + run: + pflake8 zxlive + - name: Pylint + continue-on-error: true + run: + pylint zxlive + - name: mypy + continue-on-error: true + run: + mypy zxlive diff --git a/deploy.py b/deploy.py new file mode 100644 index 00000000..8936e5bc --- /dev/null +++ b/deploy.py @@ -0,0 +1,7 @@ +import sys +from cx_Freeze import setup, Executable + +# base="Win32GUI" should be used only for Windows GUI app +base = "Win32GUI" if sys.platform == "win32" else None + +setup(executables=[Executable("zxlive/__main__.py", base=base, target_name="zxlive")]) diff --git a/pyproject.toml b/pyproject.toml index 423e9eeb..b5cc7557 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,10 @@ test = [ "PySide6-stubs", "shapely-stubs @ git+https://github.com/ciscorn/shapely-stubs.git", "mypy", + "pyproject-flake8", + "pylint", ] +deploy = ["cx_Freeze"] [project.urls] Homepage = "https://github.com/Quantomatic/zxlive" @@ -63,6 +66,11 @@ zxlive = "zxlive.app:main" [tool.pyright] reportWildcardImportFromLibrary = "none" +[tool.flake8] +extend-ignore = [ + "E501", +] + [tool.mypy] python_version = "3.9" warn_return_any = true @@ -71,3 +79,16 @@ disallow_untyped_defs = true disable_error_code = [ "import", ] + +[tool.distutils.build_exe] +excludes = [ + "IPython", + "jupyter", + "pytest", + "mypy", +] +zip_include_packages = [ + "encodings", + "zxlive", + "pyzx", +] \ No newline at end of file