forked from OpenRL-Lab/openrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 855 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
SHELL=/bin/bash
PROJECT_NAME=openrl
PROJECT_PATH=${PROJECT_NAME}/
PYTHON_FILES = $(shell find setup.py ${PROJECT_NAME} tests examples -type f -name "*.py")
check_install = python3 -c "import $(1)" || pip3 install $(1) --upgrade
check_install_extra = python3 -c "import $(1)" || pip3 install $(2) --upgrade
test:
./scripts/unittest.sh
lint:
$(call check_install, ruff)
ruff ${PYTHON_FILES} --select=E9,F63,F7,F82 --show-source
ruff ${PYTHON_FILES} --exit-zero
format:
$(call check_install, isort)
$(call check_install, black)
# Sort imports
isort ${PYTHON_FILES}
# Reformat using black
black ${PYTHON_FILES} --preview
# do format agent
isort ${PYTHON_FILES}
black ${PYTHON_FILES} --preview
commit-checks: format lint
docker-cpu:
RELEASE=True ./scripts/build_docker.sh
docker-gpu:
RELEASE=True USE_GPU=True ./scripts/build_docker.sh