diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b8f28f0c5..d30dff9ae 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -103,17 +103,15 @@ jobs: ${{ hashFiles('**/setup.py') }}- ${{ hashFiles('**/Makefile') }}-14- - # Disabling these caches for now because they do not seem to be used/help - # https://github.com/ankitects/anki/pull/528 - # - name: Cache pip wheels - # if: matrix.BUILD_TYPE == 'build' - # uses: actions/cache@v1 - # with: - # path: ${{ matrix.PIP_WHEELS_DIR }} - # key: | - # ${{ runner.os }}-pip-wheels- - # ${{ hashFiles('**/requirements.txt') }}- - # ${{ hashFiles('**/setup.py') }}-14- + - name: Cache pip wheels + if: matrix.BUILD_TYPE == 'build' + uses: actions/cache@v1 + with: + path: ${{ matrix.PIP_WHEELS_DIR }} + key: | + ${{ runner.os }}-pip-wheels- + ${{ hashFiles('**/requirements.txt') }}- + ${{ hashFiles('**/setup.py') }}-14- - name: Cache cargo index uses: actions/cache@v1 @@ -237,6 +235,7 @@ jobs: - name: Set up Ubuntu ripgrep, pyaudio, gettext, rename if: matrix.os == 'ubuntu-latest' run: | + set -x sudo apt update sudo apt install portaudio19-dev gettext rename sudo snap install ripgrep --classic @@ -244,6 +243,7 @@ jobs: - name: Set up brew ripgrep, pyaudio, gettext, rename if: matrix.os == 'macos-latest' run: | + set -x brew install portaudio protobuf gettext rename ripgrep make brew link gettext --force @@ -263,16 +263,36 @@ jobs: node-version: 12 - run: make develop - if: matrix.BUILD_TYPE != 'check' + if: matrix.BUILD_TYPE == 'build' - run: make build - if: matrix.BUILD_TYPE != 'check' + if: matrix.BUILD_TYPE == 'build' + + - name: Check Windows wheels + if: matrix.BUILD_TYPE == 'build' && matrix.os == 'windows-latest' + shell: cmd + run: | + echo on + copy %pyaudio% dist + cd dist + setlocal EnableDelayedExpansion + cmd /C set "wheels=" && for /f "delims=" %%i in ('dir /b *.*') DO set "wheels="%%i" !wheels!" + python -m pip install pyqtwebengine %wheels% + python -c "import aqt; # aqt.run()" + + - name: Check Linux/Mac OS wheels + if: matrix.BUILD_TYPE == 'build' && ( matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' ) + run: | + set -x + cd dist + python -m pip install pyqtwebengine *.* + python -c "import aqt; # aqt.run()" - run: make check if: matrix.BUILD_TYPE == 'check' - name: Upload python wheels - if: matrix.BUILD_TYPE != 'check' + if: matrix.BUILD_TYPE == 'build' uses: actions/upload-artifact@v1 with: name: ${{ matrix.ANKI_PYTHON_WHEELS }} diff --git a/Makefile b/Makefile index c6fddd168..3ebd8156a 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,7 @@ add-buildhash: fi; \ ver="$$(cat meta/version)"; \ hash="$$(cat meta/buildhash)"; \ - ${RENAME_BIN} "s/-$${ver}-/-$${ver}+$${hash}-/" dist/*-"$${ver}"-* + ${RENAME_BIN} "s/-$${ver}(\.|-)/-$${ver}+$${hash}\$$1/" dist/*-"$${ver}"* .PHONY: pull-i18n diff --git a/qt/Makefile b/qt/Makefile index 4fef3e92b..6c1de33df 100644 --- a/qt/Makefile +++ b/qt/Makefile @@ -64,7 +64,7 @@ TSDEPS := $(wildcard ts/src/*.ts) $(wildcard ts/scss/*.scss) python -m black aqt/gui_hooks.py @touch $@ -BUILD_STEPS := .build/run-deps .build/dev-deps .build/js .build/ui aqt/buildinfo.py .build/hooks .build/i18n +BUILD_STEPS := .build/vernum .build/run-deps .build/dev-deps .build/js .build/ui aqt/buildinfo.py .build/hooks .build/i18n # Checking ###################### @@ -138,3 +138,9 @@ develop: $(BUILD_STEPS) aqt/buildinfo.py: ../meta/version ../meta/buildhash echo "buildhash='$$(cat ../meta/buildhash)'" > $@ echo "version='$$(cat ../meta/version)'" >> $@ + +VER := $(shell cat ../meta/version) +.build/vernum: ../meta/version + sed -i.bak 's/.*automatically updated.*/ version="$(VER)", # automatically updated/' setup.py + rm setup.py.bak + @touch $@ diff --git a/qt/pyproject.toml b/qt/pyproject.toml new file mode 100644 index 000000000..754ed04e1 --- /dev/null +++ b/qt/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +# Minimum requirements for the build system to execute. +# https://stackoverflow.com/questions/48048745/setup-py-require-a-recent-version-of-setuptools-before-trying-to-install +requires = ["setuptools", "wheel"] diff --git a/qt/setup.py b/qt/setup.py index b941c01e2..98d207714 100644 --- a/qt/setup.py +++ b/qt/setup.py @@ -4,9 +4,6 @@ import os import setuptools -with open("../meta/version") as fh: - version = fh.read().strip() - def package_files(directory): entries = [] @@ -23,9 +20,23 @@ if pyonly: else: extra_files = package_files("aqt_data") +install_requires = [ + "beautifulsoup4", + "requests", + "send2trash", + "pyaudio", + "markdown", + "jsonschema", + "pyqt5>=5.9", + 'psutil; sys.platform == "win32"', + 'pywin32; sys.platform == "win32"', + 'darkdetect; sys.platform == "darwin"', +] + + setuptools.setup( name="aqt", - version=version, + version="2.1.24", # automatically updated author="Ankitects Pty Ltd", description="Anki's Qt GUI code", long_description="Anki's QT GUI code", @@ -37,15 +48,5 @@ setuptools.setup( classifiers=[], python_requires=">=3.7", package_data={"aqt": ["py.typed"]}, - install_requires=[ - "beautifulsoup4", - "requests", - "send2trash", - "pyaudio", - "markdown", - "jsonschema", - 'psutil; sys.platform == "win32"', - 'pywin32; sys.platform == "win32"', - 'darkdetect; sys.platform == "darwin"', - ], + install_requires=install_requires, )