diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6780251a..cf504a8d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,7 +20,7 @@ updates: default-days: 7 - package-ecosystem: pip - directory: /CI + directory: /.github schedule: interval: daily time: '12:00' diff --git a/CI/requirements_ci.in b/.github/requirements_ci.in similarity index 100% rename from CI/requirements_ci.in rename to .github/requirements_ci.in diff --git a/CI/requirements_ci.txt b/.github/requirements_ci.txt similarity index 99% rename from CI/requirements_ci.txt rename to .github/requirements_ci.txt index ec39890d..b6c938ab 100644 --- a/CI/requirements_ci.txt +++ b/.github/requirements_ci.txt @@ -31,7 +31,10 @@ cachetools==7.0.4 \ certifi==2024.7.4 \ --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 - # via requests + # via + # httpcore + # httpx + # requests charset-normalizer==3.3.2 \ --hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \ --hash=sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087 \ @@ -598,12 +601,7 @@ tomli==2.4.1 \ --hash=sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf \ --hash=sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9 \ --hash=sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049 - # via - # -r requirements_ci.in - # deptry - # pylint - # pyproject-api - # tox + # via requests tomli-w==1.2.0 \ --hash=sha256:188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90 \ --hash=sha256:2dd14fac5a47c27be9cd4c976af5a12d87fb1f0b4512f81d69cce3b35ae25021 diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 677e730c..d43e2a5a 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -14,14 +14,14 @@ on: - .cruft.json - .editorconfig - .github/**.yml + - .github/*.in + - .github/*.txt - .gitignore - .pre-commit-config.yaml - .yamllint.yaml - .zenodo.json - AUTHORS.rst - CHANGELOG.rst - - CI/**/*.in - - CI/**/*.txt - CITATION.cff - CODE_OF_CONDUCT.md - CONTRIBUTING.rst @@ -45,7 +45,6 @@ jobs: runs-on: ubuntu-latest environment: automation permissions: - actions: read contents: write strategy: matrix: @@ -76,7 +75,7 @@ jobs: git config --local user.name "bumpversion[bot]" - name: Install CI libraries run: | - python -m pip install --require-hashes -r CI/requirements_ci.txt + python -m pip install --require-hashes -r .github/requirements_ci.txt - name: Conditional Bump Version run: | CURRENT_VERSION=$(bump-my-version show current_version) diff --git a/.github/workflows/first-pull-request.yml b/.github/workflows/first-pull-request.yml index 84e699f4..201df90e 100644 --- a/.github/workflows/first-pull-request.yml +++ b/.github/workflows/first-pull-request.yml @@ -57,6 +57,5 @@ jobs: we ask that you add your information to the \`AUTHORS.rst\` and \`.zenodo.json\`: - [ ] The relevant author information has been added to \`AUTHORS.rst\` and \`.zenodo.json\` - Please make sure you've read our [contributing guide](CONTRIBUTING.rst). - We look forward to reviewing your Pull Request shortly ✨` + Please make sure you've read our [contributing guide](https://github.com/glamod/cdm_reader_mapper/blob/main/CONTRIBUTING.rst). We look forward to reviewing your Pull Request shortly ✨` }) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index bc288a2e..53a5df29 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -41,7 +41,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install packaging libraries run: | - python -m pip install -r CI/requirements_ci.txt + python -m pip install -r .github/requirements_ci.txt - name: Build a binary wheel and a source tarball run: | python -m flit build diff --git a/.github/workflows/tag-testpypi.yml b/.github/workflows/tag-testpypi.yml index d10af39b..07d46437 100644 --- a/.github/workflows/tag-testpypi.yml +++ b/.github/workflows/tag-testpypi.yml @@ -74,7 +74,7 @@ jobs: - name: Install CI libraries run: | - python -m pip install --require-hashes -r CI/requirements_ci.txt + python -m pip install --require-hashes -r .github/requirements_ci.txt - name: Build a binary wheel and a source tarball run: | python -m flit build diff --git a/.github/workflows/testing-suite.yml b/.github/workflows/testing-suite.yml index e280979e..6da8fc31 100644 --- a/.github/workflows/testing-suite.yml +++ b/.github/workflows/testing-suite.yml @@ -39,7 +39,7 @@ jobs: cache: pip - name: Install CI libraries run: | - python -m pip install --require-hashes -r CI/requirements_ci.txt + python -m pip install --require-hashes -r .github/requirements_ci.txt - name: Environment Caching uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: diff --git a/.github/workflows/workflow-warning.yml b/.github/workflows/workflow-warning.yml index 4b5d10e6..35c5669a 100644 --- a/.github/workflows/workflow-warning.yml +++ b/.github/workflows/workflow-warning.yml @@ -15,12 +15,16 @@ on: permissions: contents: read +concurrency: + group: workflow-warning-${{ github.event.pull_request.number }} + cancel-in-progress: true + + jobs: comment-concerning-workflow-changes: name: Comment Concerning Workflow Changes runs-on: ubuntu-latest - if: | - (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) + if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name permissions: contents: read pull-requests: write @@ -33,60 +37,58 @@ jobs: allowed-endpoints: > api.github.com:443 - - name: Manage Warning / Note Comments + - name: Create or Update Warning Comment env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - APPROVED: ${{ contains(github.event.pull_request.labels.*.name, 'approved') }} - PR_NUMBER: ${{ github.event.pull_request.number }} REPO: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | - WARNING_TEXT="This Pull Request modifies GitHub workflows and is coming from a fork." - NOTE_TEXT="Workflow changes in this Pull Request have been approved!" + set -euo pipefail - # Fetch existing comments - COMMENTS=$(gh api repos/$REPO/issues/$PR_NUMBER/comments) + MARKER="" - # Find warning comment ID - WARNING_COMMENT_ID=$(echo "$COMMENTS" | jq -r \ - '.[] | select(.user.login=="github-actions[bot]") | select(.body | contains("'"$WARNING_TEXT"'")) | .id' | head -n 1) + BODY=$(cat < [!WARNING] + > This pull request modifies GitHub Actions workflows and originates from a fork. + > + > Review the workflow changes carefully before approving or merging. + EOF + ) - if [ "$APPROVED" = "true" ]; then - BODY="> [!NOTE] - > Workflow changes in this Pull Request have been approved!" + COMMENTS=$(gh api repos/$REPO/issues/$PR_NUMBER/comments) - if [ -n "$NOTE_COMMENT_ID" ] && [ "$NOTE_COMMENT_ID" != "null" ]; then - # Append to existing note comment - EXISTING=$(gh api repos/$REPO/issues/comments/$NOTE_COMMENT_ID --jq .body) - gh api \ - --method PATCH \ - repos/$REPO/issues/comments/$NOTE_COMMENT_ID \ - -f body="$EXISTING + mapfile -t IDS < <( + echo "$COMMENTS" | + jq -r ' + .[] + | select(.body | contains("")) + | .id + ' + ) + + COMMENT_ID="" - $BODY" - else - # Create new note comment - gh pr comment "$PR_NUMBER" --body "$BODY" - fi + if [ "${#IDS[@]}" -gt 0 ]; then + COMMENT_ID="${IDS[0]}" - # Add reaction (hooray) - if [ -n "$NOTE_COMMENT_ID" ] && [ "$NOTE_COMMENT_ID" != "null" ]; then + # Remove duplicate managed comments if they exist. + for id in "${IDS[@]:1}"; do gh api \ - --method POST \ - repos/$REPO/issues/comments/$NOTE_COMMENT_ID/reactions \ - -f content='hooray' \ - -H "Accept: application/vnd.github+json" - fi + --method DELETE \ + repos/$REPO/issues/comments/$id + done + fi + if [ -n "$COMMENT_ID" ]; then + gh api \ + --method PATCH \ + repos/$REPO/issues/comments/$COMMENT_ID \ + -f body="$BODY" else - BODY="> [!WARNING] - > This Pull Request modifies GitHub Workflows and is coming from a fork. - **It is very important for the reviewer to ensure that the workflow changes are appropriate.**" - - if [ -z "$WARNING_COMMENT_ID" ] || [ "$WARNING_COMMENT_ID" = "null" ]; then - gh pr comment "$PR_NUMBER" --body "$BODY" - fi - fi + gh api \ + --method POST \ + repos/$REPO/issues/$PR_NUMBER/comments \ + -f body="$BODY" + fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4f578b5..e9ea3c7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,7 +85,7 @@ repos: - id: check-github-workflows - id: check-readthedocs - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.23.1 + rev: v1.24.1 hooks: - id: zizmor args: [ '--config=.zizmor.yml' ] diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..7d08de51 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,62 @@ +# Agents + +Rules for AI coding agents working in this repository. + +## General + +- Follow existing code conventions and patterns +- Do not modify files outside the scope of the current task +- Prefer editing existing files over creating new ones +- Do not add dependencies without explicit approval +- Keep changes atomic -- one concern per commit +- Ask for clarification when requirements are ambiguous +- Do not generate PR descriptions or review comments on others' code + +## Code Style + +- Follow the linting patterns provided via `$ make lint` in the `Makefile` alongside the configurations found in the top-level `pyproject.toml` and `.pre-commit-config.yaml` files. +- All functions should be typed and new functions must have `numpydoc`-like docstrings. + +## Setup + +The package can be installed in developer mode in Python using the `$ make develop` recipe. + +## Testing + +- Write tests for new functionality. +- Any `pytest` fixtures common to tests across multiple `test_*.py` files should be found within `conftest.py`. +- Run the full suite before submitting. +- Test coverage must not significantly drop between PRs and main. + +## Restricted Paths + +Do not modify: + +- `.*` +- `.github` +- `docs` +- `tox.toml` + +## Changelog + +- Changes must be summarized in one or two sentences within the `CHANGELOG.rst` file. +- New additions must be placed under the section labelled "(unreleased)". +- Acceptable category types are all previously categories found in `CHANGELOG.rst` +- Entries must end with the issue number and PR number appended to the end: "(:issue:`#`, :pull:`#`)". + +## Commits + +- Use clear, descriptive commit messages +- One logical change per commit +- Do not bundle unrelated changes +- Reference relevant issues when applicable +- Never push directly to main +- Always use a PR branch and get human approval before merging +- Include `Assisted-by: ` trailer on AI-assisted commits + +## Review + +All changes to code require human review. + +--- +*Generated by [aipolicy.1mb.dev](https://aipolicy.1mb.dev) · v1.0* diff --git a/AI_POLICY.md b/AI_POLICY.md new file mode 100644 index 00000000..f9cc811e --- /dev/null +++ b/AI_POLICY.md @@ -0,0 +1,63 @@ +# AI Policy + +## Accountability + +You are responsible for every line of code you submit, regardless of how it was produced. If you use AI tools, review and verify all output before committing. + +## Pull Requests + +Pull Requests descriptions must be drafted by a human and adhere to the template selected on creation. +Summaries of changes posted by AI are not accepted in Pull Requests. + +## AI Tool Usage + +AI tools are permitted. Standard review process applies to all contributions. + +## AI-Generated Code + +AI-generated code must be reviewed by a human maintainer before merging. Keep changes atomic -- you must be able to explain any line on request. + +## Disclosure + +Mark AI involvement in commit messages with a trailer: + +```text +Assisted-by: +``` + +Code changes from less sophisticated phrase-completion tools do not require an AI disclosure. + +## Prohibited Uses + +- Submitting AI output you have not read and understood +- Using AI to generate code that circumvents tests or CI checks +- Feeding reviewer feedback back into AI without understanding it first +- AI-generated PR descriptions -- describe your own work +- AI-generated reviews on other contributors' PRs + +## AI in CI/CD + +AI tools may be used in CI/CD pipelines for code analysis, test generation, and deployment. + +## Training Data + +This project requests that its code not be used for AI model training. We ask that AI tool providers honor this preference. + +## Low Effort Contributions + +AI-generated low-effort contributions are unacceptable; Human and AI contributors must be capable of explaining their changes, responding to review comments, and precisely adapting their contributions as requested. + +## Licensing + +AI-generated contributions must be compatible with this project's license. Contributors must be able to certify their submissions under the project's contribution terms. + +## Enforcement + +Maintainers may close AI-generated PRs that do not meet these standards without detailed feedback. + +## Policy Evolution + +This policy will evolve as tooling and conventions change. Contributions to the policy itself are welcome. + +--- +*Generated by [aipolicy.1mb.dev](https://aipolicy.1mb.dev) · v1.0* diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 563d1950..e95cd042 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -191,7 +191,7 @@ Before you submit a pull request, check that it meets these guidelines: #. The pull request should work for all currently supported Python versions. Check the `pyproject.toml` or `tox.ini` files for the list of supported versions. -#. If you haven't already, ensure that you have read and agreed to the `Developer Certificate of Origin (DCO) `_, and that you have signed your commits using: +#. If you haven't already, ensure that you have read and agreed to the `Developer Certificate of Origin (DCO) `_, and that you have signed off on your commits using: .. code-block:: bash @@ -199,6 +199,75 @@ Before you submit a pull request, check that it meets these guidelines: This will add a `Signed-off-by:` line to your commit message, which indicates that you agree to the DCO. +AI Assistance Notice +-------------------- + +.. note:: + + The following information has been adapted from AI assistance usage policies developed by `Avocado `_ and `ghostty `_ + with suggestions from software developers and maintainers at Ouranos Inc. + +What is AI Assistance ? +~~~~~~~~~~~~~~~~~~~~~~~ + +Within the context of Common Data Model reader and mapper development, AI assistance constitutess any code, code snippets, configurations, documentation, or other programmatic assets produced, suggested, or significantly modified by an artificial intelligence model, tool, or service. + +AI assistance can also include code that is heavily adapted from or influenced by outputs from prompts made to generative artificial intelligence models, tools, or services. + +Usage Disclosure +~~~~~~~~~~~~~~~~ + +If you are using any kind of AI assistance while contributing to Common Data Model reader and mapper, **this must be disclosed in the pull request**, along with the extent to which AI assistance was used (e.g. documentation, code generation, review comments). +Using AI to help draft responses is allowed only if the contributor meaningfully reviews, edits, and takes full responsibility for the content. +Submitting AI-generated replies without human verification or understanding is not permitted. +Misrepresenting AI-generated content as purely human-authored is considered a violation of the contribution guidelines. + +Some example disclosures: + +.. admonition:: Pull Request Description + + ### Other information: + + * This PR was primarily written using a combination of OpenClaw (Kimi K2.5) and ChatGPT (GPT-o4-mini). After using these tools, I reviewed the content. + + + + * This PR was primarily written by me with small code snippets copy-pasted from chats with Claude (Sonnet 4.6). + + + + * I asked GitHub Copilot to clean up and improve code I had written. I then reviewed the final product. + +As a small exception, trivial tab-completion doesn't need to be disclosed, so long as it is limited to single keywords or short phrases. + +For commits originating exclusively from AI, we also ask that their commits are signed with "Assisted-by: " disclosure (this demand is repeated in `AGENTS.md`): + +.. admonition:: Commit Message + + Added new method that implements the ReallyCoolNewFeature algorithm. + + Assisted-by: Claude Opus 4.5 + +Failing to disclose the use of artificial intelligence models, tools, or services is disrespectful to the developers and maintainers of open source software projects. +We ask that contributors are forthcoming with this information so that the effort and scrutiny applied to Pull Request reviews can be adjusted accordingly. + +Code Review +~~~~~~~~~~~ + +All AI-assisted code contributions should be reviewed by the contributor before opening a Pull Request, except for minor or marginal changes, which may not require that step. +All contributions should still be reviewed by at least one human reviewer before approval and merging into the `main` branch. + +Low Effort Contributions +~~~~~~~~~~~~~~~~~~~~~~~~ + +AI-generated low-effort contributions are unacceptable; Human contributors must be capable of explaining their changes, responding to review comments, and precisely adapting their contributions as requested. + +Disclaimer +~~~~~~~~~~ + +The Common Data Model reader and mapper maintainers reserve the right to reject Pull Requests and contributions for many different reasons (functionality out-of-scope, code quality issues, non-adherence to code of conduct, etc.) +and this extends to code that has not been adequately disclosed as being assisted by artificial intelligence models, tools, or services. + Tips ---- diff --git a/Makefile b/Makefile index db40cc0f..c1e5563c 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ ifndef READTHEDOCS endif servedocs: autodoc ## compile the docs while watching for changes - watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . + $(MAKE) -C docs livehtml dist: clean ## builds source and wheel package python -m flint build diff --git a/docs/Makefile b/docs/Makefile index ceff7df3..7c277a38 100755 --- a/docs/Makefile +++ b/docs/Makefile @@ -19,3 +19,6 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +livehtml: + sphinx-autobuild --port 54345 --open-browser --delay 3 --re-ignore "$(BUILDDIR)|apidoc|Makefile|__pycache__" "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/index.rst b/docs/index.rst index fc623f00..ad7b2aef 100755 --- a/docs/index.rst +++ b/docs/index.rst @@ -38,7 +38,7 @@ In addition, the **cdm_reader_mapper.DataBundle** object has several main method .. toctree:: :maxdepth: 2 :hidden: - :caption: Contents: + :caption: Table of Contents: About tool-set-up diff --git a/docs/releasing.rst b/docs/releasing.rst index d8139b12..ca56a8ed 100755 --- a/docs/releasing.rst +++ b/docs/releasing.rst @@ -11,6 +11,13 @@ A reminder for the **maintainers** on how to deploy. This section is only releva It is important to be aware that any changes to files found within the ``src/cdm_reader_mapper`` folder (with the exception of ``src/cdm_reader_mapper/__init__.py``) will trigger the ``bump-version.yml`` workflow. Be careful not to commit changes to files in this folder when preparing a new release. +.. note:: + + Before beginning, it is a good idea to practice `commit signing`_ at the very least for _tags_ and _releases_. This is a method of cryptographically signing your work to ensure that packages can verifiably be traced to a known and trusted developer. + Once a GPG key has been `created`_ and `added`_ to your GitHub profile, you can enable GPG signing for all commits by launching `$ git config --local/--global commit.gpgsign true` within a shell running in your local clone (or anywhere if `--global`). + +For creating tags and releases, we **strongly recommend** enabling the "release immutability" option in the repository settings. This prevents _tags_ and _releases_ from being modified of GitHub after they have been published. + #. Create a new branch from `main` (e.g. `release-0.2.0`). #. Update the `CHANGELOG.rst` file to change the `Unreleased` section to the current date. #. Bump the version in your branch to the next version (e.g. `v0.1.0 -> v0.2.0`): @@ -26,16 +33,20 @@ A reminder for the **maintainers** on how to deploy. This section is only releva .. code-block:: console - git tag v0.2.0 + git tag -s/--sign "v0.2.0" -m "Release v0.2.0" git push --tags This will trigger a GitHub workflow to build the package and upload it to TestPyPI. At the same time, the GitHub workflow will create a draft release on GitHub. Assuming that the workflow passes, the final release can then be published on GitHub by finalizing the draft release. -#. Once the release is published, the `publish-pypi.yml` workflow will go into an `awaiting approval` mode on Github Actions. Only authorized users may approve this workflow (notifications will be sent) to trigger the upload to PyPI. +#. Once the release is **published**, the `publish-pypi.yml` workflow will go into an `awaiting approval` mode on Github Actions. Only authorized users may approve this workflow (notifications will be sent) to trigger the upload to PyPI. .. warning:: - Uploads to PyPI can **never** be overwritten. If you make a mistake, you will need to bump the version and re-release the package. If the package uploaded to PyPI is broken, you should modify the GitHub release to mark the package as broken, as well as yank the package (mark the version "broken") on PyPI. + Uploads to PyPI (and releases on GitHub if using release immutability) can **never** be overwritten. If you make a mistake, you will need to bump the version and re-release the package. If the package uploaded to GitHub and PyPI is broken, you should modify the GitHub release to mark the package as broken, as well as yank the package (mark the version "broken") on PyPI. + +.. _`commit signing`: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work +.. _created: https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key +.. _added: https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account Packaging --------- diff --git a/environment-docs.yml b/environment-docs.yml index b9676e4f..c0407cc2 100755 --- a/environment-docs.yml +++ b/environment-docs.yml @@ -47,9 +47,10 @@ dependencies: - myst-nb >=1.2.0 - nbconvert >=7.16.4 - numpydoc >=1.8.0 - - sphinx >=7.0.0 + - sphinx >=8.2.0 - sphinx-autodoc-typehints - - sphinx-copybutton + - sphinx-codeautolink >=0.16.2 + - sphinx-copybutton >=0.5.2 - furo >=2023.9.10 #from pypi diff --git a/pyproject.toml b/pyproject.toml index f4e4acfc..c595452d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,57 +2,6 @@ requires = ["flit_core >=3.12.0,<4"] build-backend = "flit_core.buildapi" -[dependency-groups] -lint = [ - # Linting tools - "codespell >=2.4.2", - "deptry >=0.25.1", - "flake8 >=7.3.0", - "flake8-rst-docstrings >=0.4.0", - "mypy >=1.20.0", - "numpydoc >=1.10.0", - "pylint >=4.0.4", - "ruff >=0.15.11", - "vulture >=2.14", - "yamllint >=1.38.0" -] -test = [ - # Base testing support - "coverage[toml] >=7.13.4", - "pytest >=9.0.2", - "pytest-cov >=7.0.0", - "pytest-env >=1.1.5" -] -docs = [ - # Documentation and example support - "ipykernel", - "ipython >=8.10.0", - "jupyter_client", - "myst-nb >=1.2.0", - "nbconvert >=7.16.4", - "sphinx >=8.0.0", - "sphinx-autodoc-typehints", - "sphinx-codeautolink >=0.16.2", - "sphinx-copybutton >=0.5.2", - "furo >=2023.9.10" -] -tox = [ - "tox >=4.53.0", - "tox-gh >=1.7.1" -] -dev = [ - # Development and testing tools - "bump-my-version >=1.3.0", - "notebook", - "pip >=26.0.1", - "prek >=0.3.0", - "watchdog >=6.0.0", - {include-group = "docs"}, - {include-group = "lint"}, - {include-group = "test"}, - {include-group = "tox"} -] - [project] name = "cdm_reader_mapper" authors = [ @@ -71,9 +20,9 @@ maintainers = [ ] readme = {file = "README.rst", content-type = "text/x-rst"} requires-python = ">=3.11.0" +keywords = ["cdm_reader_mapper"] license = "Apache-2.0" license-files = ["LICENSE"] -keywords = ["cdm_reader_mapper"] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -103,9 +52,60 @@ dependencies = [ [project.urls] "Homepage" = "https://cdm-reader-mapper.readthedocs.io" -"Source" = "https://github.com/glamod/cdm_reader_mapper" "Changelog" = "https://cdm_reader_mapper.readthedocs.io/en/latest/changelog.html" "Issue tracker" = "https://github.com/glamod/cdm_reader_mapper" +"Source" = "https://github.com/glamod/cdm_reader_mapper" + +[dependency-groups] +lint = [ + # Linting tools + "codespell >=2.4.2", + "deptry >=0.25.1", + "flake8 >=7.3.0", + "flake8-rst-docstrings >=0.4.0", + "mypy >=1.20.0", + "numpydoc >=1.10.0", + "pylint >=4.0.4", + "ruff >=0.15.11", + "vulture >=2.14", + "yamllint >=1.38.0" +] +test = [ + # Base testing support + "coverage[toml] >=7.13.4", + "pytest >=9.0.2", + "pytest-cov >=7.0.0", + "pytest-env >=1.1.5" +] +docs = [ + # Documentation and example support + "ipykernel", + "ipython >=8.10.0", + "jupyter_client", + "myst-nb >=1.2.0", + "nbconvert >=7.16.4", + "sphinx >=8.0.0", + "sphinx-autodoc-typehints", + "sphinx-codeautolink >=0.16.2", + "sphinx-copybutton >=0.5.2", + "furo >=2023.9.10" +] +tox = [ + "tox >=4.53.0", + "tox-gh >=1.7.1" +] +dev = [ + # Development and testing tools + "bump-my-version >=1.3.0", + "notebook", + "pip >=26.0.1", + "prek >=0.3.0", + "watchdog >=6.0.0", + {include-group = "docs"}, + {include-group = "lint"}, + {include-group = "test"}, + {include-group = "tox"} +] [tool] @@ -171,17 +171,20 @@ include = [ ".zenodo.json", "AUTHORS.rst", "CHANGELOG.rst", + "CITATION.cff", + "CODE_OF_CONDUCT.md", "CONTRIBUTING.rst", "LICENSE", "Makefile", "README.rst", "environment-docs.yml", + "docs/_static/*", "docs/**/*.png", "docs/**/*.rst", "docs/**/*.txt", - "docs/Makefile", "docs/conf.py", "docs/make.bat", + "docs/Makefile", "cdm_reader_mapper/**/*.json", "cdm_reader_mapper/**/*.py", "cdm_reader_mapper/**/*.txt", @@ -192,9 +195,16 @@ include = [ exclude = [ "*.py[co]", "__pycache__", - ".*", + ".editorconfig", + ".flake8", + ".github", + ".gitignore", + ".readthedocs.yml", + ".yamllint.yaml", + ".zizmor.yml", "docs/_*", "docs/modules.rst", + "pre-commit-config.yaml", "pylintrc" ] @@ -340,6 +350,9 @@ max-doc-length = 180 [tool.ruff.lint.pydocstyle] convention = "numpy" +[tool.tomlsort] +sort_first = ["build-system", "project"] + [tool.vulture] exclude = [] ignore_decorators = ["@pytest.fixture"]