Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c6f9d02
Align pyproject.toml with one in SciTools/.github/templates.
pp-mo Oct 28, 2026
755f20e
Align .pre-commit-config.yaml with SciTools/.github/templates, and au…
pp-mo Oct 28, 2026
d0ae1f0
Add project-specific ruff excludes.
pp-mo Oct 29, 2026
40346bf
More ruff excludes.
pp-mo Oct 29, 2026
3cd1e22
Correct various overlength lines.
pp-mo Oct 29, 2026
5c4a78a
Reconfigure to enforce docstring summaries on the _second_ line, i.e.…
pp-mo Oct 29, 2026
b6aa0d7
Fix docstring indent at split.
pp-mo Oct 29, 2026
2a91750
Don't provide overlength parts of docstring separately, as it doesn't…
pp-mo Oct 29, 2026
bdbc09a
Add licence headers to all sourcefiles.
pp-mo Oct 29, 2026
14e8ba7
Recognise custom licence-header.
pp-mo Oct 29, 2026
a3659b9
Allow print anywhere.
pp-mo Oct 30, 2026
9f7416d
Don't lint conf.py at all.
pp-mo Oct 30, 2026
ba6017c
Configure ruff isort to control automatic import sorting.
pp-mo Oct 30, 2026
3c9b7ff
Avoid some sorting operations.
pp-mo Oct 30, 2026
46cfa7e
Ruff-check autofixes: modernise type hints; remove dead noqa's; impor…
pp-mo Oct 30, 2026
86daa1f
Ruff-format (i.e. 'black'-like) format simplifications.
pp-mo Nov 2, 2026
ee4553b
More Ruff controls.
pp-mo Nov 2, 2026
6c8a324
Multiple changes from ruff check, fix(including unsafe) and format, m…
pp-mo Nov 2, 2026
9024cc1
Fixes for various Ruff checks.
pp-mo Nov 2, 2026
e149c08
Use common paths for ncdump/ncgen and avoid shell=True.
pp-mo Nov 2, 2026
c8dd853
Changes to address various ruff warnings.
pp-mo Nov 5, 2026
bda914c
Control numpydoc-validation; temporarily disable repo-review; Trial a…
pp-mo Nov 5, 2026
4f349f5
Exclude test sources from MyPy: must be in '.pre-commit-config.yaml' …
pp-mo Nov 5, 2026
b4a849e
Fix or exclude repo-review warnings.
pp-mo Nov 5, 2026
d2279fd
tidy pyproject.toml
pp-mo Nov 6, 2026
29e9e9d
Apply pre-commit to .github and automation files.
pp-mo Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ updates:
labels:
- "new: pull request"
- "bot"
groups:
github-actions:
patterns:
- "*"
4 changes: 4 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
- "*"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: "Test session=${{ matrix.session }} Python=${{ matrix.python-version }}"
Expand Down
113 changes: 89 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# See https://pre-commit.ci/#configuration
# See https://github.com/scientific-python/cookie#sp-repo-review

ci:
autofix_prs: false
autofix_commit_msg: "style: pre-commit fixes"
autoupdate_commit_msg: "chore: update pre-commit hooks"
autoupdate_schedule: "monthly"


# Alphabetised, for lack of a better order.
files: |
(?x)(
docs\/.+\.py|
lib\/.+\.py|
tests\/.+\.py
\.github/\.*|
pyproject\.toml|
\.pre-commit-config\.yaml|
\./.*\.py|
tests/.+\.py
)

exclude: |
docs/conf.py # sufficiently different that linting is unhelpful

minimum_pre_commit_version: 1.21.0

repos:
Expand All @@ -17,50 +33,99 @@ repos:
- id: check-added-large-files
# Check whether files parse as valid Python.
- id: check-ast
# Check for file name conflicts on case-insensitive filesytems.
# Check for file name conflicts on case-insensitive filesystems.
- id: check-case-conflict
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Check for debugger imports and py37+ `breakpoint()` calls in Python source.
- id: debug-statements
# Check TOML file syntax.
- id: check-toml
# Check YAML file syntax.
- id: check-yaml
# Makes sure files end in a newline and only a newline.
# Duplicates Ruff W292 but also works on non-Python files.
- id: end-of-file-fixer
# Replaces or checks mixed line ending.
- id: mixed-line-ending
# Don't commit to main branch.
- id: no-commit-to-branch
# Trims trailing whitespace.
# Duplicates Ruff W291 but also works on non-Python files.
- id: trailing-whitespace

# Hooks from all other repos
# In terms of ordering: hooks that modify files should be placed before hooks that do not.

- repo: https://github.com/adamchainz/blacken-docs
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: 1.20.0
hooks:
- id: blacken-docs
types: [file, rst]

- repo: https://github.com/astral-sh/ruff-pre-commit
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: "v0.17.3"
hooks:
- id: ruff-check
types: [file, python]
args: [--fix, --show-fixes]
- id: ruff-format
types: [file, python]

- repo: https://github.com/aio-libs/sort-all
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: v1.3.0
hooks:
- id: sort-all
types: [file, python]

- repo: https://github.com/codespell-project/codespell
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: "v2.4.3"
hooks:
- id: codespell
types_or: [asciidoc, python, markdown, rst]
additional_dependencies: [tomli]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.10.1
- repo: https://github.com/pre-commit/mirrors-mypy
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: 'v2.4.0'
hooks:
- id: black
pass_filenames: false
args: [--config=./pyproject.toml, .]
- id: mypy
exclude: 'noxfile\.py|docs/conf\.py|^tests/' # NB controlling this in pyproject.toml DOES NOT WORK, as MyPy doesn't apply excludes to a passed list of (changed) files

- repo: https://github.com/PyCQA/flake8
rev: 7.4.1
- repo: https://github.com/numpy/numpydoc
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: v1.11.0
hooks:
- id: flake8
- id: numpydoc-validation
types: [file, python]

- repo: https://github.com/pycqa/isort
rev: 9.0.2
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: isort
name: isort (python)
- id: rst-backticks
types: [rst]

- repo: https://github.com/asottile/blacken-docs
rev: 1.20.0
- repo: https://github.com/scientific-python/cookie
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: 2026.08.14
hooks:
- id: blacken-docs
types: [file, rst]
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
args: ["--show=errskip"]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
- repo: https://github.com/abravalheri/validate-pyproject
# More exhaustive than Ruff RUF200.
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: "v0.27"
hooks:
- id: pydocstyle
args: [--convention=numpy]
- id: validate-pyproject

- repo: https://github.com/zizmorcore/zizmor-pre-commit
# This template does not keep up-to-date with versions, visit the repo to see the most recent release.
rev: v1.31.1
hooks:
- id: zizmor
15 changes: 10 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# noqa
# Configuration file for the Sphinx documentation builder.
# Copyright SciTools contributors
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# This file is part of SciTools/ncdata and is released under the BSD license.
# See LICENSE in the root of the repository for full licensing details.
"""
Configuration file for the Sphinx documentation builder.

This file only contains a selection of the most common options. For a full
list see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""

# -- Path setup --------------------------------------------------------------

Expand Down
7 changes: 6 additions & 1 deletion lib/ncdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright SciTools contributors
#
# This file is part of SciTools/ncdata and is released under the BSD license.
# See LICENSE in the root of the repository for full licensing details.
"""
An abstract representation of Netcdf data with groups, variables + attributes.

Expand All @@ -14,7 +18,8 @@
from ._core import NameMap, NcAttribute, NcData, NcDimension, NcVariable
from ._version import __version__

__all__ = [
# N.B. avoiding sorting this, the order is convenient for understanding.
__all__ = [ # noqa: RUF022
"NcData",
"NcDimension",
"NcVariable",
Expand Down
Loading