2020-01-22 15:18:27 +00:00
|
|
|
SHELL=/bin/bash
|
2020-07-03 01:14:54 +00:00
|
|
|
LINT_PATHS=stable_baselines3/ tests/ docs/conf.py setup.py
|
2020-01-22 15:18:27 +00:00
|
|
|
|
|
|
|
|
pytest:
|
|
|
|
|
./scripts/run_tests.sh
|
|
|
|
|
|
2022-11-16 12:22:57 +00:00
|
|
|
mypy:
|
2022-11-22 13:28:58 +00:00
|
|
|
mypy ${LINT_PATHS}
|
2022-11-16 12:22:57 +00:00
|
|
|
|
2023-04-14 11:13:59 +00:00
|
|
|
missing-annotations:
|
|
|
|
|
mypy --disallow-untyped-calls --disallow-untyped-defs --ignore-missing-imports stable_baselines3
|
|
|
|
|
|
|
|
|
|
# missing docstrings
|
|
|
|
|
# pylint -d R,C,W,E -e C0116 stable_baselines3 -j 4
|
|
|
|
|
|
2023-11-08 08:46:40 +00:00
|
|
|
type: mypy
|
2022-11-16 12:22:57 +00:00
|
|
|
|
2020-05-12 15:55:01 +00:00
|
|
|
lint:
|
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
2023-03-11 21:15:26 +00:00
|
|
|
# see https://www.flake8rules.com/
|
2024-03-11 12:53:06 +00:00
|
|
|
ruff check ${LINT_PATHS} --select=E9,F63,F7,F82 --output-format=full
|
2023-01-23 13:55:19 +00:00
|
|
|
# exit-zero treats all errors as warnings.
|
2024-06-29 18:07:32 +00:00
|
|
|
ruff check ${LINT_PATHS} --exit-zero --output-format=concise
|
2023-01-23 13:55:19 +00:00
|
|
|
|
2020-07-16 14:12:16 +00:00
|
|
|
format:
|
|
|
|
|
# Sort imports
|
2024-03-11 12:53:06 +00:00
|
|
|
ruff check --select I ${LINT_PATHS} --fix
|
2020-07-16 14:12:16 +00:00
|
|
|
# Reformat using black
|
2023-03-11 21:15:26 +00:00
|
|
|
black ${LINT_PATHS}
|
2020-07-16 14:12:16 +00:00
|
|
|
|
|
|
|
|
check-codestyle:
|
|
|
|
|
# Sort imports
|
2024-03-11 12:53:06 +00:00
|
|
|
ruff check --select I ${LINT_PATHS}
|
2020-07-16 14:12:16 +00:00
|
|
|
# Reformat using black
|
2023-03-11 21:15:26 +00:00
|
|
|
black --check ${LINT_PATHS}
|
2020-07-16 14:12:16 +00:00
|
|
|
|
|
|
|
|
commit-checks: format type lint
|
|
|
|
|
|
2020-01-28 09:24:02 +00:00
|
|
|
doc:
|
2020-01-22 15:18:27 +00:00
|
|
|
cd docs && make html
|
|
|
|
|
|
|
|
|
|
spelling:
|
|
|
|
|
cd docs && make spelling
|
2020-01-28 09:24:02 +00:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
cd docs && make clean
|
2020-04-30 09:26:28 +00:00
|
|
|
|
2020-05-07 09:08:49 +00:00
|
|
|
# Build docker images
|
|
|
|
|
# If you do export RELEASE=True, it will also push them
|
|
|
|
|
docker: docker-cpu docker-gpu
|
|
|
|
|
|
|
|
|
|
docker-cpu:
|
|
|
|
|
./scripts/build_docker.sh
|
|
|
|
|
|
|
|
|
|
docker-gpu:
|
|
|
|
|
USE_GPU=True ./scripts/build_docker.sh
|
2020-05-05 14:28:38 +00:00
|
|
|
|
|
|
|
|
# PyPi package release
|
|
|
|
|
release:
|
2023-05-24 09:38:37 +00:00
|
|
|
python -m build
|
2020-05-05 14:28:38 +00:00
|
|
|
twine upload dist/*
|
|
|
|
|
|
|
|
|
|
# Test PyPi package release
|
|
|
|
|
test-release:
|
2023-05-24 09:38:37 +00:00
|
|
|
python -m build
|
2020-05-05 14:28:38 +00:00
|
|
|
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
|
2020-07-16 14:12:16 +00:00
|
|
|
|
|
|
|
|
.PHONY: clean spelling doc lint format check-codestyle commit-checks
|