diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 1b5a27e1..00000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,65 +0,0 @@ -# Contributing to CodeEntropy - -Thank you for your interest in contributing to **CodeEntropy**! - -We’re excited to collaborate with developers, researchers, and community members to make CodeEntropy better for everyone. - -This guide explains how to set up your environment, make changes, and submit them for review. Whether you’re fixing a bug, improving documentation, or adding new features, every contribution makes a difference. - ---- - -## Getting Started - -Before contributing, please review the [Developer Guide](https://codeentropy.readthedocs.io/en/latest/developer_guide.html). -It covers CodeEntropy’s architecture, setup instructions, and contribution workflow. - -If you’re new to the project, we also recommend: -- Reading the [README](../README.md) for an overview and installation details. -- Checking open [issues](https://github.com/CCPBioSim/CodeEntropy/issues) labeled **good first issue** to find beginner-friendly tasks. - ---- - -## Submitting a Pull Request (PR) - -When you’re ready to submit your work: - -1. **Push your branch** to GitHub. -2. **Open a [pull request](https://help.github.com/articles/using-pull-requests/)** against the `main` branch. -3. **Fill out the PR template**, including: - - A concise summary of what your PR does - - A list of all changes introduced - - Details on how these changes affect the repository (features, tests, documentation, etc.) -4. **Verify before submission**: - - All tests pass - - Pre-commit checks succeed - - Documentation is updated where applicable -5. **Review process**: - - Your PR will be reviewed by the core development team. - - At least **one approval** is required before merging. - -We aim to provide constructive feedback quickly and appreciate your patience during the review process. - ---- - -## Reporting Issues - -Found a bug or have a feature request? - -1. **Open a new issue** on GitHub. -2. Provide a **clear and descriptive title**. -3. Include: - - Steps to reproduce the issue (if applicable) - - Expected vs. actual behavior - - Relevant logs, screenshots, or input files - -Well-documented issues help us address problems faster and keep CodeEntropy stable and robust. - ---- - -## Additional Resources - -- [GitHub Docs](https://help.github.com/) - ---- - -Thank you for helping improve **CodeEntropy**, your contributions make open source stronger! diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 4492a51e..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve CodeEntropy -title: '[Bug]: ' -labels: bug -assignees: '' - ---- - -# Bug Report - - ---- - -## To Reproduce - - -### YAML configuration - -```yaml -# Paste the YAML snippet here -``` - -### CLI command used - -```bash -# Paste the CLI command here -``` - -### Actual output - -```bash -# Paste the output, logs, or error messages here -``` - -### Expected output - - ---- - -## Environment and Versions - -- Operating System: -- CodeEntropy Version: -- Python Version: -- Package list: - - If using conda, run: `conda list > packages.txt` and paste the contents here. - - ``` bash - # Paste packages.txt here - ``` - - - If using venv/pip, run: `pip list > packages.txt` and paste the contents here. - - ``` bash - # Paste packages.txt here - ``` - ---- - -## Screenshots or Logs - - - ---- - -## Additional Context - - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3c55e707..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,22 +0,0 @@ -blank_issues_enabled: false -issue_templates: - - name: "Bug Report" - description: "Report a bug in CodeEntropy." - title: "[Bug]: " - labels: ["bug"] - body: "./ISSUE_TEMPLATE/bug_report.md" - - name: "Feature Request" - description: "Propose a new feature or improvement." - title: "[Feature]: " - labels: ["enhancement"] - body: "./ISSUE_TEMPLATE/feature_request.md" - - name: "Documentation" - description: "Suggest updates or additions to the documentation." - title: "[Docs]: " - labels: ["documentation"] - body: "./ISSUE_TEMPLATE/documentation.md" - - name: "General Report" - description: "Provide general feedback or inquiries." - title: "[General]: " - labels: ["general"] - body: "./ISSUE_TEMPLATE/general_report.md" diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md deleted file mode 100644 index 9d0de48c..00000000 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Documentation -about: Suggest updates or additions to documentation -title: "[Docs]: " -labels: documentation -assignees: '' ---- - -### Documentation Update - - -### Why Is This Needed? - - -### Suggested Changes - - -### Additional Context - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 2d444404..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for CodeEntropy -title: '[Feature]: ' -labels: 'enhancement' -assignees: '' ---- - -# Feature Request - -## Problem / Motivation - - -## Proposed Solution - - -## Alternatives Considered -- -- - -## Expected Impact - -- -- - -## Additional Context - -- diff --git a/.github/ISSUE_TEMPLATE/general_report.md b/.github/ISSUE_TEMPLATE/general_report.md deleted file mode 100644 index 611e7c07..00000000 --- a/.github/ISSUE_TEMPLATE/general_report.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: General Report -about: Provide general feedback or inquiries -title: "[General]: " -labels: general -assignees: '' ---- - -### Feedback or Inquiry - - -### Additional Information - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 6b7db578..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,20 +0,0 @@ -## Summary - - -## Changes - -### Change 1 : -- -- - -### Change 2 : -- -- - -### Change 3 : -- -- - -## Impact -- -- diff --git a/.github/renovate.json b/.github/renovate.json index 9867d574..6e945153 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,33 +1,8 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:best-practices", - "helpers:pinGitHubActionDigestsToSemver" + "github>CCPBioSim/.github//renovate/default", + "github>CCPBioSim/.github//renovate/python" ], - "timezone": "Europe/London", - "schedule": ["after 9am and before 5pm every weekday"], - "dependencyDashboard": true, - "reviewers": ["harryswift01", "jimboid"], - "minimumReleaseAge": "3 days", - "packageRules": [ - { - "matchManagers": ["github-actions"], - "groupName": "GitHub Actions", - "addLabels": ["ci", "dependencies"] - }, - { - "matchManagers": ["poetry", "pep621"], - "matchDepTypes": ["project.dependencies"], - "rangeStrategy": "widen", - "groupName": "Software Production Dependencies", - "addLabels": ["python", "production-deps"] - }, - { - "matchManagers": ["poetry", "pep621"], - "matchDepTypes": ["project.optional-dependencies", "build-system.requires"], - "rangeStrategy": "replace", - "groupName": "Python CI and Dev Tools", - "addLabels": ["python", "dev-dependencies"] - } - ] + "reviewers": ["harryswift01", "jimboid"] } diff --git a/.github/workflows/coveralls-main.yaml b/.github/workflows/coveralls-main.yaml index ab2ea35a..e3317d6f 100644 --- a/.github/workflows/coveralls-main.yaml +++ b/.github/workflows/coveralls-main.yaml @@ -16,39 +16,16 @@ concurrency: jobs: coveralls: name: Build main coverage baseline - runs-on: ubuntu-26.04 - timeout-minutes: 30 - + uses: CCPBioSim/.github/.github/workflows/ci-test-python.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 permissions: contents: read checks: write statuses: write - - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Set up Python 3.14 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 - with: - python-version: "3.15" - - - name: Install testing dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[testing] - - - name: Run coverage - run: | - python -m pytest tests/unit \ - --cov CodeEntropy \ - --cov-report term-missing \ - --cov-report xml \ - -q - - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - file: coverage.xml - fail-on-error: false + pull-requests: write + with: + package: CodeEntropy + test-path: tests/unit + os: '["ubuntu-26.04"]' + python-versions: '["3.15"]' + coverage-python-version: "3.15" + timeout-minutes: 30 diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 53879ccf..e319e712 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -5,35 +5,25 @@ on: - cron: '0 8 * * 1-5' workflow_dispatch: +permissions: + contents: read + concurrency: group: daily-${{ github.ref }} cancel-in-progress: true jobs: unit: - name: Unit (${{ matrix.os }}, py${{ matrix.python-version }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04, macos-26, windows-2025-vs2026] - python-version: ["3.12", "3.13", "3.14"] - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install testing dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[testing] - - - name: Run unit tests - run: python -m pytest tests/unit + name: Unit + uses: CCPBioSim/.github/.github/workflows/ci-test-python.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + checks: write + statuses: write + pull-requests: write + with: + package: CodeEntropy + test-path: tests/unit + os: '["ubuntu-24.04", "macos-26", "windows-2025-vs2026"]' + coverage: false + timeout-minutes: 30 diff --git a/.github/workflows/dependency-floors.yaml b/.github/workflows/dependency-floors.yaml index 7325abc7..5d578e4c 100644 --- a/.github/workflows/dependency-floors.yaml +++ b/.github/workflows/dependency-floors.yaml @@ -14,37 +14,11 @@ concurrency: jobs: lowest: - name: Lowest dependencies (${{ matrix.os }}, py${{ matrix.python-version }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - - strategy: - fail-fast: false - matrix: - os: [ubuntu-26.04, macos-26, windows-2025-vs2026] - python-version: ["3.12", "3.13", "3.14"] - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - run: | - python -m pip install --upgrade pip - python -m pip install uv - - - name: Resolve lowest dependencies as wheels - run: | - uv pip compile pyproject.toml --resolution lowest-direct --only-binary :all: --output-file lowest.txt - cat lowest.txt - - - name: Install lowest dependencies - run: uv pip install --system --resolution lowest-direct -e ".[testing]" - - - name: Run unit tests - run: python -m pytest tests/unit + name: Lowest dependencies + uses: CCPBioSim/.github/.github/workflows/ci-lowest-dependencies.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + test-path: tests/unit + os: '["ubuntu-26.04", "macos-26", "windows-2025-vs2026"]' + timeout-minutes: 30 diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 3fc599d8..eaaace5d 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -13,43 +13,28 @@ concurrency: jobs: unit: name: Unit - runs-on: ${{ matrix.os }} - timeout-minutes: 25 - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04, macos-26, windows-2025-vs2026] - python-version: ["3.12", "3.13", "3.14"] - - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 - with: - python-version: ${{ matrix.python-version }} - - - name: Install testing dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[testing] - - - name: Pytest unit • ${{ matrix.os }}, ${{ matrix.python-version }} - run: python -m pytest tests/unit - - - name: Install uv - run: python -m pip install uv - - - name: Resolve lowest dependencies as wheels - run: | - uv pip compile pyproject.toml --resolution lowest-direct --only-binary :all: --output-file lowest.txt - - - name: Install lowest dependencies - run: uv pip install --system --reinstall --resolution lowest-direct -e ".[testing]" - - - name: Pytest unit at lowest dependencies • ${{ matrix.os }}, ${{ matrix.python-version }} - run: python -m pytest tests/unit + uses: CCPBioSim/.github/.github/workflows/ci-test-python.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + checks: write + statuses: write + pull-requests: write + with: + package: CodeEntropy + test-path: tests/unit + os: '["ubuntu-24.04", "macos-26", "windows-2025-vs2026"]' + coverage-python-version: "3.15" + timeout-minutes: 25 + + lowest-dependencies: + name: Lowest dependencies + uses: CCPBioSim/.github/.github/workflows/ci-lowest-dependencies.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + test-path: tests/unit + os: '["ubuntu-24.04", "macos-26", "windows-2025-vs2026"]' + timeout-minutes: 25 discover-systems: name: Discover regression systems @@ -122,101 +107,19 @@ jobs: docs: name: Docs needs: unit - runs-on: ubuntu-26.04 - timeout-minutes: 25 - - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Set up Python 3.14 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 - with: - python-version: "3.15" - - - name: Install docs dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[docs] - - - name: Build docs - run: | - make -C docs clean - make -C docs html SPHINXOPTS="-W --keep-going" - - - name: Upload docs artifact - if: always() - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: docs-html - path: docs/_build/html + uses: CCPBioSim/.github/.github/workflows/ci-docs.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + python-versions: '["3.15"]' + timeout-minutes: 25 pre-commit: name: Pre-commit needs: unit - runs-on: ubuntu-26.04 - timeout-minutes: 15 - - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Set up Python 3.14 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 - with: - python-version: "3.15" - - - name: Install pre-commit dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[pre-commit] - - - name: Run pre-commit - run: | - pre-commit install - pre-commit run --all-files || { - git status --short - git diff - exit 1 - } - - coverage: - name: Coverage - needs: unit - runs-on: ubuntu-26.04 - timeout-minutes: 30 - + uses: CCPBioSim/.github/.github/workflows/ci-pre-commit.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 permissions: contents: read - checks: write - statuses: write - pull-requests: write - - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 - - - name: Set up Python 3.14 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 - with: - python-version: "3.15" - - - name: Install testing dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[testing] - - - name: Run coverage - run: | - python -m pytest tests/unit \ - --cov CodeEntropy \ - --cov-report term-missing \ - --cov-report xml \ - -q - - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - file: coverage.xml - fail-on-error: false + with: + python-version: "3.15" + timeout-minutes: 15 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 72c545a8..6f108022 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,296 +4,72 @@ on: workflow_dispatch: inputs: version: + description: Version to release, in X.Y.Z form. required: true - default: 'x.y.z' + type: string + dry-run: + description: Check and build everything but do not open the version PR, tag, release or publish. + type: boolean + default: false permissions: - contents: write - pull-requests: write + contents: read jobs: - checks: - name: Version check - runs-on: ubuntu-26.04 - steps: - - name: Checkout repository - id: repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: 3.14.8 - - - name: Get latest release from pip - id: latestreleased - run: | - PREVIOUS_VERSION=$(python -m pip index versions CodeEntropy | grep "CodeEntropy" | cut -d "(" -f2 | cut -d ")" -f1) - echo "pip_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT" - echo $PREVIOUS_VERSION - - - name: version comparison - id: compare - run: | - pip3 install semver - output=$(pysemver compare ${{ steps.latestreleased.outputs.pip_tag }} ${{ github.event.inputs.version }}) - if [ $output -ge 0 ]; then exit 1; fi - - version: - name: prepare ${{ github.event.inputs.version }} - needs: checks - runs-on: ubuntu-26.04 - steps: - - - name: checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Change version in repo and CITATION.cff - run: | - # Update Python package version - sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" CodeEntropy/__init__.py - - # Update CITATION.cff version and date-released - if [ -f CITATION.cff ]; then - sed -i -E "s/^(version:\s*).*/\1${{ github.event.inputs.version }}/" CITATION.cff - sed -i -E "s/^(date-released:\s*).*/\1'$(date -u +%F)'/" CITATION.cff - fi - - - name: send PR - id: pr_id - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 - with: - commit-message: Update version to ${{ github.event.inputs.version }} - branch: version-update - title: "Update to version ${{ github.event.inputs.version }}" - body: | - Update version - - Update the __init__.py with new release - - Update CITATION.cff version & date-released - - Auto-generated by [CI] - committer: version-updater - author: version-updater - base: main - signoff: false - draft: false - - - name: auto approve review - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 - with: - pull-request-number: ${{ steps.pr_id.outputs.pull-request-number }} - review-message: "Auto approved version bump PR" - github-token: ${{ secrets.AUTO_PR_MERGE }} - - - name: merge PR - run: gh pr merge --merge --delete-branch --auto "${{ steps.pr_id.outputs.pull-request-number }}" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - tag: - name: tag release - needs: version - runs-on: ubuntu-26.04 - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: main - - - name: tag v${{ github.event.inputs.version }} - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git tag ${{ github.event.inputs.version }} - git push origin tag ${{ github.event.inputs.version }} - - release: - name: make github release - needs: tag - runs-on: ubuntu-26.04 - steps: - - name: create release - id: create_release - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 - with: - name: v${{ github.event.inputs.version }} - generate_release_notes: true - tag_name: ${{ github.event.inputs.version }} - - - name: fetch generated changelog - id: changelog - if: steps.create_release.outcome == 'success' - continue-on-error: true - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # generate_release_notes builds the changelog server-side, so pull - # it back down here rather than trying to reconstruct it locally. - gh release view "${{ github.event.inputs.version }}" --repo "${{ github.repository }}" --json body -q .body > changelog.txt - - - name: notify Zulip of release - if: steps.create_release.outcome == 'success' - continue-on-error: true - env: - ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }} - ZULIP_BOT_API_KEY: ${{ secrets.ZULIP_BOT_API_KEY }} - ZULIP_SITE: ${{ secrets.ZULIP_SITE }} - REPO: ${{ github.event.repository.name }} - TAG: v${{ github.event.inputs.version }} - RELEASE_URL: ${{ steps.create_release.outputs.url }} - run: | - CONTENT=$(cat < { "Full Name": "orcid url" } - authors=$(yq -o=json '.authors' "$CFF_FILE" | jq -c ' - map({ - key: ( - if .name then .name - else ([."given-names", ."family-names"] | map(select(. != null)) | join(" ")) - end - ), - value: (.orcid // "") - }) | from_entries') - - payload=$(jq -nc \ - --arg name "$NAME" \ - --arg github "$github_url" \ - --arg docs "$docs_url" \ - --arg version "$VERSION" \ - --argjson meta "$meta" \ - --argjson authors "$authors" \ - '{ - name: $name, - meta: ({github: $github, docs: $docs} + $meta + {version: $version, authors: $authors}) - }') - - echo "payload: $payload" - echo "json=$payload" >> "$GITHUB_OUTPUT" - - - name: Post version to website metadata repo - uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 - with: - token: ${{ secrets.BUILD_TOKEN }} - repository: ccpbiosim/ccpbiosim.github.io - event-type: software - client-payload: ${{ steps.payload.outputs.json }} + prepare: + name: Prepare + uses: CCPBioSim/.github/.github/workflows/release-prepare.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: write + pull-requests: write + with: + version: ${{ inputs.version }} + dry-run: ${{ inputs.dry-run }} + version-files: >- + [ + {"path": "CodeEntropy/__init__.py", "pattern": "^__version__ =.*", "replace": "__version__ = \"{version}\""}, + {"path": "CITATION.cff", "pattern": "^version:.*", "replace": "version: {version}"}, + {"path": "CITATION.cff", "pattern": "^date-released:.*", "replace": "date-released: '{date}'"} + ] + secrets: + AUTO_PR_MERGE: ${{ secrets.AUTO_PR_MERGE }} + ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }} + ZULIP_BOT_API_KEY: ${{ secrets.ZULIP_BOT_API_KEY }} + ZULIP_SITE: ${{ secrets.ZULIP_SITE }} + + website: + name: Website + needs: prepare + uses: CCPBioSim/.github/.github/workflows/release-website.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + version: ${{ inputs.version }} + tag: ${{ needs.prepare.outputs.tag }} + dry-run: ${{ inputs.dry-run }} + secrets: + BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} pypi: - name: make pypi release - needs: [tag, release] - runs-on: ubuntu-26.04 - steps: - - - name: checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: main - - - name: Set up Python - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: 3.14.8 - - - name: Install flit - run: | - python -m pip install --upgrade pip - python -m pip install "flit>=4,<5" "flit_core>=4,<5" - - - name: Build and publish - run: | - flit publish --use-vcs - env: - FLIT_USERNAME: __token__ - FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + name: PyPI + needs: prepare + uses: CCPBioSim/.github/.github/workflows/release-pypi.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + tag: ${{ needs.prepare.outputs.tag || inputs.version }} + dry-run: ${{ inputs.dry-run }} + secrets: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} conda: - name: publish conda to anaconda.org - needs: [tag, release] - runs-on: ubuntu-26.04 - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: main - - - name: Set version in conda recipe - run: | - sed -i "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml - grep '{% set version' conda-recipe/meta.yaml - - - name: Setup Conda (conda-forge only) - uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 - with: - miniforge-variant: Miniforge3 - python-version: "3.14" - auto-activate: true - activate-environment: base - conda-remove-defaults: true - channels: conda-forge - channel-priority: strict - - - name: Install build tools - shell: bash -l {0} - run: | - conda install -y conda-build anaconda-client - conda config --set anaconda_upload no - conda list conda-build - conda build --help - - - name: Build package - shell: bash -l {0} - env: - PIP_NO_INDEX: "0" - run: | - PKG_PATH=$(conda build conda-recipe --output) - echo "PKG_PATH=$PKG_PATH" >> "$GITHUB_ENV" - conda build conda-recipe - test -f "$PKG_PATH" - echo "Built: $PKG_PATH" - - - name: Upload to Anaconda - shell: bash -l {0} - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - run: | - anaconda -t "$ANACONDA_API_TOKEN" upload "$PKG_PATH" --user CCPBioSim --force + name: Conda + needs: prepare + uses: CCPBioSim/.github/.github/workflows/release-conda.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + tag: ${{ needs.prepare.outputs.tag || inputs.version }} + dry-run: ${{ inputs.dry-run }} + secrets: + ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/update-copyright-years-in-license-file.yaml b/.github/workflows/update-copyright-years-in-license-file.yaml index 9833d853..54677d54 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yaml +++ b/.github/workflows/update-copyright-years-in-license-file.yaml @@ -5,13 +5,12 @@ on: - cron: '0 3 1 1 *' # 03:00 AM on January 1 workflow_dispatch: +permissions: + contents: read + jobs: - update-license-year: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 - - uses: FantasticFiasco/action-update-license-year@f180e962fa988db222d8f03ef4636750312d1b3d # v3.0.4 - with: - token: ${{ secrets.GITHUB_TOKEN }} + update-license-year: + uses: CCPBioSim/.github/.github/workflows/maintenance-license-year.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: write + pull-requests: write diff --git a/.github/workflows/weekly-docs.yaml b/.github/workflows/weekly-docs.yaml index 0848b965..32daa71f 100644 --- a/.github/workflows/weekly-docs.yaml +++ b/.github/workflows/weekly-docs.yaml @@ -5,44 +5,20 @@ on: - cron: '0 8 * * 1' workflow_dispatch: +permissions: + contents: read + concurrency: group: weekly-docs-${{ github.ref }} cancel-in-progress: true jobs: docs: - name: Docs build (${{ matrix.os }}, python ${{ matrix.python-version }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04, windows-2025-vs2026, macos-26] - python-version: ["3.12", "3.13", "3.14"] - timeout-minutes: 30 - - steps: - - name: Checkout repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -e .[docs] - - - name: Build docs (warnings as errors) - run: | - make -C docs clean - make -C docs html SPHINXOPTS="-W --keep-going" - - - name: Upload docs artifacts on failure - if: failure() - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: docs-${{ matrix.os }}-py${{ matrix.python-version }}-failure - path: | - docs/_build/** + name: Docs build + uses: CCPBioSim/.github/.github/workflows/ci-docs.yaml@116d539cf0864af72d33dce047313ca6fc624ccd # 0.4.0 + permissions: + contents: read + with: + os: '["ubuntu-24.04", "windows-2025-vs2026", "macos-26"]' + python-versions: '["3.12", "3.13", "3.14"]' + timeout-minutes: 30 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 2b7c3c7f..00000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,128 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -ccpbiosim@stfc.ac.uk. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 452d911c..f36171c5 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -181,10 +181,10 @@ bound (floor) is the oldest release CodeEntropy is known to work with, so that i stays installable alongside other scientific packages. Floors are only raised when the code needs a newer release. Upper bounds are widened by Renovate. -The unit job in the pull request workflow and the weekly ``dependency-floors.yaml`` -workflow check this. They check that the lowest allowed versions resolve to -installable wheels on each platform and Python version, and that the unit tests -pass with them installed. +The ``lowest-dependencies`` job in the pull request workflow and the weekly +``dependency-floors.yaml`` workflow check this. They check that the lowest +allowed versions resolve to installable wheels on each platform and Python +version, and that the unit tests pass with them installed. Run the same checks locally with `uv `_::