forked from aramis-lab/clinicadl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (61 loc) · 1.45 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
PACKAGES := clinicadl tests
POETRY ?= poetry
CONDA ?= conda
CONDA_ENV ?= "./env"
.PHONY: help
help: Makefile
@echo "Commands:"
@sed -n 's/^##//p' $<
## build : Build the package.
.PHONY: build
build:
@$(POETRY) build
.PHONY: clean.doc
clean.doc:
@$(RM) -rf site
.PHONY: config.testpypi
config.testpypi:
@$(POETRY) config repositories.testpypi https://test.pypi.org/legacy
## doc : Build the documentation.
.PHONY: doc
doc: clean.doc env.doc
@$(POETRY) run mkdocs build
## env : Bootstap an environment.
.PHONY: env
env: env.dev
.PHONY: env.conda
env.conda:
@$(CONDA) env create -p $(CONDA_ENV)
.PHONY: env.dev
env.dev:
@$(POETRY) install
.PHONY: env.doc
env.doc:
@$(POETRY) install --extras docs
## format : Format the codebase.
.PHONY: format
format: format.black format.isort
.PHONY: format.black
format.black: env.dev
@$(POETRY) run black --quiet $(PACKAGES)
.PHONY: format.isort
format.isort: env.dev
@$(POETRY) run isort --quiet $(PACKAGES)
## lint : Lint the codebase.
.PHONY: lint
lint: lint.black lint.isort
.PHONY: lint.black
lint.black: env.dev
@$(POETRY) run black --check --diff $(PACKAGES)
.PHONY: lint.isort
lint.isort: env.dev
@$(POETRY) run isort --check --diff $(PACKAGES)
## publish : Publish the package to pypi.
.PHONY: publish
publish: publish.pypi
.PHONY: publish.pypi
publish.pypi: build
@$(POETRY) publish
.PHONY: publish.testpypi
publish.testpypi: build config.testpypi
@$(POETRY) publish --repository testpypi