diff --git a/noxfile.py b/noxfile.py index 3301b03..9d28d90 100644 --- a/noxfile.py +++ b/noxfile.py @@ -135,7 +135,7 @@ os.environ.setdefault("UV_PYTHON_PREFERENCE", "only-managed") # Where to keep temporary files (e.g., the constraints file in `install_pinned()`) tempfile.tempdir = ".cache/tmp" -os.makedirs(tempfile.tempdir, exist_ok=True) +pathlib.Path(tempfile.tempdir).mkdir(parents=True, exist_ok=True) @nox.session(name="format", python=MAIN_PYTHON) @@ -318,7 +318,7 @@ def build_docs(session: nox.Session) -> None: # Verify that all external links return 200 OK session.run("sphinx-build", "-b", "linkcheck", DOCS_LOCATION, DOCS_BUILD) - session.log(f"Docs are available at {os.getcwd()}/{DOCS_BUILD}index.html") + session.log(f"Docs are available at {pathlib.Path.cwd()}/{DOCS_BUILD}index.html") @nox.session(name="venv", python=MAIN_PYTHON, venv_backend="none") diff --git a/pyproject.toml b/pyproject.toml index 638927f..f033c44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -243,6 +243,8 @@ select = [ # ======================================== # `ruff` only (no working `flake8` plugin) # ======================================== + # flake8-use-pathlib => `pathlib` instead of `os` functions + # "PTH", # pyupgrade => Modern syntax for the targeted Python version # "UP", ] @@ -513,6 +515,8 @@ select = [ "ICN", # Pylint's refactoring rules => simpler and smaller functions "PLR", + # flake8-use-pathlib => `pathlib` instead of `os` functions + "PTH", # flake8-print => no `print()` "T20", # pyupgrade => Modern syntax for the targeted Python version