From 289383fdc7da202c4eef1bf3403ab8fc68535f80 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 5 Apr 2024 13:40:36 -0400 Subject: [PATCH] chore: some cleanup from uv branch (#686) Pulling out a bit of cleanup, especially the better minimums. --------- Signed-off-by: Henry Schreiner --- noxfile.py | 22 ++++++---------------- pyproject.toml | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/noxfile.py b/noxfile.py index c41d677e..57e0f7a0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -120,30 +120,20 @@ def minimums(session: nox.Session) -> None: @nox.session(reuse_venv=True) def docs(session: nox.Session) -> None: """ - Build the docs. Pass "--serve" to serve. Pass "-b linkcheck" to check links. + Build the docs. Use "--non-interactive" to avoid serving. Pass "-b linkcheck" to check links. """ parser = argparse.ArgumentParser() - parser.add_argument("--serve", action="store_true", help="Serve after building") parser.add_argument( "-b", dest="builder", default="html", help="Build target (default: html)" ) args, posargs = parser.parse_known_args(session.posargs) - if args.builder != "html" and args.serve: - session.error("Must not specify non-HTML builder with --serve") - - extra_installs = ["sphinx-autobuild"] if args.serve else [] - + serve = args.builder == "html" and session.interactive + extra_installs = ["sphinx-autobuild"] if serve else [] session.install("-e.[docs,pyproject]", *extra_installs) - session.run("pip", "list") - session.chdir("docs") - if args.builder == "linkcheck": - session.run( - "sphinx-build", "-b", "linkcheck", ".", "_build/linkcheck", *posargs - ) - return + session.chdir("docs") shared_args = ( "-n", # nitpicky mode @@ -154,8 +144,8 @@ def docs(session: nox.Session) -> None: *posargs, ) - if args.serve: - session.run("sphinx-autobuild", *shared_args) + if serve: + session.run("sphinx-autobuild", "--open-browser", *shared_args) else: session.run("sphinx-build", "--keep-going", *shared_args) diff --git a/pyproject.toml b/pyproject.toml index 1983be78..e3185097 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,8 +33,8 @@ classifiers = [ dynamic = ["version"] dependencies = [ - "exceptiongroup; python_version<'3.11'", - "importlib-metadata; python_version<'3.8'", + "exceptiongroup >=1.0; python_version<'3.11'", + "importlib-metadata >=1.0; python_version<'3.8'", "importlib-resources >=1.3; python_version<'3.9'", "packaging >=20.9", "tomli >=1.1; python_version<'3.11'", @@ -50,17 +50,20 @@ pyproject = [ "pyproject-metadata >=0.5", ] test = [ - "build[virtualenv]", + "build >=0.8", "cattrs >=22.2.0", "pathspec >=0.10.1", - "pip", - "pybind11", + "pip >=22", + "pybind11 >=2.12", "pyproject-metadata >=0.5", "pytest >=7.0", # 7.2+ recommended for better tracebacks with ExceptionGroup "pytest-subprocess >=1.5", - "setuptools", - "virtualenv", - "wheel", + 'setuptools >=43; python_version<"3.9"', + 'setuptools >=45; python_version=="3.9"', + 'setuptools >=49; python_version>="3.10" and python_version<"3.12"', + 'setuptools >=66.1; python_version>="3.12"', + "virtualenv >=20.0.28", + "wheel >=0.40", ] test-meta = [ "hatch-fancy-pypi-readme>=22.3", @@ -91,7 +94,8 @@ docs = [ "myst-parser >=0.13", "pathspec >=0.10.1", "pyproject-metadata >=0.5", - "sphinx >=7.0,<=7.1.2", # workaround bug in setuptools, fix in pypa/setuptools#4023 + "setuptools", + "sphinx", "sphinx-copybutton", "sphinx-inline-tabs", "sphinx-jsonschema",