From b19b3a670643c3239c557c2b613327c5bea53d60 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Thu, 30 Apr 2020 23:07:47 -0300 Subject: [PATCH] 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",