diff --git a/.cruft.json b/.cruft.json index 82367da..2040691 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "4ca8e60aac805d5f736de80c45ae0aba96b4cb85", + "commit": "51fb616094a4d7577c8898445aa50effb89afa31", "checkout": null, "context": { "cookiecutter": { @@ -16,7 +16,7 @@ "enable_dynamic_dev_versions": "y", "include_example_code": "n", "include_cruft_update_github_workflow": "y", - "use_extended_ruff_linting": "y", + "use_extended_ruff_linting": "n", "_sphinx_theme": "sunpy", "_parent_project": "", "_install_requires": "", diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87f5566..24a9a61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,41 +1,30 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.1" + rev: "v0.7.2" hooks: - id: ruff args: ["--fix"] - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 hooks: - - id: autoflake - args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] - exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$" - - repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black - exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort - exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: check-ast - - id: check-case-conflict - - id: trailing-whitespace - exclude: ".*(.fits|.fts|.fit|.header|.txt)$" - - id: check-yaml - - id: debug-statements - - id: check-added-large-files - args: [ "--enforce-all", "--maxkb=1054" ] - - id: end-of-file-fixer - exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$" - - id: mixed-line-ending - exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" + - id: isort + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$" + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: trailing-whitespace + exclude: ".*(.fits|.fts|.fit|.header|.txt)$" + - id: check-yaml + - id: debug-statements + - id: check-added-large-files + args: ["--enforce-all", "--maxkb=1054"] + - id: end-of-file-fixer + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$" + - id: mixed-line-ending + exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: diff --git a/.ruff.toml b/.ruff.toml index 17e4216..666d3b3 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -14,41 +14,28 @@ select = [ "W", "UP", "PT", - "BLE", - "A", - "C4", - "INP", - "PIE", - "T20", - "RET", - "TID", - "PTH", - "PD", - "PLC", - "PLE", - "FLY", - "NPY", - "PERF", - "RUF", ] extend-ignore = [ - # pycodestyle (E, W) + # pycodestyle "E501", # ignore line length will use a formatter instead - # pyupgrade (UP) + "E712", # Avoid equality comparisons to True; use if {cond}: for truth checks + "E721", # type comparison Use is and is not for type comparisons, or isinstance() for isinstance checks + # upgrades "UP038", # Use | in isinstance - not compatible with models and is slower # pytest (PT) "PT001", # Always use pytest.fixture() "PT004", # Fixtures which don't return anything should have leading _ + "PT011", # except(ValueRaises) is too broad "PT023", # Always use () on pytest decorators - # flake8-pie (PIE) + # flake8-pie "PIE808", # Disallow passing 0 as the first argument to range - # flake8-use-pathlib (PTH) + # flake8-use-pathlib "PTH123", # open() should be replaced by Path.open() - # Ruff (RUF) + # Ruff "RUF003", # Ignore ambiguous quote marks, doesn't allow ' in comments - "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` - "RUF013", # PEP 484 prohibits implicit `Optional` - "RUF015", # Prefer `next(iter(...))` over single element slice + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` + "RUF013", # PEP 484 prohibits implicit `Optional` + "RUF015", # Prefer `next(iter(...))` over single element slice ] [lint.per-file-ignores] diff --git a/pyproject.toml b/pyproject.toml index d2ee7cc..3a3f089 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,11 +39,10 @@ docs = [ "sphinx-automodapi", "sunpy-sphinx-theme", "packaging", - "sphinx_automodapi", "sphinx-changelog", "sphinx-gallery", - "sunpy-sphinx-theme" ] + [project.urls] repository = "https://sunpy.org" diff --git a/sunraster/_dev/scm_version.py b/sunraster/_dev/scm_version.py index d0c4c1f..77e3cb1 100644 --- a/sunraster/_dev/scm_version.py +++ b/sunraster/_dev/scm_version.py @@ -5,7 +5,7 @@ try: from setuptools_scm import get_version - version = get_version(root=Path("../.."), relative_to=__file__) + version = get_version(root=Path('../..'), relative_to=__file__) except ImportError: raise except Exception as e: