Enable PTH in ruff
This commit is contained in:
parent
0cb924b3b6
commit
9cc21f5b69
2 changed files with 6 additions and 2 deletions
|
|
@ -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()`)
|
# Where to keep temporary files (e.g., the constraints file in `install_pinned()`)
|
||||||
tempfile.tempdir = ".cache/tmp"
|
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)
|
@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
|
# Verify that all external links return 200 OK
|
||||||
session.run("sphinx-build", "-b", "linkcheck", DOCS_LOCATION, DOCS_BUILD)
|
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")
|
@nox.session(name="venv", python=MAIN_PYTHON, venv_backend="none")
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,8 @@ select = [
|
||||||
# ========================================
|
# ========================================
|
||||||
# `ruff` only (no working `flake8` plugin)
|
# `ruff` only (no working `flake8` plugin)
|
||||||
# ========================================
|
# ========================================
|
||||||
|
# flake8-use-pathlib => `pathlib` instead of `os` functions
|
||||||
|
# "PTH",
|
||||||
# pyupgrade => Modern syntax for the targeted Python version
|
# pyupgrade => Modern syntax for the targeted Python version
|
||||||
# "UP",
|
# "UP",
|
||||||
]
|
]
|
||||||
|
|
@ -513,6 +515,8 @@ select = [
|
||||||
"ICN",
|
"ICN",
|
||||||
# Pylint's refactoring rules => simpler and smaller functions
|
# Pylint's refactoring rules => simpler and smaller functions
|
||||||
"PLR",
|
"PLR",
|
||||||
|
# flake8-use-pathlib => `pathlib` instead of `os` functions
|
||||||
|
"PTH",
|
||||||
# flake8-print => no `print()`
|
# flake8-print => no `print()`
|
||||||
"T20",
|
"T20",
|
||||||
# pyupgrade => Modern syntax for the targeted Python version
|
# pyupgrade => Modern syntax for the targeted Python version
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue