diff --git a/pylib/Makefile b/pylib/Makefile index b9e6aa633..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,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.*/ 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 28a43113e..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 = [ @@ -12,10 +14,13 @@ install_requires = [ '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", - 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", 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