-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (33 loc) · 957 Bytes
/
Makefile
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
.PHONY: install lint check test clean coverage benchmark pr-ready publish sort
SRC_DIR := ./RTN
# Install dependencies (with dev deps for development)
install:
@poetry install --with dev
# Clean up pyc files and __pycache__ directories
clean:
@find . -type f -name '*.pyc' -exec rm -f {} +
@find . -type d -name '__pycache__' -exec rm -rf {} +
@find . -type d -name '.pytest_cache' -exec rm -rf {} +
@find . -type d -name '.ruff_cache' -exec rm -rf {} +
# Run linters
lint:
@poetry run ruff check $(SRC_DIR)
@poetry run isort $(SRC_DIR)
# Sort imports
sort:
@poetry run isort $(SRC_DIR)
# Type checking
check:
@poetry run pyright
# Run tests
test: clean
@poetry run pytest
# Run tests with coverage
coverage: clean
@poetry run pytest --cov=$(SRC_DIR) --cov-report=xml --cov-report=term
@poetry run pyright $(SRC_DIR)
benchmark:
@poetry run python benchmarks/rank.py --quiet
pr-ready: clean lint test
publish:
@poetry publish --build