-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
64 lines (49 loc) · 2.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
PACKAGE_NAME := lib3to6
# This is the python version that is used for:
# - `make fmt`
# - `make ipy`
# - `make lint`
# - `make devtest`
DEVELOPMENT_PYTHON_VERSION := python=3.10
# These must be valid (space separated) conda package names.
# A separate conda environment will be created for each of these.
#
# These are the interpreters we use to test that the output of lib3to6 works
# with that version. The interpreter used to run lib3to6 and produce that output
# is the DEVELOPMENT_PYTHON_VERSION.
SUPPORTED_PYTHON_VERSIONS := python=3.10 python=3.9 python=3.8 python=3.7 pypy3.7 python=2.7
include Makefile.bootstrapit.make
## -- Extra/Custom/Project Specific Tasks --
ENV_CPY36 := $(ENV_PREFIX)/lib3to6_py36/bin/python
ENV_PYPY36 := $(ENV_PREFIX)/lib3to6_pypy36/bin/pypy3
## Run transpile on test_project
.PHONY: integration_test
integration_test:
@rm -rf integration_test_dist/;
@rm -rf test_project/dist/;
@# self test with python 3.6
@$(ENV_CPY36) setup.py bdist_wheel --dist-dir=integration_test_dist --python-tag=py3;
@$(ENV_CPY36) -m pip uninstall --yes lib3to6;
@$(ENV_CPY36) -m pip install -U integration_test_dist/lib3to6*.whl;
@$(ENV_CPY36) -c "from lib3to6 import packaging"
@rm -rf integration_test_dist/;
@# self test with PyPy 3.6
@$(ENV_PYPY36) setup.py bdist_wheel --dist-dir=integration_test_dist --python-tag=py3;
@$(ENV_PYPY36) -m pip uninstall --yes lib3to6;
@$(ENV_PYPY36) -m pip install -U integration_test_dist/lib3to6*.whl;
@$(ENV_PYPY36) -c "from lib3to6 import packaging"
@rm -rf integration_test_dist/;
@# test project with python 3.9+
@$(DEV_ENV_PY) setup.py bdist_wheel --dist-dir=integration_test_dist --python-tag=py3;
@$(DEV_ENV_PY) -m pip uninstall --yes lib3to6;
@$(DEV_ENV_PY) -m pip install --force-reinstall -U integration_test_dist/lib3to6*.whl;
@$(DEV_ENV_PY) -c "from lib3to6 import packaging"
@bash -c "cd test_project && $(DEV_ENV_PY) setup.py bdist_wheel --python-tag=py2.py3" \
@IFS=' ' read -r -a env_py_paths <<< "$(CONDA_ENV_BIN_PYTHON_PATHS)"; \
for i in $${!env_py_paths[@]}; do \
env_py=$${env_py_paths[i]}; \
echo "Testing on "$$($${env_py} --version); \
$${env_py} -m pip uninstall -y test-module; \
$${env_py} -m pip install test_project/dist/test_module*.whl; \
$${env_py} -c "import test_module" | grep "all ok"; \
done;