File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ requires = [
66build-backend = ' hatchling.build'
77
88[dependency-groups ]
9+ building = [
10+ ' build' ,
11+ ]
912linting = [
1013 ' pre-commit' ,
1114]
@@ -16,6 +19,9 @@ testing = [
1619 ' pytest-mock' , # provides a `mocker` fixture
1720 ' pytest-xdist' , # paralellizes tests through subprocesses
1821]
22+ upstreaming = [
23+ ' twine' ,
24+ ]
1925
2026[project ]
2127name = ' pre-commit-terraform'
Original file line number Diff line number Diff line change @@ -102,6 +102,64 @@ set_env =
102102wheel_build_env = .pkg
103103
104104
105+ [testenv:cleanup-dists]
106+ description =
107+ Wipe the the dist{/} folder
108+ dependency_groups =
109+ commands_pre =
110+ commands =
111+ {envpython} \
112+ {[python-cli-options]byte-errors} \
113+ {[python-cli-options]max-isolation} \
114+ {[python-cli-options]warnings-to-errors} \
115+ -c \
116+ ' import os, shutil, sys; \
117+ dists_dir = "{toxinidir}{/}dist{/}"; \
118+ shutil.rmtree(dists_dir, ignore_errors=True); \
119+ sys.exit(os.path.exists(dists_dir))'
120+ commands_post =
121+ package = skip
122+
123+
124+ [testenv:build-dists]
125+ description =
126+ Build dists with {basepython} and put them into the dist{/} folder
127+ dependency_groups =
128+ building
129+ depends =
130+ cleanup-dists
131+ commands =
132+ {envpython} \
133+ {[python-cli-options]byte-errors} \
134+ {[python-cli-options]max-isolation} \
135+ {[python-cli-options]warnings-to-errors} \
136+ -m build \
137+ {posargs:}
138+ commands_post =
139+ package = skip
140+
141+
142+ [testenv:metadata-validation]
143+ description =
144+ Verify that dists under the `dist{/}` dir
145+ have valid metadata
146+ dependency_groups =
147+ upstreaming
148+ depends =
149+ build-dists
150+ commands =
151+ {envpython} \
152+ {[python-cli-options]byte-errors} \
153+ {[python-cli-options]max-isolation} \
154+ {[python-cli-options]warnings-to-errors} \
155+ -m twine \
156+ check \
157+ --strict \
158+ dist{/}*
159+ commands_post =
160+ package = skip
161+
162+
105163[testenv:pre-commit]
106164description =
107165 Run the quality checks under {basepython}; run as
You can’t perform that action at this time.
0 commit comments