-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
58 lines (46 loc) · 1.5 KB
/
justfile
File metadata and controls
58 lines (46 loc) · 1.5 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
#!/usr/bin/env -S just --justfile
# Virtual environment path alias
venv := "./venv/bin"
# List available commands
default:
@just --list
# Install production dependencies only
install:
[ -d venv ] || python3 -m venv venv
{{venv}}/pip install -r requirements.txt
# Install both production and development dependencies
install-dev:
{{venv}}/pip install -r requirements-dev.txt
# Run the Flask development server
run:
{{venv}}/python app.py
# Run the CLI application
cli *args:
{{venv}}/python cli.py {{args}}
# Format code using Ruff
fmt:
{{venv}}/ruff format .
{{venv}}/ruff check . --fix
# Check code without fixing
check:
{{venv}}/ruff check .
# Run tests
test:
{{venv}}/pytest
# Clean up Python cache files and temporary files
clean:
find . -type d -name "__pycache__" -exec rm -r {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.pyd" -delete
find . -type f -name ".coverage" -delete
find . -type d -name "*.egg-info" -exec rm -r {} +
find . -type d -name "*.egg" -exec rm -r {} +
find . -type d -name ".pytest_cache" -exec rm -r {} +
find . -type d -name ".ruff_cache" -exec rm -r {} +
# Update requirements.txt with current production dependencies
freeze:
{{venv}}/pip freeze | grep -v -f <({{venv}}/pip freeze -r requirements-dev.txt) > requirements.txt
# Update requirements-dev.txt with current development dependencies
freeze-dev:
{{venv}}/pip freeze > requirements-dev.txt