-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
128 lines (101 loc) · 2.44 KB
/
Justfile
File metadata and controls
128 lines (101 loc) · 2.44 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
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
# Alias
alias t := test
alias a := check-all
# Set the default shell for all platforms
set shell := ["sh", "-cu"]
set windows-shell := ["bash", "-lc"]
set dotenv-load
# Set the default recipe
@_:
just --list
#Run
[group('run')]
basisprofiel *args:
uv run python apps/basisprofiel/main.py {{ args }}
# Run tests
[group('qa')]
test *args:
uv run -m pytest {{ args }}
_cov *args:
uv run -m coverage {{ args }}
# Run tests and measure coverage
[group('qa')]
@cov:
just _cov erase
just _cov run -m pytest tests
just _cov report
just _cov html
# Run linters
[group('qa')]
lint:
uvx ruff check
uvx ruff format
# Check types
[group('qa')]
typing:
uv run pyright
# Check pre-commit hooks
[group('qa')]
pc:
uv run pre-commit run --all-files
# Perform all checks
[group('qa')]
check-all: lint cov typing pc
# Update dependencies
[group('lifecycle')]
update:
uv sync --upgrade
# Ensure project virtualenv is up to date
[group('lifecycle')]
install:
uv sync
[group('deployment')]
_clean_dist:
just _clean-dist-{{os()}}
_clean-dist-linux:
rm -rf dist
_clean-dist-macos:
rm -rf .dist
find . -type d -name "__pycache__" -exec rm -r {} +
_clean-dist-windows:
-rmdir /s /q dist
# build the distribution packages
[group('deployment')]
build:
just _clean_dist
uv build
# create and push a git tag use: tag name and message
[group('deployment')]
tag tag +msg:
git tag -a {{tag}} -m "{{msg}}"
git push origin {{tag}}
# bump the version in pyproject.toml use: patch, minor, or major
[group('deployment')]
bump tag:
uv version --bump {{tag}}
uv lock
# publish the package to PyPI
[group('deployment')]
deploy version:
just build
uv publish
@echo 'Package v{{ version }} published successfully'
# Docker compose up (local by default, use 'env=prod' for production)
[group('docker')]
docker-build env='local':
docker compose -f docker-compose.{{env}}.yaml build
[group('docker')]
docker-up env='local' *args:
docker compose -f docker-compose.{{env}}.yaml up -d {{ args }}
# Docker compose down
[group('docker')]
docker-down env='local':
docker compose -f docker-compose.{{env}}.yaml down
# View logs from Docker services
[group('docker')]
docker-logs env='local' *service:
docker compose -f docker-compose.{{env}}.yaml logs -f {{ service }}
# Restart Docker services
[group('docker')]
docker-restart env='local':
docker compose -f docker-compose.{{env}}.yaml restart