2014-12-18 19:49:53 +01:00
|
|
|
pypy_url=https://bitbucket.org/pypy/pypy/downloads/pypy-2.3.1-linux64.tar.bz2
|
2014-11-06 04:01:10 +01:00
|
|
|
pip_url=https://bootstrap.pypa.io/get-pip.py
|
|
|
|
python=python
|
|
|
|
pip=pip
|
|
|
|
coveralls=coveralls
|
|
|
|
nose=nosetests
|
|
|
|
pcache=$(HOME)/.pip-cache
|
|
|
|
|
|
|
|
ifeq (PyPy 2.4,$(findstring PyPy 2.4,$(shell python -V 2>&1 | tail -1)))
|
|
|
|
bad_pypy=1
|
|
|
|
python=./pypy
|
|
|
|
pip=./pip
|
|
|
|
coveralls=./coveralls
|
|
|
|
nose=./nosetests
|
|
|
|
else
|
|
|
|
bad_pypy=
|
|
|
|
endif
|
|
|
|
|
2013-03-03 05:52:56 +01:00
|
|
|
all:
|
|
|
|
@echo "No default step. Use setup.py"
|
|
|
|
@echo ""
|
|
|
|
@echo " Other targets:"
|
|
|
|
@echo ""
|
2013-03-14 00:43:19 +01:00
|
|
|
@echo " - docs"
|
|
|
|
@echo " - full"
|
|
|
|
@echo ""
|
2013-03-03 05:52:56 +01:00
|
|
|
@echo " - dev (test & flake)"
|
|
|
|
@echo " - flake"
|
|
|
|
@echo " - test"
|
2013-03-06 03:44:26 +01:00
|
|
|
@echo " - diff"
|
2013-03-07 01:19:54 +01:00
|
|
|
@echo " - tox"
|
2013-03-06 03:44:26 +01:00
|
|
|
@echo " - d"
|
|
|
|
@echo " - r"
|
2013-12-31 23:40:58 +01:00
|
|
|
@echo " - clean"
|
2013-03-03 05:52:56 +01:00
|
|
|
@echo ""
|
|
|
|
|
2013-03-14 00:43:19 +01:00
|
|
|
docs:
|
|
|
|
make -C docs html
|
|
|
|
|
2013-04-08 01:45:38 +02:00
|
|
|
upload: r
|
|
|
|
python setup.py sdist upload
|
|
|
|
|
2013-04-13 05:46:28 +02:00
|
|
|
full: d tox docs
|
2013-03-14 00:43:19 +01:00
|
|
|
|
2013-03-08 01:23:11 +01:00
|
|
|
venv:
|
|
|
|
ifeq (,$(findstring hy,$(VIRTUAL_ENV)))
|
|
|
|
@echo "You're not in a Hy virtualenv. FOR SHAME"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
@echo "We're properly in a virtualenv. Going ahead."
|
|
|
|
endif
|
2013-03-03 05:52:56 +01:00
|
|
|
|
2013-03-07 02:59:45 +01:00
|
|
|
dev: test flake
|
2013-03-03 05:52:56 +01:00
|
|
|
|
2013-03-08 01:23:11 +01:00
|
|
|
test: venv
|
2013-03-03 05:52:56 +01:00
|
|
|
nosetests -sv
|
|
|
|
|
2013-03-08 01:23:11 +01:00
|
|
|
tox: venv
|
2013-03-07 01:19:54 +01:00
|
|
|
tox
|
|
|
|
|
2013-03-03 05:52:56 +01:00
|
|
|
flake:
|
2014-03-14 14:30:03 +01:00
|
|
|
flake8 hy tests
|
2013-03-05 01:12:57 +01:00
|
|
|
|
|
|
|
clear:
|
|
|
|
clear
|
|
|
|
|
|
|
|
d: clear dev
|
2013-03-05 03:03:18 +01:00
|
|
|
|
|
|
|
diff:
|
|
|
|
git diff --color | less -r
|
|
|
|
|
2013-03-07 02:59:45 +01:00
|
|
|
r: d tox diff
|
2013-03-14 00:43:19 +01:00
|
|
|
|
2014-11-06 04:01:10 +01:00
|
|
|
python:
|
|
|
|
ifeq ($(bad_pypy),1)
|
2014-12-18 19:49:53 +01:00
|
|
|
# Due to stupid PyPy 2.4 bugs, an older PyPy 2.3 needs to be downloaded
|
|
|
|
curl -L $(pypy_url) -o pypy.tbz2
|
2014-11-06 04:01:10 +01:00
|
|
|
tar xf pypy.tbz2
|
|
|
|
ln -sf `pwd`/pypy-*/bin/pypy $(python)
|
|
|
|
curl $(pip_url) | $(python)
|
|
|
|
ln -sf `pwd`/pypy-*/bin/pip $(pip)
|
|
|
|
sudo $(pip) install nose
|
|
|
|
ln -sf `pwd`/pypy-*/bin/nosetests $(nose)
|
|
|
|
endif
|
|
|
|
ifeq (Python 2.6,$(findstring Python 2.6,$(shell python -V 2>&1)))
|
|
|
|
$(pip) install unittest2
|
|
|
|
endif
|
|
|
|
$(pip) install -r requirements-travis.txt --download-cache $(pcache)
|
|
|
|
$(pip) install coveralls --download-cache $(pcache)
|
|
|
|
$(pip) install --allow-all-external -e .
|
|
|
|
ifeq ($(bad_pypy),1)
|
|
|
|
ln -sf `pwd`/pypy-*/bin/coveralls $(coveralls)
|
|
|
|
endif
|
|
|
|
|
|
|
|
travis: python
|
|
|
|
ifeq ($(bad_pypy),1)
|
|
|
|
HY_DIR=`pwd`/pypy-*/bin $(nose) -s --with-coverage --cover-package hy
|
|
|
|
else
|
|
|
|
$(nose) -s --with-coverage --cover-package hy
|
|
|
|
endif
|
2013-08-24 17:03:11 +02:00
|
|
|
ifeq (PyPy,$(findstring PyPy,$(shell python -V 2>&1 | tail -1)))
|
|
|
|
@echo "skipping flake8 on pypy"
|
|
|
|
else
|
|
|
|
flake8 hy bin tests
|
|
|
|
endif
|
2013-03-14 00:43:19 +01:00
|
|
|
|
2014-11-06 04:01:10 +01:00
|
|
|
coveralls:
|
|
|
|
$(coveralls)
|
|
|
|
|
2013-12-31 23:40:58 +01:00
|
|
|
clean:
|
|
|
|
@find . -name "*.pyc" -exec rm {} \;
|
|
|
|
@find -name __pycache__ -delete
|
|
|
|
@${RM} -r -f .tox
|
|
|
|
@${RM} -r -f dist
|
|
|
|
@${RM} -r -f *.egg-info
|
|
|
|
@${RM} -r -f docs/_build
|
|
|
|
|
2013-04-13 05:46:28 +02:00
|
|
|
.PHONY: docs
|