forked from lukasmasuch/streamlit-pydantic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (56 loc) · 1.71 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
.PHONY: help
help:
@# Magic line used to create self-documenting makefiles.
@# See https://stackoverflow.com/a/35730928
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' Makefile | column -s: -t
.PHONY: all
# Install everything needed for development and run all checks.
all: install check
.PHONY: install
# Install everything needed for development.
install:
python -m pip install pipenv
pipenv --rm || true
pipenv install --dev --skip-lock
.PHONY: check
# Run all formatting and linting checks.
check:
# Run all formatting and linting checks:
pipenv run black --check src
pipenv run black --check tests
pipenv run isort --profile black --check-only src
pipenv run isort --profile black --check-only tests
pipenv run pydocstyle src
pipenv run mypy src
pipenv run flake8 --show-source --statistics src
pipenv run flake8 --show-source --statistics tests
# Checking package safety
pipenv check
.PHONY: format
# Run code formatters.
format:
# Format code via black and imports via isort:
pipenv run black src
pipenv run black tests
pipenv run isort --profile black src
pipenv run isort --profile black tests
.PHONY: docs
# Build the API documentation.
docs:
pipenv run lazydocs --overview-file=README.md --src-base-url=https://github.com/lukasmasuch/streamlit-pydantic/blob/main streamlit_pydantic
.PHONY: build
# Build everything for release.
build: docs
rm -rf ./dist
rm -rf ./build
pipenv run python -m build
pipenv run twine check dist/*
.PHONY: test
# Run unit tests.
test:
pipenv run coverage erase
pipenv run pytest -m "not slow"
.PHONY: release
# Build everything and upload distribution to PyPi.
release: build
twine upload -u "__token__" dist/*