forked from mckinsey/vizro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhatch.toml
111 lines (98 loc) · 3.53 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
[envs.all]
[[envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
[envs.all.overrides]
# Kedro is currently not compatible with Python 3.12 and returns exceptions when trying to run the unit tests on
# Python 3.12. These exceptions turned out to be difficult to ignore: https://github.com/mckinsey/vizro/pull/216
matrix.python.features = [
{value = "kedro", if = ["3.8", "3.9", "3.10", "3.11"]}
]
[envs.changelog]
dependencies = ["scriv"]
detached = true
scripts = {add = "scriv create --add", collect = ["scriv collect --add", "- hatch run lint:lint --files=CHANGELOG.md"]}
[envs.default]
dependencies = [
"devtools[pygments]",
"coverage[toml]>=6.5",
"pytest",
"pytest-mock",
"freezegun>=1.5.0",
"dash[testing]",
"chromedriver-autoinstaller>=0.6.4",
"toml",
"pyyaml",
"openpyxl"
]
[envs.default.scripts]
example = "hatch run examples:example {args:scratch_dev}" # shortcut script to underlying example environment script.
lint = "hatch run lint:lint {args:--all-files}" # shortcut script to underlying lint environment script.
prep-release = [
"hatch version release",
"hatch run changelog:collect",
"hatch run changelog:add",
"rm -rf schemas/*json",
"schema",
"git add schemas",
'echo "Now raise a PR to merge into main with title: [Release] Release of vizro $(hatch version)"'
]
pypath = "python -c 'import sys; print(sys.executable)'"
schema = ["python schemas/generate.py {args}", '- hatch run lint --files="schemas/$(hatch version).json" > /dev/null']
secrets = "hatch run lint:pre-commit run gitleaks --all-files"
# Note `hatch run test` currently fails due to interference between integration tests and unit tests. Ideally we would
# fix this, but we don't actually use `hatch run test` anywhere right now.
# See comments added in https://github.com/mckinsey/vizro/pull/444.
test = "pytest tests --headless {args}"
test-integration = "pytest tests/integration --headless {args}"
test-js = "./tools/run_jest.sh {args}"
test-unit = "pytest tests/unit {args}"
test-unit-coverage = [
"coverage run -m pytest tests/unit {args}",
"- coverage combine",
"coverage report"
]
update-snyk-requirements = "python ../tools/generate_snyk_requirements.py {args}"
[envs.docs]
dependencies = [
"mkdocs>=1.6",
"mkdocs-material",
"mkdocs-git-revision-date-localized-plugin",
"mkdocstrings[python]",
"linkchecker",
"mkdocs-pycafe"
]
detached = true
[envs.docs.scripts]
build = "mkdocs build --strict"
# Disable warnings on the linkcheck so that HTTP redirects are accepted. We could ignore only that warning and specify
# more advanced settings using a linkcheckerrc config file.
link-check = "linkchecker site --check-extern --no-warnings --ignore=404.html --ignore-url=127.0.0.1 --ignore-url=https://vizro.readthedocs.io/"
serve = "mkdocs serve --open"
[envs.examples]
dependencies = [
"pyyaml",
# black is required to run the example _chart-gallery. This is completely independent of the black used in linting
# our code. When this moves to HuggingFace we can remove the requirement from here.
"black==24.4.2"
]
scripts = {example = "cd examples/{args:scratch_dev}; python app.py"}
# This environment doesn't inherit from default but does install Vizro.
template = "examples"
[envs.examples.env-vars]
DASH_DEBUG = "true"
VIZRO_LOG_LEVEL = "DEBUG"
[envs.lint]
dependencies = [
"pre-commit"
]
detached = true
scripts = {lint = "SKIP=gitleaks pre-commit run {args:--all-files}"}
[envs.lower-bounds]
extra-dependencies = [
"pydantic==1.10.13",
"dash==2.17.1"
]
[publish.index]
disable = true
[version]
path = "src/vizro/__init__.py"