FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pyproject-cookiecutter-example/Makefile at python · python-project-templates/pyproject-cookiecutter-example · GitHub
This repository was archived by the owner on Jun 22, 2023. It is now read-only.
python-project-templates
pyproject-cookiecutter-example
Repository navigation
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
pyproject-cookiecutter-example
/
Makefile
Copy path
More file actions
More file actions
Latest commit
History
History
History
144 lines (100 loc) · 3.51 KB
Breadcrumbs
pyproject-cookiecutter-example
/
Makefile
Copy path
File metadata and controls
144 lines (100 loc) · 3.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
########
#
BUILD #
#
########
.PHONY
: develop build-py build-js build install serverextension labextension
develop
:
#
# install dependencies and build library
python -m pip install -e .[develop]
build-py
:
#
# build the python library
python setup.py build build_ext --inplace
build
: build-py
#
# build the library
install
:
#
# install library
python -m pip install
.
#
########
#
LINTS #
#
########
.PHONY
: lint-py lint-js lint-cpp lint lints fix-py fix-js fix-cpp fix format
lint-py
:
#
# run python linter with flake8 and black
python -m ruff pyproject_cookiecutter_example setup.py
python -m black --check pyproject_cookiecutter_example setup.py
lint
: lint-py
#
# run all lints
#
Alias
lints
: lint
fix-py
:
#
# fix python formatting with black
python -m black pyproject_cookiecutter_example/ setup.py
python -m ruff pyproject_cookiecutter_example/ setup.py --fix
fix
: fix-py
#
# run all autofixers
#
alias
format
: fix
#
###############
#
Other Checks #
#
###############
.PHONY
: check-manifest semgrep checks check annotate
check-manifest
:
#
# check python sdist manifest with check-manifest
check-manifest -v
semgrep
:
#
# check for possible errors with semgrep
semgrep ci --config auto
checks
: check-manifest semgrep
#
Alias
check
: checks
annotate
:
#
# run python type annotation checks with mypy
python -m mypy ./pyproject_cookiecutter_example
#
########
#
TESTS #
#
########
.PHONY
: test-py test-js coverage-py test coverage tests
test-py
:
#
# run python tests
python -m pytest -v pyproject_cookiecutter_example/tests --junitxml=junit.xml
coverage-py
:
#
# run tests and collect test coverage
python -m pytest -v pyproject_cookiecutter_example/tests --junitxml=junit.xml --cov=pyproject_cookiecutter_example --cov-branch --cov-fail-under=75 --cov-report term-missing --cov-report xml
test
: test-py
#
# run all tests
coverage
: coverage-py
#
# run all tests with coverage collection
#
Alias
tests
: test
#
#######
#
DOCS #
#
#######
.PHONY
: docs show-docs
docs
:
#
# build html documentation
make -C ./docs html
show-docs
:
#
# show docs with running webserver
cd
./docs/_build/html/
&&
PYTHONBUFFERED=1 python -m http.server
|
sec -u
"
s/0\.0\.0\.0/
$$
(hostname)/g
"
#
##########
#
VERSION #
#
##########
.PHONY
: show-version patch minor major
show-version
:
#
# show current library version
bump2version --dry-run --allow-dirty setup.py --list
|
grep current
|
awk -F=
'
{print $2}
'
patch
:
#
# bump a patch version
bump2version patch
minor
:
#
# bump a minor version
bump2version minor
major
:
#
# bump a major version
bump2version major
#
#######
#
DIST #
#
#######
.PHONY
: dist-py dist-py-sdist dist-py-local-wheel publish-py publish-js publish
dist-py
:
#
build python dists
python setup.py sdist bdist_wheel
dist-check
:
#
# run python dist checker with twine
python -m twine check dist/
*
dist
: clean build dist-py dist-check
#
# build all dists
publish-py
:
#
publish python assets
python -m twine upload dist/
*
--skip-existing
publish
: dist publish-py
#
# publish all dists
#
########
#
CLEAN #
#
########
.PHONY
: deep-clean clean
deep-clean
:
#
# clean everything from the repository
git clean -fdx
clean
:
#
# clean the repository
rm -rf .coverage coverage cover htmlcov logs build dist
*
.egg-info
#
###########################################################################################
.PHONY
: help
#
Thanks to Francoise at marmelab.com for this
.DEFAULT_GOAL
:= help
help
:
@grep -E
'
^[a-zA-Z_-]+:.*?## .*$$
'
$(
MAKEFILE_LIST
)
|
sort
|
awk
'
BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}
'
print-
%
:
@echo
'
$*=$($*)
'
Back
|
FazBrowse Home
|
New Git URL