Merge pull request #530 from evandroforks/check_python_wheels

Set to checks.yml install and import anki wheels
This commit is contained in:
Damien Elmes 2020-04-03 19:33:53 +10:00 committed by GitHub
commit 122378c88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 31 deletions

View File

@ -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 }}

View File

@ -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

View File

@ -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 $@

4
qt/pyproject.toml Normal file
View File

@ -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"]

View File

@ -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,
)