-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjustfile
More file actions
61 lines (48 loc) · 1.6 KB
/
justfile
File metadata and controls
61 lines (48 loc) · 1.6 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
# VARIABLE DEFINITIONS
venv := ".venv"
python_version :="3.10"
run := "uv run"
venv_exists := path_exists(venv)
target_dirs := "src tests dependencies"
# ALIASES
alias t := test
help:
just --list --unsorted
# Create a new venv with all the dependencies groups
venv:
@if ! {{ venv_exists }}; \
then \
uv sync --frozen --all-extras --all-groups --python {{ python_version }}; \
fi
# Cleans all artifacts generated while running this project, including the virtualenv.
clean:
@rm -f .coverage*
@rm -rf {{ venv }}
@rm -rf dist/
@rm -rf .mypy_cache/
@rm -rf .ruff_cache/
@rm -rf .pytest_cache/
@find . -type d -name '__pycache__' -exec rm -r {} +
# Runs the tests with the specified arguments (any path or pytest argument).
test *test-args='': venv
{{ run }} pytest tests {{ test-args }}
# Runs the "download" tests with the specified arguments (any path or pytest argument).
test-download *test-args='': venv
{{ run }} pytest dependencies/tests {{ test-args }}
# Format all code in the project.
format: venv
{{ run }} ruff format {{ target_dirs }}
{{ run }} ruff check {{ target_dirs }} --fix
# Lint all code in the project.
lint: venv
{{ run }} ruff format --check {{ target_dirs }}
{{ run }} ruff check {{ target_dirs }}
{{ run }} mypy {{ target_dirs }}
# Build the package using hatchling
build: venv
{{ run }} build
# Install package in development mode
install-dev: venv
uv pip install -e .
download ecosystem: venv
PYTHONPATH=dependencies/ uv run --no-project dependencies/scripts/download_packages.py download {{ecosystem}}