From a97baa3bc2cc191ca8b55a7dc38c6ec53629639e Mon Sep 17 00:00:00 2001 From: altissimo Date: Mon, 26 Oct 2026 11:35:56 -0400 Subject: [PATCH] chore: publish to PyPI as altissimo-customerio - Add publish.yaml (as in sendgrid-python and shippo-tracking): v* tags are tested, checked against the package version, built, and uploaded to PyPI via Trusted Publishing (environment: pypi); workflow_dispatch uploads the current branch to TestPyPI (environment: testpypi) - Add renovate.json matching the sibling repos, replacing Dependabot - Require poetry-core>=2.2, use Poetry 2.4.1 and commit-pinned actions in CI; drop the License classifier superseded by the SPDX license expression - Add PyPI install notes to the README and the 0.4.0 CHANGELOG entry Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CDMxuV2fXnLmpJG3tgv2Yu --- .github/dependabot.yml | 10 ----- .github/workflows/ci.yml | 18 ++++----- .github/workflows/publish.yaml | 72 ++++++++++++++++++++++++++++++++++ CHANGELOG.md | 17 ++++++++ README.md | 5 ++- pyproject.toml | 4 +- renovate.json | 29 ++++++++++++++ 7 files changed, 132 insertions(+), 23 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/publish.yaml create mode 100644 renovate.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index abd2e58..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - - package-ecosystem: pip - directory: / - schedule: - interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81e3b49..d0e8df6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.13" - - run: pipx install poetry==2.0.1 + - run: pipx install poetry==2.4.1 - run: poetry sync - run: poetry run pre-commit run --all-files @@ -24,11 +24,11 @@ jobs: matrix: python-version: ["3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} - - run: pipx install poetry==2.0.1 + - run: pipx install poetry==2.4.1 - run: poetry sync - run: poetry run pytest --cov=altissimo --cov-report=term-missing --cov-fail-under=80 @@ -36,9 +36,9 @@ jobs: needs: [lint, test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.13" - - run: pipx install poetry==2.0.1 + - run: pipx install poetry==2.4.1 - run: poetry build diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..12fb524 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,72 @@ +name: Build and publish to PyPI + +on: + push: + tags: + - "v*" + # Run by hand to publish the current branch to TestPyPI, to check the package + # before a release + workflow_dispatch: + +jobs: + build: + name: Test and build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: "3.13" + - run: pipx install poetry==2.4.1 + - run: poetry sync --with dev --all-extras + - run: poetry run pytest -q + - name: Check the tag matches the package version + if: startsWith(github.ref, 'refs/tags/') + run: | + version="$(poetry version -s)" + if [ "${GITHUB_REF_NAME}" != "v${version}" ]; then + echo "Tag ${GITHUB_REF_NAME} does not match package version ${version}" >&2 + exit 1 + fi + - run: poetry build + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: package-dist + path: dist + + publish: + name: Publish to PyPI + needs: build + # Only publish tags from this repo. Forks can't publish. + if: github.repository == 'altissimo-hq/customerio-python' && startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + environment: pypi + permissions: + # Mandatory for PyPI Trusted Publishing + id-token: write + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: package-dist + path: dist + - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + + publish-test: + name: Publish to TestPyPI + needs: build + if: github.repository == 'altissimo-hq/customerio-python' && github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + environment: testpypi + permissions: + # Mandatory for PyPI Trusted Publishing + id-token: write + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: package-dist + path: dist + - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: https://test.pypi.org/legacy/ + # A version can only be uploaded once, so reruns skip it + skip-existing: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 8051ecb..2ca77c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.4.0] - 2026-10-23 +First release published to PyPI, as `altissimo-customerio`. The import name is +unchanged (`altissimo.customerio`). + ### Added - `tracked` and `disable_message_retention` on `send_email()`, `send_text()` and @@ -15,6 +18,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 message's dashboard setting, and `False` is forwarded rather than treated as unset. They let a caller set tracking and body retention from code, since Customer.io's API cannot change a message's own settings. +- A publish workflow: tagged releases (`v*`) are tested, checked against the + package version, built, and uploaded to PyPI through Trusted Publishing + (environment `pypi`). Running it by hand uploads the current branch to + TestPyPI (environment `testpypi`). +- Renovate configuration: a monthly grouped PR for minor/patch updates, monthly + `poetry.lock` maintenance, and security fixes at any time. This replaces + Dependabot. + +### Changed + +- The build requires `poetry-core>=2.2`, and CI uses Poetry 2.4.1 with actions + pinned by commit. +- Dropped the License trove classifier (superseded by the SPDX `license` + expression) and the redundant `[tool.poetry] name`. ## [0.3.1] - 2026-09-15 diff --git a/README.md b/README.md index 6da51c5..19014a0 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ Customer.io transactional email and messaging client for Altissimo Python projec ## Installation +Published on PyPI as [`altissimo-customerio`](https://pypi.org/project/altissimo-customerio/); +the import name is `altissimo.customerio`. + ```bash -pip install altissimo-customerio[customerio] # core + Customer.io SDK +pip install "altissimo-customerio[customerio]" # core + Customer.io SDK ``` ## Quick Start diff --git a/pyproject.toml b/pyproject.toml index 6442c3d..8cbde70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,6 @@ keywords = ["customerio", "email", "altissimo", "transactional"] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -32,11 +31,10 @@ Issues = "https://github.com/altissimo-hq/customerio-python/issues" Changelog = "https://github.com/altissimo-hq/customerio-python/blob/main/CHANGELOG.md" [build-system] -requires = ["poetry-core>=2.0"] +requires = ["poetry-core>=2.2.0,<3.0.0"] build-backend = "poetry.core.masonry.api" [tool.poetry] -name = "altissimo-customerio" packages = [ { include = "altissimo", from = "src" }, ] diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..f478d18 --- /dev/null +++ b/renovate.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended", ":dependencyDashboard"], + "schedule": ["before 6am on the first day of the month"], + "prConcurrentLimit": 5, + "packageRules": [ + { + "description": "One PR per month for all minor/patch bumps; majors stay separate.", + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "groupName": "all non-major dependencies", + "groupSlug": "all-minor-patch" + } + ], + "lockFileMaintenance": { + "description": "Refresh poetry.lock so transitive deps (where the security alerts live) get picked up.", + "enabled": true, + "schedule": ["before 6am on the first day of the month"] + }, + "vulnerabilityAlerts": { + "description": "Security fixes bypass the monthly schedule.", + "schedule": ["at any time"], + "labels": ["security"] + }, + "osvVulnerabilityAlerts": true, + "pyenv": { + "description": ".python-version is the local dev interpreter, not a dependency.", + "enabled": false + } +}