-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
101 lines (84 loc) · 2.87 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Makefile for the 'codepost' package.
#
# Author: codePost Team <[email protected]>
# Last Change: March 28, 2019
# URL:
#
# Note: This Makefile was designed by originally designed for the
# 'humanfriendly' package by Peter Odding <[email protected]>
# under MIT license.
#
# https://raw.githubusercontent.com/xolox/python-humanfriendly/0e0c80cc7b5d6c29deae3ad589928102e421cb2f/Makefile
PACKAGE_NAME = codepost
WORKON_HOME ?= $(HOME)/.virtualenvs
VIRTUAL_ENV ?= $(WORKON_HOME)/$(PACKAGE_NAME)
PATH := $(VIRTUAL_ENV)/bin:$(PATH)
MAKE := $(MAKE) --no-print-directory
SHELL = bash
ci:
pipenv run pytest --cov=codepost
init:
#pip install --upgrade pip~=22.1.9 pipenv==2018.10.13
pipenv install --dev --skip-lock
pipenv run pip install -U pip
coveralls:
pipenv run coveralls
test:
pipenv run tox -p auto
default:
@echo "Makefile for $(PACKAGE_NAME)"
@echo
@echo 'Usage:'
@echo
@echo ' make install install the package in a virtual environment'
@echo ' make reset recreate the virtual environment'
@echo ' make check check coding style (PEP-8, PEP-257)'
# @echo ' make test run the test suite, report coverage'
# @echo ' make tox run the tests on all Python versions'
# @echo ' make readme update usage in readme'
# @echo ' make docs update documentation using Sphinx'
@echo ' make publish publish changes to GitHub/PyPI'
@echo ' make clean cleanup all temporary files'
@echo
install:
@test -d "$(VIRTUAL_ENV)" || mkdir -p "$(VIRTUAL_ENV)"
@test -x "$(VIRTUAL_ENV)/bin/python" || virtualenv --quiet "$(VIRTUAL_ENV)"
@test -x "$(VIRTUAL_ENV)/bin/pip" || easy_install pip
@pip uninstall --yes $(PACKAGE_NAME) &>/dev/null || true
@pip install --quiet --no-deps --ignore-installed .
reset:
$(MAKE) clean
rm -Rf "$(VIRTUAL_ENV)"
$(MAKE) install
check: install
@pip install --quiet "flake8>=2.6.0" "flake8-docstrings>=0.2.8" "pyflakes>=1.2.3"
@flake8
# test: install
# @pip install --quiet --constraint=constraints.txt --requirement=requirements-tests.txt
# @py.test --cov
# @coverage combine || true
# @coverage html
# tox: install
# @pip install --quiet tox
# @tox
# readme: install
# @pip install --quiet cogapp
# @cog.py -r README.rst
# docs: readme
# @pip install --quiet sphinx
# @cd docs && sphinx-build -nb html -d build/doctrees . build/html
publish: install
pipenv run python -m pip install --upgrade pip
git push origin && git push --tags origin
$(MAKE) clean
pip install --upgrade pip
pip install --quiet twine wheel
python setup.py sdist bdist_wheel
twine upload dist/*
$(MAKE) clean
clean:
@rm -Rf *.egg *.egg-info .cache .coverage .tox build dist docs/build htmlcov
@find . -depth -type d -name __pycache__ -exec rm -Rf {} \;
@find . -type d -name '.pytest_cache' | xargs rm -Rf
@find . -type f -name '*.pyc' -delete
.PHONY: default install reset check publish clean # test tox readme docs