forked from cherrytea-dev/la_searcher_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.21 KB
/
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
45
46
47
48
49
50
51
52
53
SRC_FUNCTIONS_REGEX := '^[a-z].*'
# all dirs not starting with underscore
venv:
uv sync --all-groups --all-extras --locked
test:
uv run pytest . -v -n 4
initdb:
uv run python tests/tools/init_testing_db.py
lint:
uv run ruff format src tests
uv run ruff check src tests --select I --fix
lint-check:
uv run ruff format src tests --check --diff
uv run ruff check src tests --select I --diff
mypy:
uv run mypy src/
requirements:
for d in $$(ls -1 src | grep -E ${SRC_FUNCTIONS_REGEX}); do \
uv export --extra $$d --no-hashes > src/$$d/requirements.txt; \
done
ci-test:
docker compose run --build --rm bot make initdb
docker compose run --build --rm bot make test
dependencies:
echo "Copy common code to deploy Google Cloud Functions"
echo "Don't run locally"
for d in $$(ls -1 src | grep -E ${SRC_FUNCTIONS_REGEX}); do \
cp src/_dependencies src/$$d/ -r ; \
done
smoke-tests-generate:
echo "" > build/pytest.log
uv run python tests/tools/generate_smoke_tests.py
make lint
type-annotate:
uv run python tests/tools/annotate_types.py
mypy-short:
# check simple errors like missing imports
uv run mypy src 2> build/mypy.log \
|| grep "is not defined" build/mypy.log \
|| grep "datetime" build/mypy.log