-
Notifications
You must be signed in to change notification settings - Fork 10
/
Justfile
56 lines (45 loc) · 1.4 KB
/
Justfile
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
package := 'aioxmlrpc'
default_unittest_suite := 'tests/unittests'
default_functest_suite := 'tests/functionals'
install:
uv sync --group dev
test: lint typecheck unittest
lint:
uv run ruff check .
typecheck:
uv run mypy src/ tests/
unittest test_suite=default_unittest_suite:
uv run pytest -sxv {{test_suite}}
lf:
uv run pytest -sxvvv --lf
cov test_suite=default_unittest_suite:
rm -f .coverage
rm -rf htmlcov
uv run pytest --cov-report=html --cov={{package}} {{test_suite}}
xdg-open htmlcov/index.html
fmt:
uv run ruff check --fix .
uv run ruff format src tests
release major_minor_patch: test && changelog
#! /bin/bash
# Try to bump the version first
if ! uvx pdm bump {{major_minor_patch}}; then
# If it fails, check if pdm-bump is installed
if ! uvx pdm self list | grep -q pdm-bump; then
# If not installed, add pdm-bump
uvx pdm self add pdm-bump
fi
# Attempt to bump the version again
uvx pdm bump {{major_minor_patch}}
fi
uv sync
changelog:
uv run python scripts/write_changelog.py
cat CHANGELOG.rst >> CHANGELOG.rst.new
rm CHANGELOG.rst
mv CHANGELOG.rst.new CHANGELOG.rst
$EDITOR CHANGELOG.rst
publish:
git commit -am "Release $(uv run scripts/get_version.py)"
git tag "v$(uv run scripts/get_version.py)"
git push origin "v$(uv run scripts/get_version.py)"