Merge pull request #530 from evandroforks/check_python_wheels
Set to checks.yml install and import anki wheels
This commit is contained in:
commit
122378c88c
48
.github/workflows/checks.yml
vendored
48
.github/workflows/checks.yml
vendored
@ -103,17 +103,15 @@ jobs:
|
|||||||
${{ hashFiles('**/setup.py') }}-
|
${{ hashFiles('**/setup.py') }}-
|
||||||
${{ hashFiles('**/Makefile') }}-14-
|
${{ hashFiles('**/Makefile') }}-14-
|
||||||
|
|
||||||
# Disabling these caches for now because they do not seem to be used/help
|
- name: Cache pip wheels
|
||||||
# https://github.com/ankitects/anki/pull/528
|
if: matrix.BUILD_TYPE == 'build'
|
||||||
# - name: Cache pip wheels
|
uses: actions/cache@v1
|
||||||
# if: matrix.BUILD_TYPE == 'build'
|
with:
|
||||||
# uses: actions/cache@v1
|
path: ${{ matrix.PIP_WHEELS_DIR }}
|
||||||
# with:
|
key: |
|
||||||
# path: ${{ matrix.PIP_WHEELS_DIR }}
|
${{ runner.os }}-pip-wheels-
|
||||||
# key: |
|
${{ hashFiles('**/requirements.txt') }}-
|
||||||
# ${{ runner.os }}-pip-wheels-
|
${{ hashFiles('**/setup.py') }}-14-
|
||||||
# ${{ hashFiles('**/requirements.txt') }}-
|
|
||||||
# ${{ hashFiles('**/setup.py') }}-14-
|
|
||||||
|
|
||||||
- name: Cache cargo index
|
- name: Cache cargo index
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
@ -237,6 +235,7 @@ jobs:
|
|||||||
- name: Set up Ubuntu ripgrep, pyaudio, gettext, rename
|
- name: Set up Ubuntu ripgrep, pyaudio, gettext, rename
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install portaudio19-dev gettext rename
|
sudo apt install portaudio19-dev gettext rename
|
||||||
sudo snap install ripgrep --classic
|
sudo snap install ripgrep --classic
|
||||||
@ -244,6 +243,7 @@ jobs:
|
|||||||
- name: Set up brew ripgrep, pyaudio, gettext, rename
|
- name: Set up brew ripgrep, pyaudio, gettext, rename
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
brew install portaudio protobuf gettext rename ripgrep make
|
brew install portaudio protobuf gettext rename ripgrep make
|
||||||
brew link gettext --force
|
brew link gettext --force
|
||||||
|
|
||||||
@ -263,16 +263,36 @@ jobs:
|
|||||||
node-version: 12
|
node-version: 12
|
||||||
|
|
||||||
- run: make develop
|
- run: make develop
|
||||||
if: matrix.BUILD_TYPE != 'check'
|
if: matrix.BUILD_TYPE == 'build'
|
||||||
|
|
||||||
- run: make 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
|
- run: make check
|
||||||
if: matrix.BUILD_TYPE == 'check'
|
if: matrix.BUILD_TYPE == 'check'
|
||||||
|
|
||||||
- name: Upload python wheels
|
- name: Upload python wheels
|
||||||
if: matrix.BUILD_TYPE != 'check'
|
if: matrix.BUILD_TYPE == 'build'
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.ANKI_PYTHON_WHEELS }}
|
name: ${{ matrix.ANKI_PYTHON_WHEELS }}
|
||||||
|
2
Makefile
2
Makefile
@ -181,7 +181,7 @@ add-buildhash:
|
|||||||
fi; \
|
fi; \
|
||||||
ver="$$(cat meta/version)"; \
|
ver="$$(cat meta/version)"; \
|
||||||
hash="$$(cat meta/buildhash)"; \
|
hash="$$(cat meta/buildhash)"; \
|
||||||
${RENAME_BIN} "s/-$${ver}-/-$${ver}+$${hash}-/" dist/*-"$${ver}"-*
|
${RENAME_BIN} "s/-$${ver}(\.|-)/-$${ver}+$${hash}\$$1/" dist/*-"$${ver}"*
|
||||||
|
|
||||||
|
|
||||||
.PHONY: pull-i18n
|
.PHONY: pull-i18n
|
||||||
|
@ -64,7 +64,7 @@ TSDEPS := $(wildcard ts/src/*.ts) $(wildcard ts/scss/*.scss)
|
|||||||
python -m black aqt/gui_hooks.py
|
python -m black aqt/gui_hooks.py
|
||||||
@touch $@
|
@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
|
# Checking
|
||||||
######################
|
######################
|
||||||
@ -138,3 +138,9 @@ develop: $(BUILD_STEPS)
|
|||||||
aqt/buildinfo.py: ../meta/version ../meta/buildhash
|
aqt/buildinfo.py: ../meta/version ../meta/buildhash
|
||||||
echo "buildhash='$$(cat ../meta/buildhash)'" > $@
|
echo "buildhash='$$(cat ../meta/buildhash)'" > $@
|
||||||
echo "version='$$(cat ../meta/version)'" >> $@
|
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
4
qt/pyproject.toml
Normal 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"]
|
31
qt/setup.py
31
qt/setup.py
@ -4,9 +4,6 @@ import os
|
|||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
with open("../meta/version") as fh:
|
|
||||||
version = fh.read().strip()
|
|
||||||
|
|
||||||
|
|
||||||
def package_files(directory):
|
def package_files(directory):
|
||||||
entries = []
|
entries = []
|
||||||
@ -23,9 +20,23 @@ if pyonly:
|
|||||||
else:
|
else:
|
||||||
extra_files = package_files("aqt_data")
|
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(
|
setuptools.setup(
|
||||||
name="aqt",
|
name="aqt",
|
||||||
version=version,
|
version="2.1.24", # automatically updated
|
||||||
author="Ankitects Pty Ltd",
|
author="Ankitects Pty Ltd",
|
||||||
description="Anki's Qt GUI code",
|
description="Anki's Qt GUI code",
|
||||||
long_description="Anki's QT GUI code",
|
long_description="Anki's QT GUI code",
|
||||||
@ -37,15 +48,5 @@ setuptools.setup(
|
|||||||
classifiers=[],
|
classifiers=[],
|
||||||
python_requires=">=3.7",
|
python_requires=">=3.7",
|
||||||
package_data={"aqt": ["py.typed"]},
|
package_data={"aqt": ["py.typed"]},
|
||||||
install_requires=[
|
install_requires=install_requires,
|
||||||
"beautifulsoup4",
|
|
||||||
"requests",
|
|
||||||
"send2trash",
|
|
||||||
"pyaudio",
|
|
||||||
"markdown",
|
|
||||||
"jsonschema",
|
|
||||||
'psutil; sys.platform == "win32"',
|
|
||||||
'pywin32; sys.platform == "win32"',
|
|
||||||
'darkdetect; sys.platform == "darwin"',
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user