This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
90 lines (69 loc) · 2.25 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# NOTE: Used on linux, limited support outside of Linux
#
# A simple makefile to help with small tasks related to development of the sweepers
# These have been configured to only really run short tasks. Longer form tasks
# are usually completed in github actions.
.PHONY: help install-dev check format pre-commit clean build clean-doc clean-build test doc
help:
@echo "Makefile AutoRL Sweepers"
@echo "* install-dev to install all dev requirements and install pre-commit"
@echo "* check to check the source code for issues"
@echo "* format to format the code with black and isort"
@echo "* pre-commit to run the pre-commit check"
@echo "* clean to clean the dist and doc build files"
@echo "* build to build a dist"
@echo "* test to run the tests"
@echo "* doc to generate and view the html files"
PYTHON ?= python
CYTHON ?= cython
PYTEST ?= python -m pytest
CTAGS ?= ctags
PIP ?= python -m pip
MAKE ?= make
BLACK ?= python -m black
ISORT ?= python -m isort --profile black
PYDOCSTYLE ?= python -m pydocstyle
PRECOMMIT ?= pre-commit
FLAKE8 ?= python -m flake8
DIR := ${CURDIR}
DIST := ${CURDIR}/dist
DOCDIR := ${CURDIR}/docs
INDEX_HTML := file://${DOCDIR}/html/build/index.html
install-dev:
$(PIP) install -e ".[dev,dehb,pbt,pb2,examples]"
pre-commit install
check-black:
$(BLACK) hydra_plugins examples tests --check || :
check-isort:
$(ISORT) hydra_plugins tests --check || :
check-pydocstyle:
$(PYDOCSTYLE) hydra_plugins || :
check-flake8:
$(FLAKE8) hydra_plugins || :
$(FLAKE8) tests || :
# pydocstyle does not have easy ignore rules, instead, we include as they are covered
check: check-black check-isort check-flake8 check-pydocstyle
pre-commit:
$(PRECOMMIT) run --all-files
format-black:
$(BLACK) hydra_plugins examples tests
format-isort:
$(ISORT) hydra_plugins tests
format: format-black format-isort
test:
$(PYTEST) -v --cov=hydra_plugins tests --durations=20
clean-doc:
$(MAKE) -C ${DOCDIR} clean
clean-build:
$(PYTHON) setup.py clean
rm -rf ${DIST}
# Clean up any builds in ./dist as well as doc
clean: clean-doc clean-build
# Build a distribution in ./dist
build:
$(PYTHON) setup.py sdist
doc:
$(MAKE) -C ${DOCDIR} docs
@echo
@echo "View docs at:"
@echo ${INDEX_HTML}