-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhatch.toml
96 lines (83 loc) · 2.44 KB
/
hatch.toml
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
#
# This package is managed using Hatch: a modern, extensible Python project manager.
#
# > Additional Hatch-config for this project is in "pyproject.toml"
#
# > See [Hatch Documentation](https://hatch.pypa.io/latest/).
#
[version]
path = "src/example_package/__init__.py"
[envs.env-vars]
HATCH_ENV_TYPE_VIRTUAL_PATH = "venv"
[build.targets.sdist]
exclude = [
"tests/**/cassettes", # VCRPy 'HTTP Replays' -- might contain secrets if not careful
]
[build.targets.wheel]
exclude = [
"tests/**/cassettes", # VCRPy 'HTTP Replays' -- might contain secrets if not careful
]
[build.hooks.custom] # See "hatch_build.py"
#
# Default 'dev' environment: For developers who want to update this code base.
#
# EXAMPLE: Use default dev environment. Great for tinkering via REPL.
# hatch shell
#
# EXAMPLE: Run all the tests, with code-coverage reports!
# hatch run coveragee
#
[envs.default]
dependencies = [
# TODO Update add/remove dependencies as needed
"pytest",
"pytest-vcr", # Saves HTTP-replays (cassettes) as test data
"pytest-coverage",
"assertpy",
"autopep8", # Auto-format Python files
"isort", # Auto-sort import statements
"flake8", # Python linter
"hatchling", # Required by "hatch_build.py"
]
python = "3.8"
[envs.default.scripts]
coveragee = "coverage run -m pytest --doctest-modules tests && coverage html --include=src/*"
test = "pytest --doctest-modules"
#
# "docs" environment: For viewing "docs/" directory, rendered by MkDocs.
#
# EXAMPLE: Enable viewing docs at https://localhost:8000
# hatch run docs:serve
#
# EXAMPLE: Build docs into an HTML static website.
# hatch run docs:build
#
[envs.docs]
dependencies = [
"mkdocs",
"mkdocs-material",
]
[envs.docs.scripts]
build = "mkdocs build --clean --strict"
serve = "mkdocs serve --dev-addr localhost:8000"
#
# "cicd" environment: For Continuous Integration and Delivery (CICD) pipelines.
#
# EXAMPLE: Run tests in the context of CICD. Produces test_report.xml for junit report-readers.
# hatch run cicd:test
#
[envs.cicd]
dependencies = [
# TODO Update add/remove dependencies as needed
"pytest",
"pytest-vcr", # Saves HTTP-replays (cassettes) as test data
"assertpy",
"hatchling", # Required by "hatch_build.py"
]
[[envs.cicd.matrix]]
python = ["38"]
[envs.cicd.scripts]
infer-package-name = "echo example-package" # TODO: Update to your package name
test = "pytest --doctest-modules --vcr-record=none --junitxml=test_report.xml src/ tests/"
[envs.cicd.env-vars]
CI = "True"