Skip to content

Commit fa798e4

Browse files
kaniini1st1
authored andcommitted
makefile: support the python binary being called something else
1 parent 6ebd07d commit fa798e4

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Makefile

+13-10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
.PHONY: release sdist-libuv docs
33

44

5+
PYTHON ?= python
6+
7+
58
all: compile
69

710

@@ -13,7 +16,7 @@ clean:
1316

1417

1518
check-env:
16-
python -c "import cython; (cython.__version__ < '0.24') and exit(1)"
19+
$(PYTHON) -c "import cython; (cython.__version__ < '0.24') and exit(1)"
1720

1821

1922
clean-libuv:
@@ -30,32 +33,32 @@ distclean: clean clean-libuv
3033
compile: check-env clean
3134
echo "DEF DEBUG = 0" > uvloop/__debug.pxi
3235
cython -3 uvloop/loop.pyx; rm uvloop/__debug.*
33-
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | python
34-
python setup.py build_ext --inplace
36+
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | $(PYTHON)
37+
$(PYTHON) setup.py build_ext --inplace
3538

3639

3740
debug: check-env clean
3841
echo "DEF DEBUG = 1" > uvloop/__debug.pxi
3942
cython -3 -a -p uvloop/loop.pyx; rm uvloop/__debug.*
40-
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | python
41-
python setup.py build_ext --inplace
43+
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | $(PYTHON)
44+
$(PYTHON) setup.py build_ext --inplace
4245

4346

4447
docs: compile
45-
cd docs && python -m sphinx -a -b html . _build/html
48+
cd docs && $(PYTHON) -m sphinx -a -b html . _build/html
4649

4750

4851
test:
49-
PYTHONASYNCIODEBUG=1 python -m unittest discover -s tests
50-
python -m unittest discover -s tests
52+
$(PYTHON)ASYNCIODEBUG=1 $(PYTHON) -m unittest discover -s tests
53+
$(PYTHON) -m unittest discover -s tests
5154

5255

5356
sdist: clean compile test sdist-libuv
54-
python setup.py sdist
57+
$(PYTHON) setup.py sdist
5558

5659

5760
release: clean compile test sdist-libuv
58-
python setup.py sdist bdist_wheel upload
61+
$(PYTHON) setup.py sdist bdist_wheel upload
5962

6063

6164
# Script to patch Cython 'async def' coroutines to have a 'tp_iter' slot,

0 commit comments

Comments
 (0)