File: Makefile

package info (click to toggle)
python-aioswitcher 4.0.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,528 kB
  • sloc: python: 4,324; makefile: 53
file content (96 lines) | stat: -rw-r--r-- 2,443 bytes parent folder | download
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
# Copyright Tomer Figenblat.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#######################
#### Build targets ####
#######################
build: clean-dist
	poetry build

clean-dist:
	rm -rf ./dist

install: install-all-deps

install-all-deps:
	poetry install --no-interaction

install-docs-only-deps:
	poetry install --no-interaction --without dev

publish: clean-dist # PYPI_TOKEN is required for this target
	poetry publish --build --no-interaction -u __token__ -p $(PYPI_TOKEN)

.PHONY: build dist publish install install-all-deps install-docs-only-deps

#########################
#### Testing targets ####
#########################
test:
	poetry run pytest -v

test-with-coverage:
	poetry run pytest -v --cov --cov-report=term

test-with-coverage-reports:
	poetry run pytest -v --cov --cov-report=xml:coverage.xml --junit-xml junit.xml

test-pypi-publish: clean-dist # requires testpypi configuration for poetry
	poetry publish --build --repository testpypi

.PHONY: test test-with-coverage test-with-coverage-reports test-pypi-publish

#########################
#### Linting targets ####
#########################
lint: black flake8 isort mypy yamllint

lint-with-fix: black-with-fix flake8 isort-with-fix mypy yamllint

black:
	poetry run black --check src/ docs/ scripts/

black-with-fix:
	poetry run black src/ docs/ scripts/

flake8:
	poetry run flake8 src/ tests/ docs/ scripts/

isort:
	poetry run isort --check-only src/ tests/ docs/ scripts/

isort-with-fix:
	poetry run isort src/ tests/ docs/ scripts/

mypy:
	poetry run mypy src/ scripts/

yamllint:
	poetry run yamllint --format colored --strict .

.PHONY: lint black black-with-fix flake8 isort isort-with-fix mypy yamllint

###############################
#### Documentation targets ####
###############################
docs-clean:
	rm -rf ./site

docs-build:
	poetry run mkdocs build --strict

docs-serve:
	poetry run mkdocs serve

.PHONY: docs-build docs-serve