Skip to content

Commit bd3a10e

Browse files
committed
install twine for publishing sessions
1 parent 76c31ae commit bd3a10e

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

noxfile.py

+20-6
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def release(session):
157157
@nox.session(name="publish-testpypi")
158158
def publish_testpypi(session):
159159
"""Publish wheelhouse/* to TestPyPI."""
160+
session.install("twine")
160161
session.run("twine", "check", "build/wheelhouse/*")
161162
session.run(
162163
"twine",
@@ -171,6 +172,7 @@ def publish_testpypi(session):
171172
@nox.session(name="publish-pypi")
172173
def publish_pypi(session):
173174
"""Publish wheelhouse/* to PyPI."""
175+
session.install("twine")
174176
session.run("twine", "check", "build/wheelhouse/*")
175177
session.run(
176178
"twine",
@@ -183,15 +185,27 @@ def publish_pypi(session):
183185
@nox.session(python=False)
184186
def clean(session):
185187
"""Remove all .venv's, build files and caches in the directory."""
188+
root_folders = (
189+
[
190+
"barrier3d.egg-info",
191+
".pytest_cache",
192+
".venv",
193+
"build",
194+
"build/wheelhouse",
195+
]
196+
if not session.posargs
197+
else []
198+
)
199+
200+
with session.chdir(ROOT):
201+
for folder in root_folders:
202+
session.log(f"rm -r {folder}")
203+
shutil.rmtree(folder, ignore_errors=True)
204+
186205
for folder in _args_to_folders(session.posargs):
187206
with session.chdir(folder):
188-
shutil.rmtree("build", ignore_errors=True)
189-
shutil.rmtree("build/wheelhouse", ignore_errors=True)
190-
shutil.rmtree(f"{PROJECT}.egg-info", ignore_errors=True)
191-
shutil.rmtree(".pytest_cache", ignore_errors=True)
192-
shutil.rmtree(".venv", ignore_errors=True)
193-
194207
for pattern in ["*.py[co]", "__pycache__"]:
208+
session.log(f"rm {pattern}")
195209
_clean_rglob(pattern)
196210

197211

0 commit comments

Comments
 (0)