2014-11-04 07:08:19 +00:00
|
|
|
# Makefile for handling various tasks of Pylint sources
|
2014-07-26 09:14:29 +00:00
|
|
|
PYVE=pyve
|
|
|
|
PIP=$(PYVE)/bin/pip
|
|
|
|
TOX=$(PYVE)/bin/tox
|
|
|
|
|
2018-06-19 06:31:46 +00:00
|
|
|
VERSION=$(shell PYTHONPATH=. python -c "from pylint.__pkginfo__ import version; print(version)")
|
2014-07-26 10:49:54 +00:00
|
|
|
|
|
|
|
PKG_SDIST=dist/pylint-$(VERSION).tar.gz
|
|
|
|
PKG_DEB=../pylint_$(VERSION)-1_all.deb
|
|
|
|
|
2014-07-26 09:14:29 +00:00
|
|
|
# this is default target, it should always be first in this Makefile
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
|
|
|
@echo " tests to run whole test suit of PyLint"
|
|
|
|
@echo " docs to generate all docs including man pages and exemplary pylintrc"
|
2014-07-30 03:39:53 +00:00
|
|
|
@echo " deb to build debian .deb package (it works only on Debian based Linux distros)"
|
2014-07-26 12:02:15 +00:00
|
|
|
@echo " sdist to build source .tar.gz package"
|
2014-07-26 09:14:29 +00:00
|
|
|
@echo " lint to check Pylint sources with itself"
|
|
|
|
@echo " all to run all targets"
|
|
|
|
|
|
|
|
|
|
|
|
$(PIP):
|
|
|
|
virtualenv $(PYVE)
|
|
|
|
|
|
|
|
$(TOX): $(PIP)
|
2016-12-16 13:11:20 +00:00
|
|
|
$(PIP) install tox~=2.0
|
2014-07-26 09:14:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
ifdef TOXENV
|
|
|
|
toxparams?=-e $(TOXENV)
|
|
|
|
endif
|
|
|
|
|
|
|
|
tests: $(TOX)
|
|
|
|
$(TOX) $(toxparams)
|
|
|
|
|
2014-07-26 10:04:54 +00:00
|
|
|
docs: $(PIP)
|
|
|
|
$(PIP) install .
|
2014-07-26 10:12:12 +00:00
|
|
|
$(PIP) install Sphinx
|
2018-06-05 02:22:28 +00:00
|
|
|
$(PIP) install python-docs-theme
|
2014-07-26 10:15:30 +00:00
|
|
|
. $(PYVE)/bin/activate; make all -C doc
|
2014-07-26 09:14:29 +00:00
|
|
|
|
2014-07-26 10:49:54 +00:00
|
|
|
deb: $(PKG_DEB)
|
2014-07-26 10:56:42 +00:00
|
|
|
$(PKG_DEB): /usr/bin/debuild /usr/bin/dh_pysupport
|
2014-07-26 11:51:05 +00:00
|
|
|
if [ -n "$$SUBVERSION" ]; then sed -i -e "0,/pylint (\(.*\))/s//pylint (\1.$${SUBVERSION})/" debian/changelog; fi
|
2014-07-26 09:14:29 +00:00
|
|
|
debuild -b -us -uc
|
|
|
|
|
2014-07-26 10:49:54 +00:00
|
|
|
sdist: $(PKG_SDIST)
|
|
|
|
$(PKG_SDIST):
|
|
|
|
python setup.py sdist
|
|
|
|
|
2014-07-26 09:14:29 +00:00
|
|
|
lint: $(PIP)
|
|
|
|
$(PIP) install .
|
2014-07-26 10:49:54 +00:00
|
|
|
$(PYVE)/bin/pylint lint.py || true # for now ignore errors
|
2014-07-26 09:14:29 +00:00
|
|
|
|
2014-07-30 03:39:53 +00:00
|
|
|
clean:
|
2014-07-26 09:14:29 +00:00
|
|
|
rm -rf $(PYVE)
|
|
|
|
rm -rf .tox
|
2014-07-26 10:49:54 +00:00
|
|
|
rm -rf dist
|
|
|
|
rm -rf build
|
2014-07-26 09:14:29 +00:00
|
|
|
make clean -C doc
|
2014-07-26 10:56:42 +00:00
|
|
|
rm -rf $(PKG_DEB) ../pylint_*.changes ../pylint_*.build
|
2014-07-30 03:39:53 +00:00
|
|
|
debuild clean || true
|
2014-07-26 10:49:54 +00:00
|
|
|
|
2014-07-26 12:02:15 +00:00
|
|
|
clobber:
|
|
|
|
hg purge -p
|
|
|
|
hg purge -a
|
|
|
|
|
2014-07-30 03:39:53 +00:00
|
|
|
|
2014-07-26 10:49:54 +00:00
|
|
|
/usr/bin/debuild:
|
|
|
|
sudo apt-get -y --force-yes install devscripts
|
2014-07-26 09:14:29 +00:00
|
|
|
|
2014-07-26 10:58:55 +00:00
|
|
|
/usr/bin/dh_pysupport:
|
2014-07-26 10:56:42 +00:00
|
|
|
sudo apt-get -y --force-yes install python-support
|
|
|
|
|
2014-07-26 10:49:54 +00:00
|
|
|
all: clean lint tests docs sdist deb
|
2014-07-26 09:14:29 +00:00
|
|
|
|
2014-07-26 12:02:15 +00:00
|
|
|
.PHONY: help tests docs deb sdist lint clean clobber all
|