-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (65 loc) · 2.39 KB
/
Copy pathMakefile
File metadata and controls
76 lines (65 loc) · 2.39 KB
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
SHELL := bash
.PHONY: docs
PYTHON_VERSION := 3.10
# Create all environments
install:
{ hatch --version || pipx install --upgrade hatch || python3 -m pip install --upgrade hatch ; } && \
hatch env create default && \
hatch env create docs && \
hatch env create hatch-test && \
echo "Installation complete"
# Re-create all environments, from scratch (no reference to pinned
# requirements)
reinstall:
{ hatch --version || pipx install --upgrade hatch || python3 -m pip install --upgrade hatch ; } && \
hatch env prune && \
make && \
make requirements
distribute:
hatch build && hatch publish && rm -rf dist
# This will upgrade all requirements, and refresh pinned requirements to
# match. The same can be accomplished with `make reinstall`, but this
# runs faster, because environments are not recreated.
upgrade:
hatch run dependence upgrade\
--include-pointer /tool/hatch/envs/default\
--include-pointer /project\
pyproject.toml && \
hatch run docs:dependence upgrade\
--include-pointer /tool/hatch/envs/docs\
--include-pointer /project\
pyproject.toml && \
hatch run hatch-static-analysis:dependence upgrade\
--include-pointer /tool/hatch/envs/hatch-static-analysis\
--include-pointer /project\
pyproject.toml && \
hatch run hatch-test.py$(PYTHON_VERSION):dependence upgrade\
--include-pointer /tool/hatch/envs/hatch-test\
--include-pointer /project\
pyproject.toml
# This will align project dependency versions with those installed in the
# default environment
# This will update dependencies to reflect the latest installed versions,
# and output the frozen requiements.txt file for use in job deployment
requirements:
hatch run dependence update\
--include-pointer /tool/hatch/envs/default\
--include-pointer /project\
pyproject.toml && \
hatch run docs:dependence update pyproject.toml --include-pointer /tool/hatch/envs/docs && \
hatch run hatch-test.py$(PYTHON_VERSION):dependence update pyproject.toml --include-pointer /tool/hatch/envs/hatch-test
# Apply formatting and enforce linting
format:
hatch fmt --formatter && \
hatch fmt --linter && \
hatch check types && \
echo "Format Successful!"
# Test & check linting/formatting (for local use only)
test:
hatch fmt --check && hatch check types && hatch test -c
docs:
hatch run docs:mkdocs build && \
hatch run docs:mkdocs serve
# Cleanup untracked files
clean:
git clean -f -e .vscode -e .idea -x . -e .env -e .devcontainer