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 = [
6
6
build-backend = ' hatchling.build'
7
7
8
8
[dependency-groups ]
9
+ building = [
10
+ ' build' ,
11
+ ]
9
12
linting = [
10
13
' pre-commit' ,
11
14
]
@@ -16,6 +19,9 @@ testing = [
16
19
' pytest-mock' , # provides a `mocker` fixture
17
20
' pytest-xdist' , # paralellizes tests through subprocesses
18
21
]
22
+ upstreaming = [
23
+ ' twine' ,
24
+ ]
19
25
20
26
[project ]
21
27
name = ' pre-commit-terraform'
Original file line number Diff line number Diff line change @@ -102,6 +102,64 @@ set_env =
102
102
wheel_build_env = .pkg
103
103
104
104
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
+
105
163
[testenv:pre-commit]
106
164
description =
107
165
Run the quality checks under {basepython}; run as
You can’t perform that action at this time.
0 commit comments