From 528eec081aa13aeba9159a0645713bc6e0cfa623 Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:26:00 -0400 Subject: [PATCH 1/8] chore: update demo to the latest cookiecutter-robust-python --- .cookiecutter.json | 2 +- .cruft.json | 4 +- .gitlab-ci.yml | 322 +++++++++++++++++++++++ bitbucket-pipelines.yml | 568 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 893 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 bitbucket-pipelines.yml diff --git a/.cookiecutter.json b/.cookiecutter.json index 0e8c1df..1fd9257 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "_commit": "addd1ca7e122772bef39f0d3452ebe531ee1e5cb", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index 9603a77..b559c56 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "commit": "addd1ca7e122772bef39f0d3452ebe531ee1e5cb", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" + "_commit": "addd1ca7e122772bef39f0d3452ebe531ee1e5cb" } }, "directory": null diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..4d89a6d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,322 @@ +# .gitlab-ci.yml +# See https://docs.gitlab.com/ee/ci/yaml/ +# This is currently untested and serves as a best guess for what might be an equivalent pipeline + +# Global settings +image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + +variables: + UV_CACHE_DIR: .uv-cache + UV_LINK_MODE: copy + PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip + +# Define stages +stages: + - quality + - typecheck + - test + - security + - build + - release + +# Global cache configuration for uv +.uv-cache: &uv-cache + cache: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + paths: + - $UV_CACHE_DIR + - $PIP_CACHE_DIR + policy: pull-push + +# Shared rules for when to run jobs +.on-merge-requests-and-main: &on-merge-requests-and-main + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_PIPELINE_SOURCE == "web" + +# File pattern anchors for different job types +.python-quality-files: &python-quality-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - ".ruff.toml" + - "pyrightconfig.json" + - ".gitlab-ci.yml" + +.python-typecheck-files: &python-typecheck-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - "pyrightconfig.json" + - ".gitlab-ci.yml" + +.python-security-files: &python-security-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - "bandit.yml" + - ".gitlab-ci.yml" + +.python-test-files: &python-test-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - ".coveragerc" + - ".gitlab-ci.yml" + +.docs-files: &docs-files + - "docs/**/*" + - "src/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - ".gitlab-ci.yml" + +.rust-files: &rust-files + - "rust/**/*.rs" + - "Cargo.toml" + - ".gitlab-ci.yml" + +# Base job template for Python quality checks +.quality-job: &quality-job + stage: quality + <<: *uv-cache + <<: *on-merge-requests-and-main + before_script: + - uv --version + after_script: + - uv cache prune --ci + +# Python Quality Checks Job +quality-python: + <<: *quality-job + script: + - uvx nox -t quality + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-quality-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-quality-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-quality-files + +typecheck-python: + stage: typecheck + <<: *uv-cache + parallel: + matrix: + - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] + image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim + before_script: + - uv --version + script: + - uvx nox -s typecheck-$PYTHON_VERSION + after_script: + - uv cache prune --ci + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-typecheck-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-typecheck-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-typecheck-files + +# Security Checks +security-python: + stage: security + <<: *uv-cache + script: + - uvx nox -s security-python + after_script: + - uv cache prune --ci + allow_failure: true + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-security-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-security-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-security-files + +# Python Tests - Using GitLab Matrix Strategy +test-python: + stage: test + <<: *uv-cache + parallel: + matrix: + - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] + image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim + script: + - uvx nox -s tests-python-${PYTHON_VERSION//.} + after_script: + - uv cache prune --ci + artifacts: + reports: + junit: tests/results/*.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml + paths: + - tests/results/ + - coverage.xml + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-test-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-test-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-test-files + +# Cross-platform testing with macOS (GitLab.com SaaS runners) +test-python-macos: + stage: test + tags: + - saas-macos-medium-m1 + before_script: + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + script: + - uvx nox -s tests-python-3.13 + artifacts: + reports: + junit: tests/results/*.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml + paths: + - tests/results/ + - coverage.xml + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-test-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-test-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-test-files + +# Cross-platform testing with Windows (GitLab.com SaaS runners) +test-python-windows: + stage: test + tags: + - saas-windows-medium-amd64 + before_script: + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - $env:PATH += ";$env:USERPROFILE\.cargo\bin" + script: + - uvx nox -s tests-python-3.13 + artifacts: + reports: + junit: tests/results/*.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml + paths: + - tests/results/ + - coverage.xml + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-test-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-test-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-test-files + + + +# Build Stage +build-python: + stage: build + <<: *uv-cache + script: + - uvx nox -s build-python + after_script: + - uv cache prune --ci + artifacts: + paths: + - dist/ + expire_in: 30 days + rules: + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_PIPELINE_SOURCE == "web" + +# Documentation build validation (ReadTheDocs handles hosting) +build-docs: + stage: build + <<: *uv-cache + script: + - uvx nox -s build-docs + after_script: + - uv cache prune --ci + artifacts: + paths: + - docs/_build/html/ + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *docs-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *docs-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *docs-files + +# Documentation build (GitLab Pages - fallback/mirror) +pages: + stage: build + <<: *uv-cache + script: + - uvx nox -s build-docs + - mv docs/_build/html public + after_script: + - uv cache prune --ci + artifacts: + paths: + - public + expire_in: 30 days + rules: + - if: $CI_COMMIT_BRANCH == "main" + changes: *docs-files + +# Test Release Job (TestPyPI) +test-release-python: + stage: release + <<: *uv-cache + script: + - export PYPI_URL=https://test.pypi.org/legacy/ + - uvx nox -s publish-python + after_script: + - uv cache prune --ci + rules: + - if: $CI_COMMIT_TAG + environment: + name: test + url: https://test.pypi.org/project/robust_python_demo/ + +# Production Release Job (PyPI) +release-python: + stage: release + <<: *uv-cache + script: + - uvx nox -s publish-python + after_script: + - uv cache prune --ci + rules: + - if: $CI_COMMIT_TAG + environment: + name: production + url: https://pypi.org/project/robust_python_demo/ + needs: + - test-release-python + when: manual diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 0000000..7a109b9 --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,568 @@ +#file: noinspection InvalidFileLocation +# bitbucket-pipelines.yml +# See https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/ +# This is currently untested serves as a best guess for an equivalent pipeline + +image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + +definitions: + caches: + uv-deps: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + path: .uv-cache + pip-deps: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + path: .cache/pip + + # Shared configuration for uv + services: + docker: + memory: 2048 + +pipelines: + # Default pipeline for pushes to any branch + default: + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + after-script: + - echo "Python quality checks completed" + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + after-script: + - echo "Security checks completed" + + # Parallel typecheck execution across Python versions + - parallel: + steps: + - step: + name: Typecheck Python 3.9 + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.9 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.10 + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.10 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.11 + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.11 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.12 + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.12 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.13 + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.13 + - uv cache prune --ci + + # Parallel test execution across Python versions and platforms + - parallel: + steps: + # Linux testing across all Python versions + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.10 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.10 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.11 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.11 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.12 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.12 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + + + # Pipeline for main/master branch + branches: + main: + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + + # Parallel typecheck execution across Python versions + - parallel: + steps: + - step: + name: Typecheck Python 3.9 + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.9 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.10 + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.10 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.11 + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.11 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.12 + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.12 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.13 + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.13 + - uv cache prune --ci + + # Parallel test execution across Python versions and platforms + - parallel: + steps: + # Linux testing across all Python versions + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.10 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.10 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.11 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.11 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.12 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.12 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + + + - step: + name: Build Package + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s build-python + - uv cache prune --ci + artifacts: + - dist/** + + # Pipeline for pull requests + pull-requests: + '**': + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + + # Parallel test execution for PRs (reduced matrix for speed) + - parallel: + steps: + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + + + # Pipeline for tags (releases) + tags: + 'v*': + - step: + name: Build Package + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s build-python + - uv cache prune --ci + artifacts: + - dist/** + + - step: + name: Publish to TestPyPI + deployment: test + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - export PYPI_URL=https://test.pypi.org/legacy/ + - uvx nox -s publish-python + - uv cache prune --ci + + - step: + name: Publish to Production PyPI + deployment: production + trigger: manual + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s publish-python + - uv cache prune --ci From 012f07d631fbd4898f3a4cba8546e6d9cc1c8af6 Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:28:39 -0400 Subject: [PATCH 2/8] Revert "chore: update demo to the latest cookiecutter-robust-python" This reverts commit 528eec081aa13aeba9159a0645713bc6e0cfa623. --- .cookiecutter.json | 2 +- .cruft.json | 4 +- .gitlab-ci.yml | 322 ----------------------- bitbucket-pipelines.yml | 568 ---------------------------------------- 4 files changed, 3 insertions(+), 893 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 bitbucket-pipelines.yml diff --git a/.cookiecutter.json b/.cookiecutter.json index 1fd9257..0e8c1df 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "addd1ca7e122772bef39f0d3452ebe531ee1e5cb", + "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index b559c56..9603a77 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "addd1ca7e122772bef39f0d3452ebe531ee1e5cb", + "commit": "1460377e7f5ce48155c22f32b6845546d5097664", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "addd1ca7e122772bef39f0d3452ebe531ee1e5cb" + "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" } }, "directory": null diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 4d89a6d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,322 +0,0 @@ -# .gitlab-ci.yml -# See https://docs.gitlab.com/ee/ci/yaml/ -# This is currently untested and serves as a best guess for what might be an equivalent pipeline - -# Global settings -image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - -variables: - UV_CACHE_DIR: .uv-cache - UV_LINK_MODE: copy - PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip - -# Define stages -stages: - - quality - - typecheck - - test - - security - - build - - release - -# Global cache configuration for uv -.uv-cache: &uv-cache - cache: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - paths: - - $UV_CACHE_DIR - - $PIP_CACHE_DIR - policy: pull-push - -# Shared rules for when to run jobs -.on-merge-requests-and-main: &on-merge-requests-and-main - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - - if: $CI_COMMIT_BRANCH == "main" - - if: $CI_PIPELINE_SOURCE == "web" - -# File pattern anchors for different job types -.python-quality-files: &python-quality-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - ".ruff.toml" - - "pyrightconfig.json" - - ".gitlab-ci.yml" - -.python-typecheck-files: &python-typecheck-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - "pyrightconfig.json" - - ".gitlab-ci.yml" - -.python-security-files: &python-security-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - "bandit.yml" - - ".gitlab-ci.yml" - -.python-test-files: &python-test-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - ".coveragerc" - - ".gitlab-ci.yml" - -.docs-files: &docs-files - - "docs/**/*" - - "src/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - ".gitlab-ci.yml" - -.rust-files: &rust-files - - "rust/**/*.rs" - - "Cargo.toml" - - ".gitlab-ci.yml" - -# Base job template for Python quality checks -.quality-job: &quality-job - stage: quality - <<: *uv-cache - <<: *on-merge-requests-and-main - before_script: - - uv --version - after_script: - - uv cache prune --ci - -# Python Quality Checks Job -quality-python: - <<: *quality-job - script: - - uvx nox -t quality - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-quality-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-quality-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-quality-files - -typecheck-python: - stage: typecheck - <<: *uv-cache - parallel: - matrix: - - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] - image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim - before_script: - - uv --version - script: - - uvx nox -s typecheck-$PYTHON_VERSION - after_script: - - uv cache prune --ci - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-typecheck-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-typecheck-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-typecheck-files - -# Security Checks -security-python: - stage: security - <<: *uv-cache - script: - - uvx nox -s security-python - after_script: - - uv cache prune --ci - allow_failure: true - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-security-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-security-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-security-files - -# Python Tests - Using GitLab Matrix Strategy -test-python: - stage: test - <<: *uv-cache - parallel: - matrix: - - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] - image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim - script: - - uvx nox -s tests-python-${PYTHON_VERSION//.} - after_script: - - uv cache prune --ci - artifacts: - reports: - junit: tests/results/*.xml - coverage_report: - coverage_format: cobertura - path: coverage.xml - paths: - - tests/results/ - - coverage.xml - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-test-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-test-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-test-files - -# Cross-platform testing with macOS (GitLab.com SaaS runners) -test-python-macos: - stage: test - tags: - - saas-macos-medium-m1 - before_script: - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - script: - - uvx nox -s tests-python-3.13 - artifacts: - reports: - junit: tests/results/*.xml - coverage_report: - coverage_format: cobertura - path: coverage.xml - paths: - - tests/results/ - - coverage.xml - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-test-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-test-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-test-files - -# Cross-platform testing with Windows (GitLab.com SaaS runners) -test-python-windows: - stage: test - tags: - - saas-windows-medium-amd64 - before_script: - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - $env:PATH += ";$env:USERPROFILE\.cargo\bin" - script: - - uvx nox -s tests-python-3.13 - artifacts: - reports: - junit: tests/results/*.xml - coverage_report: - coverage_format: cobertura - path: coverage.xml - paths: - - tests/results/ - - coverage.xml - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-test-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-test-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-test-files - - - -# Build Stage -build-python: - stage: build - <<: *uv-cache - script: - - uvx nox -s build-python - after_script: - - uv cache prune --ci - artifacts: - paths: - - dist/ - expire_in: 30 days - rules: - - if: $CI_COMMIT_TAG - - if: $CI_COMMIT_BRANCH == "main" - - if: $CI_PIPELINE_SOURCE == "web" - -# Documentation build validation (ReadTheDocs handles hosting) -build-docs: - stage: build - <<: *uv-cache - script: - - uvx nox -s build-docs - after_script: - - uv cache prune --ci - artifacts: - paths: - - docs/_build/html/ - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *docs-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *docs-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *docs-files - -# Documentation build (GitLab Pages - fallback/mirror) -pages: - stage: build - <<: *uv-cache - script: - - uvx nox -s build-docs - - mv docs/_build/html public - after_script: - - uv cache prune --ci - artifacts: - paths: - - public - expire_in: 30 days - rules: - - if: $CI_COMMIT_BRANCH == "main" - changes: *docs-files - -# Test Release Job (TestPyPI) -test-release-python: - stage: release - <<: *uv-cache - script: - - export PYPI_URL=https://test.pypi.org/legacy/ - - uvx nox -s publish-python - after_script: - - uv cache prune --ci - rules: - - if: $CI_COMMIT_TAG - environment: - name: test - url: https://test.pypi.org/project/robust_python_demo/ - -# Production Release Job (PyPI) -release-python: - stage: release - <<: *uv-cache - script: - - uvx nox -s publish-python - after_script: - - uv cache prune --ci - rules: - - if: $CI_COMMIT_TAG - environment: - name: production - url: https://pypi.org/project/robust_python_demo/ - needs: - - test-release-python - when: manual diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml deleted file mode 100644 index 7a109b9..0000000 --- a/bitbucket-pipelines.yml +++ /dev/null @@ -1,568 +0,0 @@ -#file: noinspection InvalidFileLocation -# bitbucket-pipelines.yml -# See https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/ -# This is currently untested serves as a best guess for an equivalent pipeline - -image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - -definitions: - caches: - uv-deps: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - path: .uv-cache - pip-deps: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - path: .cache/pip - - # Shared configuration for uv - services: - docker: - memory: 2048 - -pipelines: - # Default pipeline for pushes to any branch - default: - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - after-script: - - echo "Python quality checks completed" - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - after-script: - - echo "Security checks completed" - - # Parallel typecheck execution across Python versions - - parallel: - steps: - - step: - name: Typecheck Python 3.9 - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.9 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.10 - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.10 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.11 - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.11 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.12 - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.12 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.13 - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.13 - - uv cache prune --ci - - # Parallel test execution across Python versions and platforms - - parallel: - steps: - # Linux testing across all Python versions - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.10 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.10 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.11 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.11 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.12 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.12 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - - # Pipeline for main/master branch - branches: - main: - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - - # Parallel typecheck execution across Python versions - - parallel: - steps: - - step: - name: Typecheck Python 3.9 - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.9 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.10 - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.10 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.11 - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.11 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.12 - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.12 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.13 - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.13 - - uv cache prune --ci - - # Parallel test execution across Python versions and platforms - - parallel: - steps: - # Linux testing across all Python versions - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.10 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.10 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.11 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.11 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.12 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.12 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - - - step: - name: Build Package - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s build-python - - uv cache prune --ci - artifacts: - - dist/** - - # Pipeline for pull requests - pull-requests: - '**': - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - - # Parallel test execution for PRs (reduced matrix for speed) - - parallel: - steps: - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - - - # Pipeline for tags (releases) - tags: - 'v*': - - step: - name: Build Package - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s build-python - - uv cache prune --ci - artifacts: - - dist/** - - - step: - name: Publish to TestPyPI - deployment: test - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - export PYPI_URL=https://test.pypi.org/legacy/ - - uvx nox -s publish-python - - uv cache prune --ci - - - step: - name: Publish to Production PyPI - deployment: production - trigger: manual - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s publish-python - - uv cache prune --ci From 7661074cf5ccefee7719b3d4d2b2c6b251a5e83b Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:49:44 -0400 Subject: [PATCH 3/8] chore: update demo to the latest cookiecutter-robust-python --- .cookiecutter.json | 2 +- .cruft.json | 4 +- .gitlab-ci.yml | 322 +++++++++++++++++++++++ bitbucket-pipelines.yml | 568 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 893 insertions(+), 3 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 bitbucket-pipelines.yml diff --git a/.cookiecutter.json b/.cookiecutter.json index 0e8c1df..62c393b 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "_commit": "78aa60aa92b9fcf88f009101594a750c431c92c9", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index 9603a77..8baf746 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "commit": "78aa60aa92b9fcf88f009101594a750c431c92c9", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" + "_commit": "78aa60aa92b9fcf88f009101594a750c431c92c9" } }, "directory": null diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..4d89a6d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,322 @@ +# .gitlab-ci.yml +# See https://docs.gitlab.com/ee/ci/yaml/ +# This is currently untested and serves as a best guess for what might be an equivalent pipeline + +# Global settings +image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + +variables: + UV_CACHE_DIR: .uv-cache + UV_LINK_MODE: copy + PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip + +# Define stages +stages: + - quality + - typecheck + - test + - security + - build + - release + +# Global cache configuration for uv +.uv-cache: &uv-cache + cache: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + paths: + - $UV_CACHE_DIR + - $PIP_CACHE_DIR + policy: pull-push + +# Shared rules for when to run jobs +.on-merge-requests-and-main: &on-merge-requests-and-main + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_PIPELINE_SOURCE == "web" + +# File pattern anchors for different job types +.python-quality-files: &python-quality-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - ".ruff.toml" + - "pyrightconfig.json" + - ".gitlab-ci.yml" + +.python-typecheck-files: &python-typecheck-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - "pyrightconfig.json" + - ".gitlab-ci.yml" + +.python-security-files: &python-security-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - "bandit.yml" + - ".gitlab-ci.yml" + +.python-test-files: &python-test-files + - "src/**/*.py" + - "tests/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - ".coveragerc" + - ".gitlab-ci.yml" + +.docs-files: &docs-files + - "docs/**/*" + - "src/**/*.py" + - "noxfile.py" + - "pyproject.toml" + - ".gitlab-ci.yml" + +.rust-files: &rust-files + - "rust/**/*.rs" + - "Cargo.toml" + - ".gitlab-ci.yml" + +# Base job template for Python quality checks +.quality-job: &quality-job + stage: quality + <<: *uv-cache + <<: *on-merge-requests-and-main + before_script: + - uv --version + after_script: + - uv cache prune --ci + +# Python Quality Checks Job +quality-python: + <<: *quality-job + script: + - uvx nox -t quality + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-quality-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-quality-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-quality-files + +typecheck-python: + stage: typecheck + <<: *uv-cache + parallel: + matrix: + - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] + image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim + before_script: + - uv --version + script: + - uvx nox -s typecheck-$PYTHON_VERSION + after_script: + - uv cache prune --ci + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-typecheck-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-typecheck-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-typecheck-files + +# Security Checks +security-python: + stage: security + <<: *uv-cache + script: + - uvx nox -s security-python + after_script: + - uv cache prune --ci + allow_failure: true + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-security-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-security-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-security-files + +# Python Tests - Using GitLab Matrix Strategy +test-python: + stage: test + <<: *uv-cache + parallel: + matrix: + - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] + image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim + script: + - uvx nox -s tests-python-${PYTHON_VERSION//.} + after_script: + - uv cache prune --ci + artifacts: + reports: + junit: tests/results/*.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml + paths: + - tests/results/ + - coverage.xml + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-test-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-test-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-test-files + +# Cross-platform testing with macOS (GitLab.com SaaS runners) +test-python-macos: + stage: test + tags: + - saas-macos-medium-m1 + before_script: + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + script: + - uvx nox -s tests-python-3.13 + artifacts: + reports: + junit: tests/results/*.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml + paths: + - tests/results/ + - coverage.xml + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-test-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-test-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-test-files + +# Cross-platform testing with Windows (GitLab.com SaaS runners) +test-python-windows: + stage: test + tags: + - saas-windows-medium-amd64 + before_script: + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - $env:PATH += ";$env:USERPROFILE\.cargo\bin" + script: + - uvx nox -s tests-python-3.13 + artifacts: + reports: + junit: tests/results/*.xml + coverage_report: + coverage_format: cobertura + path: coverage.xml + paths: + - tests/results/ + - coverage.xml + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *python-test-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *python-test-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *python-test-files + + + +# Build Stage +build-python: + stage: build + <<: *uv-cache + script: + - uvx nox -s build-python + after_script: + - uv cache prune --ci + artifacts: + paths: + - dist/ + expire_in: 30 days + rules: + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH == "main" + - if: $CI_PIPELINE_SOURCE == "web" + +# Documentation build validation (ReadTheDocs handles hosting) +build-docs: + stage: build + <<: *uv-cache + script: + - uvx nox -s build-docs + after_script: + - uv cache prune --ci + artifacts: + paths: + - docs/_build/html/ + expire_in: 5 days + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: *docs-files + - if: $CI_COMMIT_BRANCH == "main" + changes: *docs-files + - if: $CI_PIPELINE_SOURCE == "web" + changes: *docs-files + +# Documentation build (GitLab Pages - fallback/mirror) +pages: + stage: build + <<: *uv-cache + script: + - uvx nox -s build-docs + - mv docs/_build/html public + after_script: + - uv cache prune --ci + artifacts: + paths: + - public + expire_in: 30 days + rules: + - if: $CI_COMMIT_BRANCH == "main" + changes: *docs-files + +# Test Release Job (TestPyPI) +test-release-python: + stage: release + <<: *uv-cache + script: + - export PYPI_URL=https://test.pypi.org/legacy/ + - uvx nox -s publish-python + after_script: + - uv cache prune --ci + rules: + - if: $CI_COMMIT_TAG + environment: + name: test + url: https://test.pypi.org/project/robust_python_demo/ + +# Production Release Job (PyPI) +release-python: + stage: release + <<: *uv-cache + script: + - uvx nox -s publish-python + after_script: + - uv cache prune --ci + rules: + - if: $CI_COMMIT_TAG + environment: + name: production + url: https://pypi.org/project/robust_python_demo/ + needs: + - test-release-python + when: manual diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 0000000..7a109b9 --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,568 @@ +#file: noinspection InvalidFileLocation +# bitbucket-pipelines.yml +# See https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/ +# This is currently untested serves as a best guess for an equivalent pipeline + +image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + +definitions: + caches: + uv-deps: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + path: .uv-cache + pip-deps: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + path: .cache/pip + + # Shared configuration for uv + services: + docker: + memory: 2048 + +pipelines: + # Default pipeline for pushes to any branch + default: + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + after-script: + - echo "Python quality checks completed" + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + after-script: + - echo "Security checks completed" + + # Parallel typecheck execution across Python versions + - parallel: + steps: + - step: + name: Typecheck Python 3.9 + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.9 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.10 + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.10 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.11 + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.11 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.12 + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.12 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.13 + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.13 + - uv cache prune --ci + + # Parallel test execution across Python versions and platforms + - parallel: + steps: + # Linux testing across all Python versions + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.10 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.10 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.11 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.11 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.12 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.12 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + + + # Pipeline for main/master branch + branches: + main: + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + + # Parallel typecheck execution across Python versions + - parallel: + steps: + - step: + name: Typecheck Python 3.9 + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.9 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.10 + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.10 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.11 + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.11 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.12 + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.12 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.13 + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.13 + - uv cache prune --ci + + # Parallel test execution across Python versions and platforms + - parallel: + steps: + # Linux testing across all Python versions + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.10 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.10 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.11 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.11 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.12 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.12 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + + + - step: + name: Build Package + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s build-python + - uv cache prune --ci + artifacts: + - dist/** + + # Pipeline for pull requests + pull-requests: + '**': + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + + # Parallel test execution for PRs (reduced matrix for speed) + - parallel: + steps: + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + + + # Pipeline for tags (releases) + tags: + 'v*': + - step: + name: Build Package + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s build-python + - uv cache prune --ci + artifacts: + - dist/** + + - step: + name: Publish to TestPyPI + deployment: test + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - export PYPI_URL=https://test.pypi.org/legacy/ + - uvx nox -s publish-python + - uv cache prune --ci + + - step: + name: Publish to Production PyPI + deployment: production + trigger: manual + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s publish-python + - uv cache prune --ci From dd99cecf24e00564e2b99ff2b566daf2dea14471 Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:50:23 -0400 Subject: [PATCH 4/8] Revert "chore: update demo to the latest cookiecutter-robust-python" This reverts commit 7661074cf5ccefee7719b3d4d2b2c6b251a5e83b. --- .cookiecutter.json | 2 +- .cruft.json | 4 +- .gitlab-ci.yml | 322 ----------------------- bitbucket-pipelines.yml | 568 ---------------------------------------- 4 files changed, 3 insertions(+), 893 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 bitbucket-pipelines.yml diff --git a/.cookiecutter.json b/.cookiecutter.json index 62c393b..0e8c1df 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "78aa60aa92b9fcf88f009101594a750c431c92c9", + "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index 8baf746..9603a77 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "78aa60aa92b9fcf88f009101594a750c431c92c9", + "commit": "1460377e7f5ce48155c22f32b6845546d5097664", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "78aa60aa92b9fcf88f009101594a750c431c92c9" + "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" } }, "directory": null diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 4d89a6d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,322 +0,0 @@ -# .gitlab-ci.yml -# See https://docs.gitlab.com/ee/ci/yaml/ -# This is currently untested and serves as a best guess for what might be an equivalent pipeline - -# Global settings -image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - -variables: - UV_CACHE_DIR: .uv-cache - UV_LINK_MODE: copy - PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip - -# Define stages -stages: - - quality - - typecheck - - test - - security - - build - - release - -# Global cache configuration for uv -.uv-cache: &uv-cache - cache: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - paths: - - $UV_CACHE_DIR - - $PIP_CACHE_DIR - policy: pull-push - -# Shared rules for when to run jobs -.on-merge-requests-and-main: &on-merge-requests-and-main - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - - if: $CI_COMMIT_BRANCH == "main" - - if: $CI_PIPELINE_SOURCE == "web" - -# File pattern anchors for different job types -.python-quality-files: &python-quality-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - ".ruff.toml" - - "pyrightconfig.json" - - ".gitlab-ci.yml" - -.python-typecheck-files: &python-typecheck-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - "pyrightconfig.json" - - ".gitlab-ci.yml" - -.python-security-files: &python-security-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - "bandit.yml" - - ".gitlab-ci.yml" - -.python-test-files: &python-test-files - - "src/**/*.py" - - "tests/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - ".coveragerc" - - ".gitlab-ci.yml" - -.docs-files: &docs-files - - "docs/**/*" - - "src/**/*.py" - - "noxfile.py" - - "pyproject.toml" - - ".gitlab-ci.yml" - -.rust-files: &rust-files - - "rust/**/*.rs" - - "Cargo.toml" - - ".gitlab-ci.yml" - -# Base job template for Python quality checks -.quality-job: &quality-job - stage: quality - <<: *uv-cache - <<: *on-merge-requests-and-main - before_script: - - uv --version - after_script: - - uv cache prune --ci - -# Python Quality Checks Job -quality-python: - <<: *quality-job - script: - - uvx nox -t quality - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-quality-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-quality-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-quality-files - -typecheck-python: - stage: typecheck - <<: *uv-cache - parallel: - matrix: - - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] - image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim - before_script: - - uv --version - script: - - uvx nox -s typecheck-$PYTHON_VERSION - after_script: - - uv cache prune --ci - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-typecheck-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-typecheck-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-typecheck-files - -# Security Checks -security-python: - stage: security - <<: *uv-cache - script: - - uvx nox -s security-python - after_script: - - uv cache prune --ci - allow_failure: true - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-security-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-security-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-security-files - -# Python Tests - Using GitLab Matrix Strategy -test-python: - stage: test - <<: *uv-cache - parallel: - matrix: - - PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"] - image: ghcr.io/astral-sh/uv:latest-python$PYTHON_VERSION-bookworm-slim - script: - - uvx nox -s tests-python-${PYTHON_VERSION//.} - after_script: - - uv cache prune --ci - artifacts: - reports: - junit: tests/results/*.xml - coverage_report: - coverage_format: cobertura - path: coverage.xml - paths: - - tests/results/ - - coverage.xml - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-test-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-test-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-test-files - -# Cross-platform testing with macOS (GitLab.com SaaS runners) -test-python-macos: - stage: test - tags: - - saas-macos-medium-m1 - before_script: - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - script: - - uvx nox -s tests-python-3.13 - artifacts: - reports: - junit: tests/results/*.xml - coverage_report: - coverage_format: cobertura - path: coverage.xml - paths: - - tests/results/ - - coverage.xml - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-test-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-test-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-test-files - -# Cross-platform testing with Windows (GitLab.com SaaS runners) -test-python-windows: - stage: test - tags: - - saas-windows-medium-amd64 - before_script: - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - $env:PATH += ";$env:USERPROFILE\.cargo\bin" - script: - - uvx nox -s tests-python-3.13 - artifacts: - reports: - junit: tests/results/*.xml - coverage_report: - coverage_format: cobertura - path: coverage.xml - paths: - - tests/results/ - - coverage.xml - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *python-test-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *python-test-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *python-test-files - - - -# Build Stage -build-python: - stage: build - <<: *uv-cache - script: - - uvx nox -s build-python - after_script: - - uv cache prune --ci - artifacts: - paths: - - dist/ - expire_in: 30 days - rules: - - if: $CI_COMMIT_TAG - - if: $CI_COMMIT_BRANCH == "main" - - if: $CI_PIPELINE_SOURCE == "web" - -# Documentation build validation (ReadTheDocs handles hosting) -build-docs: - stage: build - <<: *uv-cache - script: - - uvx nox -s build-docs - after_script: - - uv cache prune --ci - artifacts: - paths: - - docs/_build/html/ - expire_in: 5 days - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: *docs-files - - if: $CI_COMMIT_BRANCH == "main" - changes: *docs-files - - if: $CI_PIPELINE_SOURCE == "web" - changes: *docs-files - -# Documentation build (GitLab Pages - fallback/mirror) -pages: - stage: build - <<: *uv-cache - script: - - uvx nox -s build-docs - - mv docs/_build/html public - after_script: - - uv cache prune --ci - artifacts: - paths: - - public - expire_in: 30 days - rules: - - if: $CI_COMMIT_BRANCH == "main" - changes: *docs-files - -# Test Release Job (TestPyPI) -test-release-python: - stage: release - <<: *uv-cache - script: - - export PYPI_URL=https://test.pypi.org/legacy/ - - uvx nox -s publish-python - after_script: - - uv cache prune --ci - rules: - - if: $CI_COMMIT_TAG - environment: - name: test - url: https://test.pypi.org/project/robust_python_demo/ - -# Production Release Job (PyPI) -release-python: - stage: release - <<: *uv-cache - script: - - uvx nox -s publish-python - after_script: - - uv cache prune --ci - rules: - - if: $CI_COMMIT_TAG - environment: - name: production - url: https://pypi.org/project/robust_python_demo/ - needs: - - test-release-python - when: manual diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml deleted file mode 100644 index 7a109b9..0000000 --- a/bitbucket-pipelines.yml +++ /dev/null @@ -1,568 +0,0 @@ -#file: noinspection InvalidFileLocation -# bitbucket-pipelines.yml -# See https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/ -# This is currently untested serves as a best guess for an equivalent pipeline - -image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - -definitions: - caches: - uv-deps: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - path: .uv-cache - pip-deps: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - path: .cache/pip - - # Shared configuration for uv - services: - docker: - memory: 2048 - -pipelines: - # Default pipeline for pushes to any branch - default: - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - after-script: - - echo "Python quality checks completed" - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - after-script: - - echo "Security checks completed" - - # Parallel typecheck execution across Python versions - - parallel: - steps: - - step: - name: Typecheck Python 3.9 - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.9 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.10 - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.10 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.11 - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.11 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.12 - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.12 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.13 - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.13 - - uv cache prune --ci - - # Parallel test execution across Python versions and platforms - - parallel: - steps: - # Linux testing across all Python versions - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.10 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.10 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.11 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.11 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.12 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.12 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - - # Pipeline for main/master branch - branches: - main: - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - - # Parallel typecheck execution across Python versions - - parallel: - steps: - - step: - name: Typecheck Python 3.9 - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.9 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.10 - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.10 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.11 - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.11 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.12 - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.12 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.13 - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.13 - - uv cache prune --ci - - # Parallel test execution across Python versions and platforms - - parallel: - steps: - # Linux testing across all Python versions - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.10 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.10 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.11 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.11 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.12 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.12 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - - - step: - name: Build Package - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s build-python - - uv cache prune --ci - artifacts: - - dist/** - - # Pipeline for pull requests - pull-requests: - '**': - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - - # Parallel test execution for PRs (reduced matrix for speed) - - parallel: - steps: - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - - - # Pipeline for tags (releases) - tags: - 'v*': - - step: - name: Build Package - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s build-python - - uv cache prune --ci - artifacts: - - dist/** - - - step: - name: Publish to TestPyPI - deployment: test - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - export PYPI_URL=https://test.pypi.org/legacy/ - - uvx nox -s publish-python - - uv cache prune --ci - - - step: - name: Publish to Production PyPI - deployment: production - trigger: manual - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s publish-python - - uv cache prune --ci From 4298d32abbb6587cb8c986e56f7b157766aba8b8 Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:51:25 -0400 Subject: [PATCH 5/8] chore: update demo to the latest cookiecutter-robust-python --- .cookiecutter.json | 2 +- .cruft.json | 4 +- bitbucket-pipelines.yml | 568 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 571 insertions(+), 3 deletions(-) create mode 100644 bitbucket-pipelines.yml diff --git a/.cookiecutter.json b/.cookiecutter.json index 0e8c1df..75bda08 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "_commit": "26528cc9f25b5ee8c8cc20bd3de62037a0d3fa37", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index 9603a77..381921b 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "commit": "26528cc9f25b5ee8c8cc20bd3de62037a0d3fa37", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" + "_commit": "26528cc9f25b5ee8c8cc20bd3de62037a0d3fa37" } }, "directory": null diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 0000000..7a109b9 --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,568 @@ +#file: noinspection InvalidFileLocation +# bitbucket-pipelines.yml +# See https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/ +# This is currently untested serves as a best guess for an equivalent pipeline + +image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + +definitions: + caches: + uv-deps: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + path: .uv-cache + pip-deps: + key: + files: + - pyproject.toml + - uv.lock + - requirements*.txt + - "**/requirements*.txt" + path: .cache/pip + + # Shared configuration for uv + services: + docker: + memory: 2048 + +pipelines: + # Default pipeline for pushes to any branch + default: + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + after-script: + - echo "Python quality checks completed" + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + after-script: + - echo "Security checks completed" + + # Parallel typecheck execution across Python versions + - parallel: + steps: + - step: + name: Typecheck Python 3.9 + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.9 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.10 + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.10 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.11 + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.11 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.12 + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.12 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.13 + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.13 + - uv cache prune --ci + + # Parallel test execution across Python versions and platforms + - parallel: + steps: + # Linux testing across all Python versions + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.10 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.10 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.11 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.11 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.12 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.12 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + + + # Pipeline for main/master branch + branches: + main: + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + + # Parallel typecheck execution across Python versions + - parallel: + steps: + - step: + name: Typecheck Python 3.9 + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.9 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.10 + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.10 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.11 + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.11 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.12 + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.12 + - uv cache prune --ci + + - step: + name: Typecheck Python 3.13 + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s typecheck-3.13 + - uv cache prune --ci + + # Parallel test execution across Python versions and platforms + - parallel: + steps: + # Linux testing across all Python versions + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.10 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.10 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.11 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.11 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.12 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.12 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + artifacts: + - tests/results/*.xml + - coverage.xml + + + + - step: + name: Build Package + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s build-python + - uv cache prune --ci + artifacts: + - dist/** + + # Pipeline for pull requests + pull-requests: + '**': + - step: + name: Python Quality Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uv --version + - uvx nox -t quality + - uv cache prune --ci + + + + - step: + name: Security Checks + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s security-python + - uv cache prune --ci + + # Parallel test execution for PRs (reduced matrix for speed) + - parallel: + steps: + - step: + name: Test Python 3.9 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.9 + - uv cache prune --ci + + - step: + name: Test Python 3.13 (Linux) + image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + # Cross-platform testing with latest Python + - step: + name: Test Python 3.13 (macOS) + runs-on: macos + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - curl -LsSf https://astral.sh/uv/install.sh | sh + - export PATH="$PATH:$HOME/.cargo/bin" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + - step: + name: Test Python 3.13 (Windows) + runs-on: windows + script: + - set UV_CACHE_DIR=.uv-cache + - set UV_LINK_MODE=copy + - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" + - uvx nox -s tests-python-3.13 + - uv cache prune --ci + + + + # Pipeline for tags (releases) + tags: + 'v*': + - step: + name: Build Package + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s build-python + - uv cache prune --ci + artifacts: + - dist/** + + - step: + name: Publish to TestPyPI + deployment: test + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - export PYPI_URL=https://test.pypi.org/legacy/ + - uvx nox -s publish-python + - uv cache prune --ci + + - step: + name: Publish to Production PyPI + deployment: production + trigger: manual + caches: + - uv-deps + - pip-deps + script: + - export UV_CACHE_DIR=.uv-cache + - export UV_LINK_MODE=copy + - uvx nox -s publish-python + - uv cache prune --ci From 1f8890dee45e69d7e027e439b002ae1eaa5831c6 Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:52:55 -0400 Subject: [PATCH 6/8] Revert "chore: update demo to the latest cookiecutter-robust-python" This reverts commit 4298d32abbb6587cb8c986e56f7b157766aba8b8. --- .cookiecutter.json | 2 +- .cruft.json | 4 +- bitbucket-pipelines.yml | 568 ---------------------------------------- 3 files changed, 3 insertions(+), 571 deletions(-) delete mode 100644 bitbucket-pipelines.yml diff --git a/.cookiecutter.json b/.cookiecutter.json index 75bda08..0e8c1df 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "26528cc9f25b5ee8c8cc20bd3de62037a0d3fa37", + "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index 381921b..9603a77 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "26528cc9f25b5ee8c8cc20bd3de62037a0d3fa37", + "commit": "1460377e7f5ce48155c22f32b6845546d5097664", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "26528cc9f25b5ee8c8cc20bd3de62037a0d3fa37" + "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" } }, "directory": null diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml deleted file mode 100644 index 7a109b9..0000000 --- a/bitbucket-pipelines.yml +++ /dev/null @@ -1,568 +0,0 @@ -#file: noinspection InvalidFileLocation -# bitbucket-pipelines.yml -# See https://support.atlassian.com/bitbucket-cloud/docs/get-started-with-bitbucket-pipelines/ -# This is currently untested serves as a best guess for an equivalent pipeline - -image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - -definitions: - caches: - uv-deps: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - path: .uv-cache - pip-deps: - key: - files: - - pyproject.toml - - uv.lock - - requirements*.txt - - "**/requirements*.txt" - path: .cache/pip - - # Shared configuration for uv - services: - docker: - memory: 2048 - -pipelines: - # Default pipeline for pushes to any branch - default: - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - after-script: - - echo "Python quality checks completed" - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - after-script: - - echo "Security checks completed" - - # Parallel typecheck execution across Python versions - - parallel: - steps: - - step: - name: Typecheck Python 3.9 - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.9 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.10 - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.10 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.11 - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.11 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.12 - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.12 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.13 - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.13 - - uv cache prune --ci - - # Parallel test execution across Python versions and platforms - - parallel: - steps: - # Linux testing across all Python versions - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.10 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.10 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.11 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.11 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.12 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.12 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - - # Pipeline for main/master branch - branches: - main: - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - - # Parallel typecheck execution across Python versions - - parallel: - steps: - - step: - name: Typecheck Python 3.9 - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.9 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.10 - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.10 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.11 - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.11 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.12 - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.12 - - uv cache prune --ci - - - step: - name: Typecheck Python 3.13 - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s typecheck-3.13 - - uv cache prune --ci - - # Parallel test execution across Python versions and platforms - - parallel: - steps: - # Linux testing across all Python versions - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.10 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.10-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.10 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.11 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.11-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.11 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.12 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.12-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.12 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - artifacts: - - tests/results/*.xml - - coverage.xml - - - - - step: - name: Build Package - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s build-python - - uv cache prune --ci - artifacts: - - dist/** - - # Pipeline for pull requests - pull-requests: - '**': - - step: - name: Python Quality Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uv --version - - uvx nox -t quality - - uv cache prune --ci - - - - - step: - name: Security Checks - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s security-python - - uv cache prune --ci - - # Parallel test execution for PRs (reduced matrix for speed) - - parallel: - steps: - - step: - name: Test Python 3.9 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.9-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.9 - - uv cache prune --ci - - - step: - name: Test Python 3.13 (Linux) - image: ghcr.io/astral-sh/uv:latest-python3.13-bookworm-slim - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - # Cross-platform testing with latest Python - - step: - name: Test Python 3.13 (macOS) - runs-on: macos - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$PATH:$HOME/.cargo/bin" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - - step: - name: Test Python 3.13 (Windows) - runs-on: windows - script: - - set UV_CACHE_DIR=.uv-cache - - set UV_LINK_MODE=copy - - powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - uvx nox -s tests-python-3.13 - - uv cache prune --ci - - - - # Pipeline for tags (releases) - tags: - 'v*': - - step: - name: Build Package - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s build-python - - uv cache prune --ci - artifacts: - - dist/** - - - step: - name: Publish to TestPyPI - deployment: test - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - export PYPI_URL=https://test.pypi.org/legacy/ - - uvx nox -s publish-python - - uv cache prune --ci - - - step: - name: Publish to Production PyPI - deployment: production - trigger: manual - caches: - - uv-deps - - pip-deps - script: - - export UV_CACHE_DIR=.uv-cache - - export UV_LINK_MODE=copy - - uvx nox -s publish-python - - uv cache prune --ci From 03130bb9c2b4730127d8547b4886816398fd87dd Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:54:56 -0400 Subject: [PATCH 7/8] chore: update demo to the latest cookiecutter-robust-python --- .cookiecutter.json | 2 +- .cruft.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.cookiecutter.json b/.cookiecutter.json index 0e8c1df..e397858 100644 --- a/.cookiecutter.json +++ b/.cookiecutter.json @@ -1,5 +1,5 @@ { - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "_commit": "a6b393f77763f21fffba1b3c994c772bba8ef19b", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", "add_rust_extension": false, "author": "Kyle Oliver", diff --git a/.cruft.json b/.cruft.json index 9603a77..c9378dc 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "commit": "1460377e7f5ce48155c22f32b6845546d5097664", + "commit": "a6b393f77763f21fffba1b3c994c772bba8ef19b", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "license": "MIT", "development_status": "Development Status :: 1 - Planning", "_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python", - "_commit": "1460377e7f5ce48155c22f32b6845546d5097664" + "_commit": "a6b393f77763f21fffba1b3c994c772bba8ef19b" } }, "directory": null From 6685f0b8162b80e55f93c7a5cbb54e97b7d92fda Mon Sep 17 00:00:00 2001 From: Kyle Oliver Date: Fri, 1 Aug 2025 16:55:21 -0400 Subject: [PATCH 8/8] =?UTF-8?q?bump:=20version=200.22.0=20=E2=86=92=200.23?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28c2dfc..ac13726 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +## v0.23.0 (2025-08-01) + +## v0.21.0 (2025-07-27) + +## v0.20.0 (2025-07-27) + +## v0.19.0 (2025-07-27) + +## v0.18.0 (2025-07-27) + +## v0.17.0 (2025-07-26) + +## v0.16.0 (2025-07-26) + +## v0.14.0 (2025-07-18) + +## v0.13.0 (2025-07-18) + +## v0.12.0 (2025-07-18) + +## v0.11.0 (2025-07-18) + +## v0.10.0 (2025-07-18) + +## v0.9.0 (2025-07-18) + +## v0.8.0 (2025-07-18) + +## v0.7.0 (2025-07-18) + +## v0.6.0 (2025-07-18) + +## v0.5.0 (2025-07-18) + +## v0.4.0 (2025-07-18) + +## v0.3.0 (2025-07-16) + ## v0.22.0 (2025-07-29) ## v0.21.0 (2025-07-27) diff --git a/pyproject.toml b/pyproject.toml index 4b83aa7..3fcfe0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "robust-python-demo" -version = "0.22.0" +version = "0.23.0" description = "robust-python-demo" authors = [ { name = "Kyle Oliver", email = "56kyleoliver+cookiecutter-robust-python@gmail.com" }, diff --git a/uv.lock b/uv.lock index 4679448..95b4b5d 100644 --- a/uv.lock +++ b/uv.lock @@ -1092,7 +1092,7 @@ wheels = [ [[package]] name = "robust-python-demo" -version = "0.22.0" +version = "0.23.0" source = { editable = "." } dependencies = [ { name = "loguru" },