Skip to content

Commit 94559e1

Browse files
committed
Update Makefile (Use Python 3 for local development)
1 parent c56177d commit 94559e1

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

Makefile

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Makefile for the `rotate-backups' package.
22
#
33
# Author: Peter Odding <peter@peterodding.com>
4-
# Last Change: August 2, 2018
4+
# Last Change: February 11, 2020
55
# URL: https://github.com/xolox/python-rotate-backups
66

77
PACKAGE_NAME = rotate-backups
88
WORKON_HOME ?= $(HOME)/.virtualenvs
99
VIRTUAL_ENV ?= $(WORKON_HOME)/$(PACKAGE_NAME)
10+
PYTHON ?= python3
1011
PATH := $(VIRTUAL_ENV)/bin:$(PATH)
1112
MAKE := $(MAKE) --no-print-directory
1213
SHELL = bash
@@ -29,44 +30,45 @@ default:
2930

3031
install:
3132
@test -d "$(VIRTUAL_ENV)" || mkdir -p "$(VIRTUAL_ENV)"
32-
@test -x "$(VIRTUAL_ENV)/bin/python" || virtualenv --quiet "$(VIRTUAL_ENV)"
33-
@test -x "$(VIRTUAL_ENV)/bin/pip-accel" || pip install --quiet pip-accel
34-
@pip-accel install --quiet --requirement=requirements.txt
33+
@test -x "$(VIRTUAL_ENV)/bin/python" || virtualenv --python=$(PYTHON) --quiet "$(VIRTUAL_ENV)"
34+
@pip install --quiet --requirement=requirements.txt
3535
@pip uninstall --yes $(PACKAGE_NAME) &>/dev/null || true
3636
@pip install --quiet --no-deps --ignore-installed .
3737

3838
reset:
39-
$(MAKE) clean
40-
rm -Rf "$(VIRTUAL_ENV)"
41-
$(MAKE) install
39+
@$(MAKE) clean
40+
@rm -Rf "$(VIRTUAL_ENV)"
41+
@$(MAKE) install
4242

4343
check: install
44-
@pip-accel install --upgrade --quiet --requirement=requirements-checks.txt
44+
@pip install --upgrade --quiet --requirement=requirements-checks.txt
4545
@flake8
4646

4747
test: install
48-
@pip-accel install --quiet --requirement=requirements-tests.txt
48+
@pip install --quiet --requirement=requirements-tests.txt
4949
@py.test --cov
5050
@coverage html
5151
@coverage report --fail-under=90 &>/dev/null
5252

5353
tox: install
54-
@pip-accel install --quiet tox && tox
54+
@pip install --quiet tox
55+
@tox
5556

5657
readme: install
57-
@pip-accel install --quiet cogapp && cog.py -r README.rst
58+
@pip install --quiet cogapp
59+
@cog.py -r README.rst
5860

5961
docs: readme
60-
@pip-accel install --quiet sphinx
62+
@pip install --quiet sphinx
6163
@cd docs && sphinx-build -nb html -d build/doctrees . build/html
6264

6365
publish: install
64-
git push origin && git push --tags origin
65-
$(MAKE) clean
66-
pip-accel install --quiet twine wheel
67-
python setup.py sdist bdist_wheel
68-
twine upload dist/*
69-
$(MAKE) clean
66+
@git push origin && git push --tags origin
67+
@$(MAKE) clean
68+
@pip install --quiet twine wheel
69+
@python setup.py sdist bdist_wheel
70+
@twine upload dist/*
71+
@$(MAKE) clean
7072

7173
clean:
7274
@rm -Rf *.egg .cache .coverage .tox build dist docs/build htmlcov

0 commit comments

Comments
 (0)