mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 06:20:08 +01:00
fix testing on pypy
This commit is contained in:
parent
4dd7ecf640
commit
7172afdd81
5 changed files with 27 additions and 24 deletions
15
makefile
15
makefile
|
|
@ -44,6 +44,14 @@ CONDA_ENV_NAMES := \
|
||||||
CONDA_ENV_PATHS := \
|
CONDA_ENV_PATHS := \
|
||||||
$(subst pypy,$(ENV_PREFIX)/$(PKG_NAME)_pypy,$(subst python=,$(ENV_PREFIX)/$(PKG_NAME)_py,$(subst .,,$(SUPPORTED_PYTHON_VERSIONS))))
|
$(subst pypy,$(ENV_PREFIX)/$(PKG_NAME)_pypy,$(subst python=,$(ENV_PREFIX)/$(PKG_NAME)_py,$(subst .,,$(SUPPORTED_PYTHON_VERSIONS))))
|
||||||
|
|
||||||
|
CONDA_ENV_BIN_PYTHON_PATHS := \
|
||||||
|
$(shell echo "$(CONDA_ENV_PATHS)" \
|
||||||
|
| sed 's!\(_py[[:digit:]]\+\)!\1/bin/python!g' \
|
||||||
|
| sed 's!\(_pypy2[[:digit:]]\)!\1/bin/pypy!g' \
|
||||||
|
| sed 's!\(_pypy3[[:digit:]]\)!\1/bin/pypy3!g' \
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
empty :=
|
empty :=
|
||||||
literal_space := $(empty) $(empty)
|
literal_space := $(empty) $(empty)
|
||||||
|
|
@ -92,6 +100,7 @@ build/envs.txt: requirements/conda.txt
|
||||||
@SUPPORTED_PYTHON_VERSIONS="$(SUPPORTED_PYTHON_VERSIONS)" \
|
@SUPPORTED_PYTHON_VERSIONS="$(SUPPORTED_PYTHON_VERSIONS)" \
|
||||||
CONDA_ENV_NAMES="$(CONDA_ENV_NAMES)" \
|
CONDA_ENV_NAMES="$(CONDA_ENV_NAMES)" \
|
||||||
CONDA_ENV_PATHS="$(CONDA_ENV_PATHS)" \
|
CONDA_ENV_PATHS="$(CONDA_ENV_PATHS)" \
|
||||||
|
CONDA_ENV_BIN_PYTHON_PATHS="$(CONDA_ENV_BIN_PYTHON_PATHS)" \
|
||||||
CONDA_BIN="$(CONDA_BIN)" \
|
CONDA_BIN="$(CONDA_BIN)" \
|
||||||
bash scripts/setup_conda_envs.sh;
|
bash scripts/setup_conda_envs.sh;
|
||||||
|
|
||||||
|
|
@ -109,6 +118,7 @@ build/deps.txt: build/envs.txt requirements/*.txt
|
||||||
@SUPPORTED_PYTHON_VERSIONS="$(SUPPORTED_PYTHON_VERSIONS)" \
|
@SUPPORTED_PYTHON_VERSIONS="$(SUPPORTED_PYTHON_VERSIONS)" \
|
||||||
CONDA_ENV_NAMES="$(CONDA_ENV_NAMES)" \
|
CONDA_ENV_NAMES="$(CONDA_ENV_NAMES)" \
|
||||||
CONDA_ENV_PATHS="$(CONDA_ENV_PATHS)" \
|
CONDA_ENV_PATHS="$(CONDA_ENV_PATHS)" \
|
||||||
|
CONDA_ENV_BIN_PYTHON_PATHS="$(CONDA_ENV_BIN_PYTHON_PATHS)" \
|
||||||
CONDA_BIN="$(CONDA_BIN)" \
|
CONDA_BIN="$(CONDA_BIN)" \
|
||||||
bash scripts/update_conda_env_deps.sh;
|
bash scripts/update_conda_env_deps.sh;
|
||||||
|
|
||||||
|
|
@ -131,9 +141,8 @@ build/deps.txt: build/envs.txt requirements/*.txt
|
||||||
|
|
||||||
@rm -f build/deps.txt.tmp;
|
@rm -f build/deps.txt.tmp;
|
||||||
|
|
||||||
@for env_name in $(CONDA_ENV_NAMES); do \
|
@for env_py in $(CONDA_ENV_BIN_PYTHON_PATHS); do \
|
||||||
env_py="$(ENV_PREFIX)/$${env_name}/bin/python"; \
|
printf "\n# pip freeze for $${env_py}:\n" >> build/deps.txt.tmp; \
|
||||||
printf "\n# pip freeze for $${env_name}:\n" >> build/deps.txt.tmp; \
|
|
||||||
$${env_py} -m pip freeze >> build/deps.txt.tmp; \
|
$${env_py} -m pip freeze >> build/deps.txt.tmp; \
|
||||||
printf "\n\n" >> build/deps.txt.tmp; \
|
printf "\n\n" >> build/deps.txt.tmp; \
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,6 @@ compat_test/%.py: test/%.py
|
||||||
mv $@.tmp $@;
|
mv $@.tmp $@;
|
||||||
|
|
||||||
|
|
||||||
CONDA_ENV_PYS := \
|
|
||||||
$(shell echo "$(CONDA_ENV_PATHS)" \
|
|
||||||
| sed 's!\(_py[[:digit:]]\+\)!\1/bin/python!g' \
|
|
||||||
| sed 's!\(_pypy2[[:digit:]]\)!\1/bin/pypy!g' \
|
|
||||||
| sed 's!\(_pypy3[[:digit:]]\)!\1/bin/pypy3!g' \
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
## Run pytest integration tests
|
## Run pytest integration tests
|
||||||
.PHONY: test_compat
|
.PHONY: test_compat
|
||||||
test_compat: $(COMPAT_TEST_FILES)
|
test_compat: $(COMPAT_TEST_FILES)
|
||||||
|
|
@ -36,7 +28,7 @@ test_compat: $(COMPAT_TEST_FILES)
|
||||||
mkdir -p build/test_wheel;
|
mkdir -p build/test_wheel;
|
||||||
$(DEV_ENV_PY) setup.py bdist_wheel --dist-dir build/test_wheel;
|
$(DEV_ENV_PY) setup.py bdist_wheel --dist-dir build/test_wheel;
|
||||||
|
|
||||||
IFS=' ' read -r -a env_pys <<< "$(CONDA_ENV_PYS)"; \
|
IFS=' ' read -r -a env_pys <<< "$(CONDA_ENV_BIN_PYTHON_PATHS)"; \
|
||||||
for i in $${!env_pys[@]}; do \
|
for i in $${!env_pys[@]}; do \
|
||||||
env_py=$${env_pys[i]}; \
|
env_py=$${env_pys[i]}; \
|
||||||
$${env_py} -m pip install --upgrade build/test_wheel/*.whl; \
|
$${env_py} -m pip install --upgrade build/test_wheel/*.whl; \
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,5 @@
|
||||||
# speed, security, and simplicity.
|
# speed, security, and simplicity.
|
||||||
# pyblake2
|
# pyblake2
|
||||||
|
|
||||||
# pytest is required in every environment to run the test suite
|
|
||||||
# against the installed modules.
|
|
||||||
pytest
|
|
||||||
|
|
||||||
# needed for mypy coverage report
|
# needed for mypy coverage report
|
||||||
lxml
|
lxml
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
read -r -a env_paths <<< "${CONDA_ENV_PATHS//, /$IFS}";
|
|
||||||
read -r -a env_names <<< "${CONDA_ENV_NAMES//, /$IFS}";
|
read -r -a env_names <<< "${CONDA_ENV_NAMES//, /$IFS}";
|
||||||
|
read -r -a env_py_paths <<< "${CONDA_ENV_BIN_PYTHON_PATHS//, /$IFS}";
|
||||||
read -r -a py_versions <<< "${SUPPORTED_PYTHON_VERSIONS//, /$IFS}";
|
read -r -a py_versions <<< "${SUPPORTED_PYTHON_VERSIONS//, /$IFS}";
|
||||||
|
|
||||||
for i in ${!env_paths[@]}; do
|
for i in ${!env_py_paths[@]}; do
|
||||||
env_path=${env_paths[i]};
|
env_path_python=${env_py_paths[i]};
|
||||||
env_path_python=${env_path}/bin/python;
|
|
||||||
env_name=${env_names[i]};
|
env_name=${env_names[i]};
|
||||||
py_version=${py_versions[i]};
|
py_version=${py_versions[i]};
|
||||||
|
|
||||||
|
|
@ -19,6 +18,8 @@ for i in ${!env_paths[@]}; do
|
||||||
${CONDA_BIN} install --name ${env_name} --channel conda-forge --yes --quiet \
|
${CONDA_BIN} install --name ${env_name} --channel conda-forge --yes --quiet \
|
||||||
$(grep -o '^[^#][^ ]*' requirements/conda.txt)
|
$(grep -o '^[^#][^ ]*' requirements/conda.txt)
|
||||||
|
|
||||||
|
${env_path_python} -m ensurepip;
|
||||||
|
|
||||||
${env_path_python} --version >> build/envs.txt.tmp \
|
${env_path_python} --version >> build/envs.txt.tmp \
|
||||||
2>>build/envs.txt.tmp \
|
2>>build/envs.txt.tmp \
|
||||||
1>>build/envs.txt.tmp;
|
1>>build/envs.txt.tmp;
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
read -r -a env_paths <<< "${CONDA_ENV_PATHS//, /$IFS}";
|
read -r -a env_py_paths <<< "${CONDA_ENV_BIN_PYTHON_PATHS//, /$IFS}";
|
||||||
read -r -a env_names <<< "${CONDA_ENV_NAMES//, /$IFS}";
|
read -r -a env_names <<< "${CONDA_ENV_NAMES//, /$IFS}";
|
||||||
|
|
||||||
for i in ${!env_paths[@]}; do
|
for i in ${!env_py_paths[@]}; do
|
||||||
env_path=${env_paths[i]};
|
env_path_python=${env_py_paths[i]};
|
||||||
env_path_python=${env_path}/bin/python;
|
|
||||||
env_name=${env_names[i]};
|
env_name=${env_names[i]};
|
||||||
|
|
||||||
${env_path_python} -m pip install --upgrade --quiet pip;
|
${env_path_python} -m pip install --upgrade --quiet pip;
|
||||||
|
|
||||||
echo "updating ${env_name} pypi deps ...";
|
echo "updating ${env_name} pypi deps ...";
|
||||||
|
|
||||||
|
# pytest is required in every environment to run the test suite
|
||||||
|
# against the installed modules.
|
||||||
|
${env_path_python} -m pip install \
|
||||||
|
--disable-pip-version-check --upgrade --quiet \
|
||||||
|
pytest;
|
||||||
|
|
||||||
${env_path_python} -m pip install \
|
${env_path_python} -m pip install \
|
||||||
--disable-pip-version-check --upgrade --quiet \
|
--disable-pip-version-check --upgrade --quiet \
|
||||||
--requirement=requirements/pypi.txt;
|
--requirement=requirements/pypi.txt;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue