From caf9af873327eea634ee253ffec3728cb4b04827 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Mon, 26 Jan 2026 09:38:26 -0600 Subject: [PATCH] Remove `noxfile.py` and references to `nox` In addition, an adjacent line referencing pre-commit is removed, since the repo has no `.pre-commit-config.yaml` file. --- .github/copilot-instructions.md | 25 +------ noxfile.py | 117 -------------------------------- pyproject.toml | 1 - 3 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 noxfile.py diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 125812717..4855c5fbf 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -28,7 +28,7 @@ python -m pip install wxpython matplotlib pyopengl python -m pip install pillow h5py imageio requests gitpython pybaselines # For testing and development -python -m pip install pytest nox +python -m pip install pytest ``` ### Run Tests @@ -45,9 +45,6 @@ python -m pytest tests/ -v # Run specific test modules that work offline python -m pytest tests/test_lattice.py tests/test_nistlat.py tests/test_elm.py -v - -# Using nox for testing workflow -python -m nox -s tests ``` ### Validation Scenarios @@ -120,26 +117,6 @@ python -m GSASII ## Development Workflow -### Linting and Code Quality -```bash -# Using nox (recommended) -python -m nox -s lint # Pre-commit hooks and formatting -python -m nox -s pylint # Static code analysis - -# Manual linting -python -m pip install pre-commit -pre-commit run --all-files -``` - -### Documentation -```bash -# Build documentation -python -m nox -s docs - -# Build and serve docs locally -python -m nox -s docs -- --serve -``` - ### Common Development Tasks Always validate changes by running: 1. Build the package: `python -m build -wnx --no-isolation` diff --git a/noxfile.py b/noxfile.py deleted file mode 100644 index 9f81103b3..000000000 --- a/noxfile.py +++ /dev/null @@ -1,117 +0,0 @@ -from __future__ import annotations - -import argparse -import shutil -from pathlib import Path - -import nox - -DIR = Path(__file__).parent.resolve() - -nox.options.sessions = ["lint", "pylint", "tests"] - - -@nox.session -def lint(session: nox.Session) -> None: - """ - Run the linter. - """ - session.install("pre-commit") - session.run( - "pre-commit", "run", "--all-files", "--show-diff-on-failure", *session.posargs - ) - - -@nox.session -def pylint(session: nox.Session) -> None: - """ - Run PyLint. - """ - # This needs to be installed into the package environment, and is slower - # than a pre-commit check - session.install(".", "pylint") - session.run("pylint", "gsas_ii", *session.posargs) - - -@nox.session -def tests(session: nox.Session) -> None: - """ - Run the unit and regular tests. - """ - session.install(".[test]") - session.run("pytest", *session.posargs) - - -@nox.session(reuse_venv=True) -def docs(session: nox.Session) -> None: - """ - Build the docs. Pass "--serve" to serve. 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 [] - - session.install("-e.[docs]", *extra_installs) - session.chdir("docs") - - if args.builder == "linkcheck": - session.run( - "sphinx-build", "-b", "linkcheck", ".", "_build/linkcheck", *posargs - ) - return - - shared_args = ( - "-n", # nitpicky mode - "-T", # full tracebacks - f"-b={args.builder}", - ".", - f"_build/{args.builder}", - *posargs, - ) - - if args.serve: - session.run("sphinx-autobuild", *shared_args) - else: - session.run("sphinx-build", "--keep-going", *shared_args) - - -@nox.session -def build_api_docs(session: nox.Session) -> None: - """ - Build (regenerate) API docs. - """ - - session.install("sphinx") - session.chdir("docs") - session.run( - "sphinx-apidoc", - "-o", - "api/", - "--module-first", - "--no-toc", - "--force", - "../src/gsas_ii", - ) - - -@nox.session -def build(session: nox.Session) -> None: - """ - Build an SDist and wheel. - """ - - build_path = DIR.joinpath("build") - if build_path.exists(): - shutil.rmtree(build_path) - - session.install("build") - session.run("python", "-m", "build") diff --git a/pyproject.toml b/pyproject.toml index ed1fc0d05..e345291c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -194,7 +194,6 @@ unfixable = [ [tool.ruff.lint.per-file-ignores] "tests/**" = ["T20"] -"noxfile.py" = ["T20"] [tool.pylint]