-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
53 lines (40 loc) · 939 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
45
46
47
48
49
50
51
52
53
poetry_to_requirements:
poetry export -f requirements.txt --output requirements.txt
poetry_install_deps:
poetry install
# Uninstall dataclasses from PyPI
# https://github.com/allenai/allennlp/issues/4755
pip uninstall -y dataclasses
build_image:
docker buildx build -t ayesaac .
.PHONY : check-for-cuda
check-for-cuda :
@python -c 'import torch; assert torch.cuda.is_available(); print("Cuda is available")'
# Testing helpers.
.PHONY : lint
lint :
flake8 .
.PHONY : format
format :
black --check .
.PHONY : typecheck
typecheck :
mypy .
.PHONY : test
test :
pytest --color=yes -rf --durations=40
.PHONY : test-with-cov
test-with-cov :
pytest --color=yes -rf --durations=40 \
--cov-config=.coveragerc \
--cov=$(SRC) \
--cov-report=xml
.PHONY : gpu-test
gpu-test : check-for-cuda
pytest --color=yes -v -rf -m gpu
.PHONY : clean
clean :
rm -rf .coverage \
cov.xml \
.pytest_cache \
.allennlp_cache