-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (56 loc) · 1.57 KB
/
Copy pathMakefile
File metadata and controls
71 lines (56 loc) · 1.57 KB
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
.PHONY: install test lint format clean
# Variables
PYTHON = python
PIP = pip
POETRY = poetry
# Install dependencies
install:
$(POETRY) install
# Run tests
test:
$(POETRY) run pytest -v --cov=modbusim --cov-report=term-missing
# Run linter
lint:
$(POETRY) run flake8 modbusim tests
$(POETRY) run mypy modbusim tests
# Format code
format:
$(POETRY) run black modbusim tests
$(POETRY) run isort modbusim tests
# Clean up
clean:
find . -type d -name "__pycache__" -exec rm -r {} +
find . -type d -name ".pytest_cache" -exec rm -r {} +
find . -type d -name ".mypy_cache" -exec rm -r {} +
rm -rf .coverage htmlcov/ build/ dist/ *.egg-info/
# Sprawdzenie wersji
version:
@echo "Aktualna wersja:"
@poetry version
# Inkrementacja wersji patch
bump-patch:
poetry version patch
# Inkrementacja wersji minor
bump-minor:
poetry version minor
# Inkrementacja wersji major
bump-major:
poetry version major
# Zbudowanie paczki do dystrybucji
build: clean
poetry build
# Sprawdzenie czy wersja jest gotowa do publikacji
check-version:
@echo "Sprawdzanie wersji..."
@poetry version
@echo "Upewnij się, że wersja jest unikalna przed publikacją."
# Publikacja paczki w PyPI
publish: check-version bump-patch build
@echo "Publikowanie w PyPI..."
poetry publish
# Publikacja paczki w TestPyPI
publish-test: check-version build
@echo "Publikowanie w TestPyPI..."
poetry publish --build -r testpypi
@echo "\nPaczka opublikowana w TestPyPI. Możesz ją zainstalować używając:"
@echo "pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple modapi"