diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt index e54ddf0..ef51d6e 100644 --- a/.github/workflows/constraints.txt +++ b/.github/workflows/constraints.txt @@ -1,5 +1,5 @@ -pip==23.0 -nox==2022.11.21 -nox-poetry==1.0.2 -poetry==1.2.2 -virtualenv==20.19.0 +pip==23.2.1 +nox==2023.4.22 +nox-poetry==1.0.3 +poetry==1.7.1 +virtualenv==20.16.6 diff --git a/noxfile.py b/noxfile.py index 77dc15f..85586d0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,11 +22,11 @@ package = "ncdump_rich" python_versions = ["3.11", "3.10", "3.9"] -nox.needs_version = ">= 2021.6.6" +nox.needs_version = ">= 2023.4.22" nox.options.sessions = ( "pre-commit", "mypy", - "black", + "ruff", "tests", "typeguard", "xdoctest", @@ -45,11 +45,11 @@ def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> Non Parameters ---------- - session: Session + session : Session The Session object. - args: str + *args : str Command-line arguments for pip. - kwargs: Any + **kwargs : Any Additional keyword arguments for Session.install. """ with tempfile.NamedTemporaryFile() as requirements: @@ -76,7 +76,8 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None: Parameters ---------- - session: The Session object. + session : Session + The Session object. """ if session.bin is None: return @@ -124,17 +125,13 @@ def precommit(session: Session) -> None: """Lint using pre-commit.""" args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"] session.install( - "black", - "darglint", - "flake8", - "flake8-bandit", - "flake8-bugbear", - "flake8-docstrings", - "flake8-rst-docstrings", - "pep8-naming", + "ruff", + "pydoclint", + "mypy", + "pytest", "pre-commit", "pre-commit-hooks", - "reorder-python-imports", + "xdoctest", ) session.run("pre-commit", *args) if args and args[0] == "install": @@ -153,11 +150,11 @@ def mypy(session: Session) -> None: @session(python=python_versions) -def black(session: Session) -> None: - """Format using black.""" +def ruff(session: Session) -> None: + """Format using ruff.""" args = session.posargs or ["src", "tests", "docs/conf.py"] - session.install("black") - session.run("black", *args) + session.install("ruff") + session.run("ruff", *args) @session(python=python_versions) diff --git a/pyproject.toml b/pyproject.toml index 1179700..59dfb5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,6 @@ pretty = true show_column_numbers = true show_error_codes = true show_error_context = true -strict = true strict_equality = true strict_optional = true warn_no_return = true @@ -180,11 +179,10 @@ docstring-quotes = "double" numpy = "np" scipy = "sp" xarray = "xr" -paper1_code = "core" [tool.ruff.isort] case-sensitive = true -known-local-folder = ["src", "paper1_code"] +known-local-folder = ["src", "ncdump_rich"] [tool.isort] multi_line_output = 3 diff --git a/tests/test_main.py b/tests/test_main.py index e82cd2c..1419220 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -2,6 +2,7 @@ import netCDF4 import pytest from click.testing import CliRunner + from ncdump_rich import __main__