mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Make tox work with non-venv interpreters
Previously, as soon as an interpreter that wasn't the one having been used for `env` was used by tox, we would get errors because our C modules wouldn't be built for this interpreter. The makefile has been changed to make `make modules` interpreter-aware, thus fixing this problem.
This commit is contained in:
parent
8cd0ef4c2b
commit
a6b1e6e9ab
33
Makefile
33
Makefile
@ -1,4 +1,5 @@
|
|||||||
PYTHON ?= python3
|
PYTHON ?= python3
|
||||||
|
PYTHON_VERSION_MINOR := $(shell ${PYTHON} -c "import sys; print(sys.version_info.minor)")
|
||||||
PYRCC5 ?= pyrcc5
|
PYRCC5 ?= pyrcc5
|
||||||
REQ_MINOR_VERSION = 4
|
REQ_MINOR_VERSION = 4
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
@ -10,11 +11,11 @@ PREFIX ?= /usr/local
|
|||||||
|
|
||||||
ifeq ($(shell uname -o), Msys)
|
ifeq ($(shell uname -o), Msys)
|
||||||
BIN = Scripts
|
BIN = Scripts
|
||||||
SO = pyd
|
SO = *.pyd
|
||||||
VENV_OPTIONS =
|
VENV_OPTIONS =
|
||||||
else
|
else
|
||||||
BIN = bin
|
BIN = bin
|
||||||
SO = so
|
SO = cpython-3$(PYTHON_VERSION_MINOR)m*.so
|
||||||
VENV_OPTIONS = --system-site-packages
|
VENV_OPTIONS = --system-site-packages
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -53,11 +54,9 @@ pyc:
|
|||||||
${PYTHON} -m compileall ${packages}
|
${PYTHON} -m compileall ${packages}
|
||||||
|
|
||||||
reqs :
|
reqs :
|
||||||
@ret=`${PYTHON} -c "import sys; print(int(sys.version_info[:2] >= (3, ${REQ_MINOR_VERSION})))"`; \
|
ifneq ($(shell test $(PYTHON_VERSION_MINOR) -gt $(REQ_MINOR_VERSION); echo $$?),0)
|
||||||
if [ $${ret} -ne 1 ]; then \
|
$(error "Python 3.${REQ_MINOR_VERSION}+ required. Aborting.")
|
||||||
echo "Python 3.${REQ_MINOR_VERSION}+ required. Aborting."; \
|
endif
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
ifndef NO_VENV
|
ifndef NO_VENV
|
||||||
@${PYTHON} -m venv -h > /dev/null || \
|
@${PYTHON} -m venv -h > /dev/null || \
|
||||||
echo "Creation of our virtualenv failed. If you're on Ubuntu, you probably need python3-venv."
|
echo "Creation of our virtualenv failed. If you're on Ubuntu, you probably need python3-venv."
|
||||||
@ -91,19 +90,19 @@ i18n: $(mofiles)
|
|||||||
%.mo : %.po
|
%.mo : %.po
|
||||||
msgfmt -o $@ $<
|
msgfmt -o $@ $<
|
||||||
|
|
||||||
core/pe/_block.*.$(SO) : core/pe/modules/block.c core/pe/modules/common.c | env
|
core/pe/_block.$(SO) : core/pe/modules/block.c core/pe/modules/common.c
|
||||||
$(VENV_PYTHON) hscommon/build_ext.py $^ _block
|
$(PYTHON) hscommon/build_ext.py $^ _block
|
||||||
mv _block.*.$(SO) core/pe
|
mv _block.$(SO) core/pe
|
||||||
|
|
||||||
core/pe/_cache.*.$(SO) : core/pe/modules/cache.c core/pe/modules/common.c | env
|
core/pe/_cache.$(SO) : core/pe/modules/cache.c core/pe/modules/common.c
|
||||||
$(VENV_PYTHON) hscommon/build_ext.py $^ _cache
|
$(PYTHON) hscommon/build_ext.py $^ _cache
|
||||||
mv _cache.*.$(SO) core/pe
|
mv _cache.$(SO) core/pe
|
||||||
|
|
||||||
qt/pe/_block_qt.*.$(SO) : qt/pe/modules/block.c | env
|
qt/pe/_block_qt.$(SO) : qt/pe/modules/block.c
|
||||||
$(VENV_PYTHON) hscommon/build_ext.py $^ _block_qt
|
$(PYTHON) hscommon/build_ext.py $^ _block_qt
|
||||||
mv _block_qt.*.$(SO) qt/pe
|
mv _block_qt.$(SO) qt/pe
|
||||||
|
|
||||||
modules : core/pe/_block.*.$(SO) core/pe/_cache.*.$(SO) qt/pe/_block_qt.*.$(SO)
|
modules : core/pe/_block.$(SO) core/pe/_cache.$(SO) qt/pe/_block_qt.$(SO)
|
||||||
|
|
||||||
mergepot :
|
mergepot :
|
||||||
$(VENV_PYTHON) build.py --mergepot
|
$(VENV_PYTHON) build.py --mergepot
|
||||||
|
5
tox.ini
5
tox.ini
@ -4,7 +4,12 @@ skipsdist = True
|
|||||||
skip_missing_interpreters = True
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
whitelist_externals =
|
||||||
|
make
|
||||||
|
setenv =
|
||||||
|
PYTHON="{envpython}"
|
||||||
commands =
|
commands =
|
||||||
|
make modules
|
||||||
flake8
|
flake8
|
||||||
py.test core hscommon
|
py.test core hscommon
|
||||||
deps =
|
deps =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user