From 917cb8ffbd28f0696aca0bd9cee699427de02bbd Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Fri, 15 Dec 2023 15:39:52 -0700 Subject: [PATCH] Remove setuptools files (#59) * Move zest.releaser config to pyproject.toml * Move coverage config to pyproject.toml * Use ruff instead of flake8 * Update deprecated pytest setting * Use pyproject.toml for coverage configuration --- CONTRIBUTING.md | 4 ++-- environment.yml | 2 +- noxfile.py | 4 ++-- pyproject.toml | 19 +++++++++++++++++-- setup.cfg | 14 -------------- setup.py | 6 ------ 6 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7bbe86e..69b655c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,14 +81,14 @@ development. Now you can make your changes locally. 5. When you're done making changes, check that your changes pass - flake8 and the tests: + ruff and the tests: ``` {.shell} $ make lint $ make test ``` - Both flake8 and pytest are included in the environment. + Both ruff and pytest are included in the environment. 6. Commit your changes and push your branch to GitHub: diff --git a/environment.yml b/environment.yml index a52f7a2..098811c 100644 --- a/environment.yml +++ b/environment.yml @@ -13,7 +13,7 @@ dependencies: - rioxarray - bmipy - black - - flake8 + - ruff - isort - nox - pytest diff --git a/noxfile.py b/noxfile.py index d654af5..f8b1593 100644 --- a/noxfile.py +++ b/noxfile.py @@ -26,7 +26,7 @@ def test(session: nox.Session) -> None: if "CI" in os.environ: args.append(f"--cov-report=xml:{ROOT.absolute()!s}/coverage.xml") - args.append(f"--cov-config={ROOT.absolute()!s}/setup.cfg") + args.append(f"--cov-config={ROOT.absolute()!s}/pyproject.toml") session.run("pytest", *args) if "CI" not in os.environ: @@ -69,7 +69,7 @@ def format(session: nox.Session) -> None: session.run("black", *black_args, *PATHS) session.run("isort", *PATHS) - session.run("flake8", *PATHS) + session.run("ruff", *PATHS) @nox.session(name="prepare-docs") diff --git a/pyproject.toml b/pyproject.toml index 5de50f3..79b920a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ Changelog = "https://github.com/csdms/bmi-topography/blob/main/CHANGES.md" [project.optional-dependencies] dev = [ "black", - "flake8", + "ruff", "isort", "nox", ] @@ -96,7 +96,7 @@ norecursedirs = [".*", "*.egg*", "build", "dist"] addopts = """ --ignore setup.py --tb native - --strict + --strict-markers --durations 16 --doctest-modules -vvv @@ -113,3 +113,18 @@ include_trailing_comma = true force_grid_wrap = 0 combine_as_imports = true line_length = 88 + +[tool.ruff] +exclude = ["docs"] +line-length = 88 +ignore = [ + "E203", + "E501", +] + +[tool.coverage.run] +relative_files = true + +[tool.zest-releaser] +tag-format = "v{version}" +python-file-with-version = "bmi_topography/_version.py" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d7343cd..0000000 --- a/setup.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[coverage:run] -relative_files = True - -[flake8] -exclude = docs -ignore = - E203 - E501 - W503 -max-line-length = 88 - -[zest.releaser] -tag-format = v{version} -python-file-with-version = bmi_topography/_version.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 19a7711..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -from setuptools import setup - - -setup( - name="bmi-topography", # for GitHub dependency graph -)