Skip to content

Commit 6a4c947

Browse files
committed
handle case where file does not exist
1 parent bf86c61 commit 6a4c947

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

noxfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,10 @@ def prepare_python_release(session: Session) -> Callable[[bool], None]:
357357
"PYPI_USERNAME and PYPI_PASSWORD environment variables must be set"
358358
)
359359

360-
rmtree("build")
361-
rmtree("dist")
360+
for build_dir_name in ["build", "dist"]:
361+
build_dir_path = Path.cwd() / build_dir_name
362+
if build_dir_path.exists():
363+
rmtree(str(build_dir_path))
362364

363365
install_requirements_file(session, "build-pkg")
364366
session.run("python", "-m", "build", "--sdist", "--wheel", "--outdir", "dist", ".")

0 commit comments

Comments
 (0)