-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
53 lines (38 loc) · 920 Bytes
/
tasks.py
File metadata and controls
53 lines (38 loc) · 920 Bytes
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
"""ntask builds/lints/types/tests itself with ntask."""
from ntask import cached, depends, shell, task
@task
def install():
"""Install dev dependencies."""
shell('pip install -e ".[dev]"')
@task
@cached(inputs=["src/**/*.py"])
def lint():
"""Ruff."""
shell("ruff check src tests")
@task
@cached(inputs=["src/**/*.py"])
def typecheck():
"""Mypy."""
shell("mypy")
@task
@cached(inputs=["src/**/*.py", "tests/**/*.py"])
def test():
"""Pytest."""
shell("pytest -v")
@task
def check():
"""All quality checks."""
depends(lint, typecheck, test)
@task
@cached(
inputs=["src/**/*.py", "pyproject.toml", "README.md", "LICENSE"],
outputs=["dist/"],
)
def build():
"""Build the wheel."""
shell("python -m build")
@task
def release(version: str):
"""Cut a release: tag + push."""
depends(check, build)
shell(f"git tag v{version} && git push --tags")