-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
101 lines (84 loc) · 2.24 KB
/
Taskfile.yaml
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
91
92
93
94
95
96
97
98
99
100
101
# https://taskfile.dev/
version: '3'
vars:
PROJECT_NAME: geomancy
SPHINX_BUILD: .venv/bin/sphinx-build # run from within virtualenv
SPHINX_OPTS: ""
SPHINX_SOURCE_DIR: .
SPHINX_BUILD_DIR: _build
tasks:
create-env:
desc: Create a local virtual environment for development
internal: true
cmds:
- python3 -m venv .venv
generates:
- .venv
install:
desc: Install the package in development (edit) mode
cmds:
- python3 -m pip install -e ".[all,dev,docs]"
sources:
- pyproject.toml
setup:
desc: Setup the development environment
cmds:
- task: create-env
- task: install
upload:
desc: Upload the package to PyPI
cmds:
- python3 -m build
- twine upload dist/*
build:
desc: Build docs, examples
cmds:
- task: examples:build
- task: docs:build
examples:run:
desc: Run geo with all examples
cmds:
- "geo examples/*.{toml,yaml}"
examples:build:
desc: Build files from examples/geomancy.yaml
cmds:
- "yj -yt -i < examples/geomancy.yaml > examples/geomancy.toml"
sources:
- "examples/geomancy.yaml"
docs:help:
desc: Print the docs building help message
dir: docs
cmds:
- "../{{.SPHINX_BUILD}} -M help {{.SPHINX_SOURCE_DIR}} {{.SPHINX_BUILD_DIR}} {{.SPHINX_OPTS}}"
docs:build:
desc: Build the docs (and examples)
dir: docs
cmds:
- "../{{.SPHINX_BUILD}} -M html {{.SPHINX_SOURCE_DIR}} {{.SPHINX_BUILD_DIR}} -E -a -W {{.SPHINX_OPTS}}"
sources:
- "**/*.md"
- "**/*.rst"
- "_static/**"
- "conf.py"
- "../README.md"
- "../geomancy/**/*.py"
docs:clean:
desc: Clean the docs build directories
dir: docs
cmds:
- "../{{.SPHINX_BUILD}} -M clean {{.SPHINX_SOURCE_DIR}} {{.SPHINX_BUILD_DIR}} {{.SPHINX_OPTS}}"
test:
desc: Run tests
cmds:
- pytest
test:act:
desc: Run tests with act (run Github actions locally)
cmds:
- act --reuse
towncrier:cmds:
desc: A refresher of towncrier commands
silent: true
cmds:
- echo "towncrier create -c {msg} {issue}.{type}.md"
- echo "towncrier build [--draft] --name {{.PROJECT_NAME}}"
# towncrier create -c "Implement towncrier" 8.docs.md