diff --git a/.gitignore b/.gitignore index 82f00f1..d58e921 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ junit-py* docs/_build .cache build +.env* +.eggs diff --git a/.travis.yml b/.travis.yml index 8573637..1598964 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,10 +9,11 @@ python: # - pypy still no pypy 2.6 install: - - pip install --upgrade pip setuptools - - pip install --upgrade .[test] + - make install -script: py.test pygal/ --flake8 --cov-report= --cov=pygal +script: + - make lint + - make check after_success: coveralls diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ac3624f --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +include Makefile.config +-include Makefile.custom.config + +all: install lint check check-outdated + +install: + test -d $(VENV) || virtualenv $(VENV) -p $(PYTHON_VERSION) + $(PIP) install --upgrade --no-cache pip setuptools -e .[test] devcore + +clean: + rm -fr $(VENV) + rm -fr *.egg-info + +lint: + $(PYTEST) --flake8 -m flake8 $(PROJECT_NAME) + $(PYTEST) --isort -m isort $(PROJECT_NAME) + +check: + $(PYTEST) $(PROJECT_NAME) $(PYTEST_ARGS) --cov-report= --cov=pygal + +check-outdated: + $(PIP) list --outdated --format=columns + +release: + git pull + $(eval VERSION := $(shell PROJECT_NAME=$(PROJECT_NAME) $(VENV)/bin/devcore bump $(LEVEL))) + git commit -am "Bump $(VERSION)" + git tag $(VERSION) + $(PYTHON) setup.py sdist bdist_wheel upload + git push + git push --tags diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 0000000..90a12e4 --- /dev/null +++ b/Makefile.config @@ -0,0 +1,8 @@ +PROJECT_NAME = pygal + +# Python env +PYTHON_VERSION ?= python +VENV = $(PWD)/.env$(if $(filter $(PYTHON_VERSION),python),,-$(PYTHON_VERSION)) +PIP = $(VENV)/bin/pip +PYTHON = $(VENV)/bin/python +PYTEST = $(VENV)/bin/py.test diff --git a/setup.cfg b/setup.cfg index 40a8157..bdae69e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [wheel] universal = 1 -[pytest] +[tool:pytest] flake8-ignore = *.py E731 E402 pygal/__init__.py F401