|
1 | | -# Justfile |
| 1 | +# Use UV_PYTHON env variable to select either a python version or |
| 2 | +# the complete python to your python interpreter |
2 | 3 |
|
3 | | -python := "python3" |
| 4 | +default := "all" |
4 | 5 |
|
5 | | -default: |
6 | | - @echo "Available recipes:" |
7 | | - @echo " mypy - Run mypy for type checking" |
8 | | - @echo " pylint - Run pylint for linting" |
9 | | - @echo " test - Run pytest for testing" |
10 | | - @echo " verify - Run mypy, pylint, test" |
| 6 | +set shell := ["bash", "-c"] |
11 | 7 |
|
12 | | -# Recipe to run mypy for type checking |
13 | | -mypy: |
14 | | - @echo "Running mypy..." |
15 | | - {{python}} -m mypy --check-untyped-defs --ignore-missing-imports python/restate/ |
16 | | - {{python}} -m mypy --check-untyped-defs --ignore-missing-imports examples/ |
| 8 | +sync: |
| 9 | + uv sync --all-extras --all-packages |
17 | 10 |
|
18 | | -# Recipe to run pylint for linting |
19 | | -pylint: |
20 | | - @echo "Running pylint..." |
21 | | - {{python}} -m pylint python/restate --ignore-paths='^.*.?venv.*$' |
22 | | - {{python}} -m pylint examples/ --ignore-paths='^.*\.?venv.*$' |
| 11 | +format: |
| 12 | + uv run ruff format |
| 13 | + uv run ruff check --fix --fix-only |
| 14 | + |
| 15 | +lint: |
| 16 | + uv run ruff format --check |
| 17 | + uv run ruff check |
| 18 | + |
| 19 | +typecheck-pyright: |
| 20 | + PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright python/ |
| 21 | + PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright examples/ |
| 22 | + PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright tests |
| 23 | + PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright test-services/ |
| 24 | + |
| 25 | +typecheck-mypy: |
| 26 | + uv run -m mypy --check-untyped-defs --ignore-missing-imports python/ |
| 27 | + uv run -m mypy --check-untyped-defs --ignore-missing-imports examples/ |
| 28 | + uv run -m mypy --check-untyped-defs --ignore-missing-imports tests/ |
| 29 | + |
| 30 | +typecheck: typecheck-pyright typecheck-mypy |
23 | 31 |
|
24 | 32 | test: |
25 | | - @echo "Running Python tests..." |
26 | | - {{python}} -m pytest tests/* |
| 33 | + uv run -m pytest tests/* |
| 34 | + |
27 | 35 |
|
28 | 36 | # Recipe to run both mypy and pylint |
29 | | -verify: mypy pylint test |
| 37 | +verify: format lint typecheck test |
30 | 38 | @echo "Type checking and linting completed successfully." |
31 | 39 |
|
32 | 40 | # Recipe to build the project |
33 | 41 | build: |
34 | 42 | @echo "Building the project..." |
35 | | - maturin build --release |
| 43 | + #maturin build --release |
| 44 | + uv build --all-packages |
36 | 45 |
|
37 | 46 | clean: |
38 | 47 | @echo "Cleaning the project" |
|
0 commit comments