From a48fa4ad8787b1ad45f10cba05d6e2f44913bbed Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Thu, 30 Apr 2020 16:45:53 -0300 Subject: [PATCH 1/3] Add missing aqt and anki modules dependency requirements --- pylib/Makefile | 3 ++- pylib/setup.py | 3 ++- qt/Makefile | 3 ++- qt/setup.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pylib/Makefile b/pylib/Makefile index b9e6aa633..dcd21e18c 100644 --- a/pylib/Makefile +++ b/pylib/Makefile @@ -117,6 +117,7 @@ anki/buildinfo.py: ../meta/version ../meta/buildhash VER := $(shell cat ../meta/version) .build/vernum: ../meta/version - sed -i.bak 's/.*automatically updated.*/ version="$(VER)", # automatically updated/' setup.py + sed -i.bak 's/.*automatically updated 1.*/ "ankirspy==$(VER)", # automatically updated 1/' setup.py + sed -i.bak 's/.*automatically updated 2.*/ version="$(VER)", # automatically updated 2/' setup.py rm setup.py.bak @touch $@ diff --git a/pylib/setup.py b/pylib/setup.py index 28a43113e..b93cc5f7e 100644 --- a/pylib/setup.py +++ b/pylib/setup.py @@ -7,6 +7,7 @@ install_requires = [ "requests", "decorator", "protobuf", + "ankirspy==2.1.25", # automatically updated 1 'orjson; platform_machine == "x86_64"', 'psutil; sys_platform == "win32"', 'distro; sys_platform != "darwin" and sys_platform != "win32"', @@ -15,7 +16,7 @@ install_requires = [ setuptools.setup( name="anki", - version="2.1.25", # automatically updated + version="2.1.25", # automatically updated 2 author="Ankitects Pty Ltd", description="Anki's library code", long_description="Anki's library code", diff --git a/qt/Makefile b/qt/Makefile index 2ebee6968..e11da7c3d 100644 --- a/qt/Makefile +++ b/qt/Makefile @@ -144,6 +144,7 @@ aqt/buildinfo.py: ../meta/version ../meta/buildhash VER := $(shell cat ../meta/version) .build/vernum: ../meta/version - sed -i.bak 's/.*automatically updated.*/ version="$(VER)", # automatically updated/' setup.py + sed -i.bak 's/.*automatically updated 1.*/ "anki==$(VER)", # automatically updated 1/' setup.py + sed -i.bak 's/.*automatically updated 2.*/ version="$(VER)", # automatically updated 2/' setup.py rm setup.py.bak @touch $@ diff --git a/qt/setup.py b/qt/setup.py index 38f4e2b72..650062163 100644 --- a/qt/setup.py +++ b/qt/setup.py @@ -30,12 +30,13 @@ install_requires = [ "pyqt5>=5.9", 'psutil; sys.platform == "win32"', 'pywin32; sys.platform == "win32"', + "anki==2.1.25", # automatically updated 1 ] setuptools.setup( name="aqt", - version="2.1.25", # automatically updated + version="2.1.25", # automatically updated 2 author="Ankitects Pty Ltd", description="Anki's Qt GUI code", long_description="Anki's QT GUI code", From b19b3a670643c3239c557c2b613327c5bea53d60 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Thu, 30 Apr 2020 23:07:47 -0300 Subject: [PATCH 2/3] Stop requiring ankirspy while running on development because maturin develop hides the package from pip https://github.com/PyO3/maturin/issues 304 --- pylib/Makefile | 4 ++-- pylib/setup.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pylib/Makefile b/pylib/Makefile index dcd21e18c..476147419 100644 --- a/pylib/Makefile +++ b/pylib/Makefile @@ -32,7 +32,7 @@ PHONY: all all: check .build/run-deps: setup.py - python -m pip install -e . + SKIP_ANKI_RSPY=true python -m pip install -e . @touch $@ .build/dev-deps: requirements.dev @@ -117,7 +117,7 @@ anki/buildinfo.py: ../meta/version ../meta/buildhash VER := $(shell cat ../meta/version) .build/vernum: ../meta/version - sed -i.bak 's/.*automatically updated 1.*/ "ankirspy==$(VER)", # automatically updated 1/' setup.py + sed -i.bak 's/.*automatically updated 1.*/ install_requires.append("ankirspy==$(VER)") # automatically updated 1/' setup.py sed -i.bak 's/.*automatically updated 2.*/ version="$(VER)", # automatically updated 2/' setup.py rm setup.py.bak @touch $@ diff --git a/pylib/setup.py b/pylib/setup.py index b93cc5f7e..5bd127db3 100644 --- a/pylib/setup.py +++ b/pylib/setup.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import os + import setuptools install_requires = [ @@ -7,12 +9,14 @@ install_requires = [ "requests", "decorator", "protobuf", - "ankirspy==2.1.25", # automatically updated 1 'orjson; platform_machine == "x86_64"', 'psutil; sys_platform == "win32"', 'distro; sys_platform != "darwin" and sys_platform != "win32"', ] +# maturin develop hides the package from pip - https://github.com/ankitects/anki/pull/600 +if not os.environ.get("SKIP_ANKI_RSPY", False): + install_requires.append("ankirspy==2.1.25") # automatically updated 1 setuptools.setup( name="anki", From b6e7ab6a994e0b1077aa1375cb7d9056a42b5764 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Thu, 30 Apr 2020 22:03:26 -0300 Subject: [PATCH 3/3] Removes duplicated maturin build flags on rspy/Makefile --- rspy/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rspy/Makefile b/rspy/Makefile index 7506608dc..0aa87b712 100644 --- a/rspy/Makefile +++ b/rspy/Makefile @@ -41,6 +41,10 @@ RSPY_TARGET_DIR ?= target QT_FTL_TEMPLATES := ../qt/ftl QT_FTL_LOCALES := ../qt/ftl/repo/desktop +BUILD_VARIABLES = FTL_TEMPLATE_DIRS="$(QT_FTL_TEMPLATES)" \ + FTL_LOCALE_DIRS="$(QT_FTL_LOCALES)" \ + CARGO_TARGET_DIR="$(RSPY_TARGET_DIR)" + .PHONY: all develop build check fix clean all: develop @@ -56,16 +60,16 @@ DEPS := .build/tools .build/vernum ../meta/buildhash \ .build/develop: $(DEPS) touch ../proto/backend.proto - FTL_TEMPLATE_DIRS="$(QT_FTL_TEMPLATES)" FTL_LOCALE_DIRS="$(QT_FTL_LOCALES)" \ - CARGO_TARGET_DIR="$(RSPY_TARGET_DIR)" maturin develop $(DEVFLAGS) + ${BUILD_VARIABLES} \ + maturin develop $(DEVFLAGS) touch $@ build: .build/build .build/build: $(DEPS) touch ../proto/backend.proto - FTL_TEMPLATE_DIRS="$(QT_FTL_TEMPLATES)" FTL_LOCALE_DIRS="$(QT_FTL_LOCALES)" \ - CARGO_TARGET_DIR="$(RSPY_TARGET_DIR)" maturin build -i "${PYTHON_FILE}" -o "$(OUTDIR)" $(BUILDFLAGS) + ${BUILD_VARIABLES} \ + maturin build -i "${PYTHON_FILE}" -o "$(OUTDIR)" $(BUILDFLAGS) touch $@ check: .build/check