Skip to content

Commit

Permalink
futher cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Nov 17, 2023
1 parent 0101d88 commit 1cf250a
Show file tree
Hide file tree
Showing 22 changed files with 502 additions and 421 deletions.
29 changes: 8 additions & 21 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Nox Test Sessions."""

from __future__ import annotations

import argparse
Expand All @@ -13,9 +15,7 @@

@nox.session
def lint(session: nox.Session) -> None:
"""
Run the linter.
"""
"""Run the linter."""
session.install("pre-commit")
session.run(
"pre-commit", "run", "--all-files", "--show-diff-on-failure", *session.posargs
Expand All @@ -25,9 +25,7 @@ def lint(session: nox.Session) -> None:
# TODO: turn this on eventually
@nox.session
def pylint(session: nox.Session) -> None:
"""
Run PyLint.
"""
"""Run PyLint."""
# This needs to be installed into the package environment, and is slower
# than a pre-commit check
session.install(".", "pylint")
Expand All @@ -36,19 +34,14 @@ def pylint(session: nox.Session) -> None:

@nox.session
def tests(session: nox.Session) -> None:
"""
Run the unit and regular tests.
"""
"""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.
"""

"""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(
Expand Down Expand Up @@ -87,10 +80,7 @@ def docs(session: nox.Session) -> None:

@nox.session
def build_api_docs(session: nox.Session) -> None:
"""
Build (regenerate) API docs.
"""

"""Build (regenerate) API docs."""
session.install("sphinx")
session.chdir("docs")
session.run(
Expand All @@ -106,10 +96,7 @@ def build_api_docs(session: nox.Session) -> None:

@nox.session
def build(session: nox.Session) -> None:
"""
Build an SDist and wheel.
"""

"""Build an SDist and wheel."""
build_path = DIR.joinpath("build")
if build_path.exists():
shutil.rmtree(build_path)
Expand Down
38 changes: 14 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,33 +123,22 @@ disallow_incomplete_defs = true
src = ["src"]

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
]
extend-select = ["ALL"]
ignore = [
"ANN101", # Missing type annotation for self in method
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `**kwargs`
"BLE001", # Using bare `except`
"COM812", # Missing trailing comma
"D107", # Missing docstring in `__init__`
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"ERA001", # Commented-out code
"FIX002", # Line contains TODO
"N8", # Naming conventions
"PD", # Pandas
"PLR", # Design related pylint codes
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
# TODO: fix these and remove
"ARG001", # Unused function argument `X`
"ARG003", # Unused method argument `X`
Expand All @@ -163,7 +152,8 @@ isort.required-imports = ["from __future__ import annotations"]
# typing-modules = ["cats._compat.typing"]

[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
"docs/conf.py" = ["A001", "D100", "INP001"]
"tests/**" = ["ANN", "D1", "INP", "S101", "T20"]
"noxfile.py" = ["T20"]
"__init__.py" = ["F403"]
# TODO: fix these and remove
Expand Down
3 changes: 1 addition & 2 deletions src/cats/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Copyright (c) 2023 CATS. All rights reserved.
"""Copyright (c) 2023 CATS. All rights reserved.
cats: Community Atlas of Tidal Streams
"""
Expand Down
2 changes: 0 additions & 2 deletions src/cats/_version.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from __future__ import annotations

version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]
Loading

0 comments on commit 1cf250a

Please sign in to comment.