Skip to content

Commit 435fa56

Browse files
xSAVIKxpre-commit-ci[bot]PlugaruTarchy-rock3t-cloudclaude
authored
Release v2 (#280)
* chore: V2 migrate to uv (#239) * Migrate project to rye and ruff for v2 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Just run ruff Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Add the core package stub Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Move cloudevents to v1 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Add extra rye configs. update locks to be OS-aware Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Migrate from rye to uv Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Use python 3.12 by default for linting Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Do not mention rye in docs Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use stricter mypy rules. exclude v1 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Run isort, flake8 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * fix isort Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Run ruff with isort Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Move mypy config to pyproject Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Exclude samples as well Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Exclude samples as well Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Fix mypy pre-commit setup Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: remove last mentions of py38 (#244) Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat: base `CloudEvent` class as per v1 specs, including attribute validation (#242) * feat: base `CloudEvent` class as per v1 specs, including attribute validation Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: add typings and docstrings Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Add support for custom extension names and validate them Signed-off-by: Tudor <plugaru.tudor@protonmail.com> * chore: Add copyright and fix missing type info Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Add getters for attributes and test happy path Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * fix: typing Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Split validation logic into smaller methods Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Add method to extract extension by name Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: configure ruff to sort imports also Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Returns all the errors at ones instead of raising early. Improve tests Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * fix missing type info Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Improve exceptions handling. Have exceptions grouped by attribute name and typed exceptions Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Skip type checing for getters of required attributes We can't use TypedDict here becuase it does not allow for arbitrary keys which we need in order to support custom extension attributes. Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * fix: missing type Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Improve exceptions and introduce a new one for invalid values Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * fix: str representation for validation error Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: Fix missing type definitions Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * small fix Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * remove cast of defaultdict to dict Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> Signed-off-by: Tudor <plugaru.tudor@protonmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: implementation for JSON format. (#245) * feat: draft implementation for JSON format. Only CloudEvent serialization included. Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * Implement read method Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * small fix to read method Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * wrap up JSON format completely and make it compliant with the spec Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * add type annotations Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore(docs): move docstrings from implementation to protocol class Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore(docs): document Format protocol Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: drop support for PY3.19 and run tests for 3.13 and 3.14 (#252) * chore: drop support for PY3.9 since it reached EOL Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: run tests for 3.13 and 3.14 Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: update docs Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: update actions to latest version Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat: implement http bindings (#251) * chore: fix uv lock warnings Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat: implement http bindings Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: fix mypy in tests Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: more mypy fixes Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: another try Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: switch from using `Dict` to `dict` for type hints Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: switch type hints to use `|` rather than `Union` Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * refactor: simplify header normalization in from_http function Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * refactor: streamline header normalization in from_binary function Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * refactor: remove redundant comment in from_binary function Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat(v2): full implementation for kafka bindings (#253) * feat: full implementation of kafka bindings Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: no need to re-export functions from core module. let users explicitly import Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat(v2): Full AMQP spec implementation (#254) * feat(v2): full AMQP 1.0 implementation Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat(v2): Support both `_` and `:` when reading AMQP messages Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: define type alias for EventFactory and use it everywhere Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: provide simplified interface to read/write CE for both binary and structured even formats (#255) * chore: provide simplified interface to read/write CE for both binary and structured even formats Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * fix typing Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: v2 upgrade tooling (#257) * refactor(config): update dependencies and dev tools versions Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * refactor(workflows): update GitHub Actions and OS versions in workflows Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs(releasing): simplify and update releasing guidelines Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs(github): enhance pull request template with detailed guidelines and checklist Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(pypi): add support for `v2` branch in release workflow and streamline build/publish process using `uv` (#259) Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * fix(workflow): update PyPI release commands for clarity and efficiency Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore: simplified interface to read/write CE using AMQP bindings. (#262) Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * feat(v2): add support for spec version 0.3 (#261) * feat: add support for spec version 0.3 Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: make ruff fail on unused imports Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: Move spec version constants to spec module Moves SPECVERSION_V1_0 and SPECVERSION_V0_3 from the core __init__.py to a new cloudevents.core.spec module. Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> --------- Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: add migration.md file (#263) Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> * chore: add default values for `id`, `time` and `specversion` (#264) * chore: add default values for `id`, `time` and `specversion` Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> * Update MIGRATION.md Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> * chore: update docstrings Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> --------- Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> * fix(http): use spec-compliant percent-encoding for HTTP header values (#268) Per CloudEvents HTTP binding spec (section 3.1.3.2), only these should be percent-encoded: space (U+0020), double-quote (U+0022), percent (U+0025), and characters outside printable ASCII (U+0021-U+007E). Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> * fix(kafka): fix header encoding and partitionkey handling in binary mode (#269) * fix(kafka): headers don't need encoding as per kafka binding spec Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> * fix(kafka): partitionkey shall still be passed in kafka headers in binary mode. Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> --------- Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> * fix: correct isinstance check to include bytearray in kafka conversion (#267) The isinstance check in to_structured had a duplicate `bytes` entry instead of `bytearray`, meaning bytearray data would not be correctly base64-encoded in the structured kafka message. Signed-off-by: Artem Muterko <artem@sopho.tech> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * chore(cloudevents): bump version to 2.0.0-alpha2 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(CHANGELOG): add missing PR link Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Update samples (#272) * refactor(samples): update to `cloudevents` 2.0.0a1 and modernize usage - Migrated to `cloudevents` 2.0.0a1 including updated imports and APIs. - Replaced deprecated `from_http`, `to_binary`, and `to_structured` with the new `from_http_event`, `to_binary_event`, and `to_structured_event`. - Added required `id` and `specversion` attributes to Cloudevents examples. - Updated README and client script for consistency and improved usability. Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * refactor(samples): migrate to `cloudevents` 2.0.0a1 and enhance examples - Updated server, client, and test code to use the updated `cloudevents` 2.0.0a1 API with `from_http_event`, `to_binary_event`, and `to_structured_event`. - Included required `id` and `specversion` attributes in Cloudevent examples. - Synchronized README and scripts for better clarity and usability. - Pinned `cloudevents==2.0.0a1` in `requirements.txt`. Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(samples): bump `cloudevents` to 2.0.0a2 in requirements Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(cloudevents): bump version to 2.0.0-alpha3 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(samples): update `cloudevents` to 2.0.0a3 in requirements Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(CHANGELOG): update for CloudEvents v2 readiness (PR #273) Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> chore(cloudevents): bump version to 2.0.0-alpha4 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> chore(tox): remove tox configuration file Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Ensure spec compatibility - fix 2 edge cases (#275) * fix(event): validate attributes for null or empty values Ensure required attributes ('id', 'source', and 'type') are neither null nor empty across v03 and v1 event versions. Includes stricter validation and new test cases. Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * fix(event): remove max length restriction for extension attributes Remove the 20-character maximum length restriction for extension attribute names in both v03 and v1 event versions. Update validation error messages and add tests to ensure compatibility with longer attribute names. Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(cloudevents): bump version to 2.0.0-alpha5 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(CHANGELOG): update for 2.0.0-alpha5 with PR #275 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Fix v1 compatibility layer and update docs (#276) * fix: standardize import paths from `cloudevents_v1` to `cloudevents.v1` to fix compatibility layer Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(dependencies): add `deprecation` package with version constraint `>=2.0,<3.0` for v1 compat layer Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(tests): relocate v1 test files to `test_v1_compat` directory for improved organization Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(dependencies): update `uv.lock` to add new dependencies and version constraints for libraries including `anyio`, `sanic`, `pydantic`, and others Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(dependencies): reorganize `deprecation` imports across deprecated `v1` modules for consistency Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(tests): standardize import formatting across `test_v1_compat` files for consistency Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs(migration): add guidance for using `cloudevents.v1` compatibility layer Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * docs(migration): update `MIGRATION.md` with clarified import mappings, format protocol, and v2 API changes Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(tests): add missing `pytest` import in `test_base_events` Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(tests): add `pytest_ignore_collect` to skip `pydantic` tests on Python 3.14+ Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Update tooling (#278) * chore(pre-commit): bump ruff-pre-commit to v0.15.7 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(pyproject): include MIGRATION.md in build targets Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(dependencies): bump dev dependencies (ruff, isort, pytest-cov, types-python-dateutil) Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(workflows): bump GitHub Actions dependencies Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(dependencies): bump cloudevents to 2.0.0-alpha6 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(CHANGELOG): add entries for v2.0.0-alpha6 changes and fixes Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Prepare v2 (#279) * chore(pre-commit): update mypy exclude to ignore test_v1_compat Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(cloudevents): release stable v2.0.0 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * chore(workflow): remove deprecated branch 'v2' from PyPI release triggers Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> Signed-off-by: Tudor Plugaru <plugaru.tudor@protonmail.com> Signed-off-by: Tudor <plugaru.tudor@protonmail.com> Signed-off-by: PlugaruT <plugaru.tudor@protonmail.com> Signed-off-by: Artem Muterko <artem@sopho.tech> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tudor Plugaru <plugaru.tudor@protonmail.com> Co-authored-by: Archy <6429715+archy-rock3t-cloud@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 088b46c commit 435fa56

File tree

124 files changed

+10369
-740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+10369
-740
lines changed

.github/pull_request_template.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
1-
Fixes #<issuelink>
1+
<!--
2+
Thank you for contributing to the project!
23
3-
## Changes
4+
Please make sure to read the `CONTRIBUTING.md` file for our contribution guidelines:
5+
https://github.com/cloudevents/sdk-python/blob/main/CONTRIBUTING.md
6+
-->
47

8+
<!--
9+
Please provide a clear and concise description of the pull request.
10+
-->
511

6-
## One line description for the changelog
12+
**Related Issue:** #<issue_number>
713

14+
**Type of change:**
15+
<!--
16+
Please select one of the following options and delete the others.
17+
-->
18+
- Bug fix (non-breaking change which fixes an issue)
19+
- New feature (non-breaking change which adds functionality)
20+
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
21+
- This change requires a documentation update
22+
- Other (please describe):
823

9-
- [ ] Tests pass
10-
- [ ] Appropriate changes to README are included in PR
24+
**Description:**
25+
<!--
26+
Please include a summary of the change and which issue is fixed.
27+
Please also include relevant motivation and context.
28+
List any dependencies that are required for this change.
29+
-->
30+
31+
---
32+
33+
**Pre-submission checklist:**
34+
- [ ] I have read the [CONTRIBUTING.md](https://github.com/cloudevents/sdk-python/blob/main/CONTRIBUTING.md) file.
35+
- [ ] I have signed off my commits using `git commit --signoff`.
36+
- [ ] I have added tests that prove my fix is effective or that my feature works.
37+
- [ ] I have updated the documentation (`README.md`, `CHANGELOG.md`, etc.) as necessary.
38+
- [ ] I have run `pre-commit` and `tox` and all checks pass.
39+
- [ ] This pull request is ready to be reviewed.

.github/workflows/main.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,38 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6-
76
lint:
87
runs-on: ubuntu-latest
98
steps:
10-
- uses: actions/checkout@v4
11-
- name: Setup Python
12-
uses: actions/setup-python@v5
9+
- uses: actions/checkout@v6
10+
- name: Install uv
11+
uses: astral-sh/setup-uv@v7
1312
with:
14-
python-version: '3.12'
15-
cache: 'pip'
16-
cache-dependency-path: 'requirements/*.txt'
17-
- name: Install dev dependencies
18-
run: python -m pip install -r requirements/dev.txt
19-
- name: Run linting
20-
run: python -m tox -e lint,mypy,mypy-samples-image,mypy-samples-json
13+
enable-cache: true
14+
cache-dependency-glob: "uv.lock"
15+
- name: Set up Python
16+
run: uv python install 3.12
17+
- name: Install the project
18+
run: uv sync --all-extras --dev
19+
- name: Lint
20+
run: uv run ruff check --select I
2121

2222
test:
2323
strategy:
2424
matrix:
25-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
25+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2626
os: [ubuntu-latest, windows-latest, macos-latest]
2727
runs-on: ${{ matrix.os }}
2828
steps:
29-
- uses: actions/checkout@v4
30-
- name: Setup Python
31-
uses: actions/setup-python@v5
29+
- uses: actions/checkout@v6
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v7
3232
with:
33-
python-version: ${{ matrix.python }}
34-
cache: 'pip'
35-
cache-dependency-path: 'requirements/*.txt'
36-
- name: Install dev dependencies
37-
run: python -m pip install -r requirements/dev.txt
33+
enable-cache: true
34+
cache-dependency-glob: "uv.lock"
35+
- name: Set up Python ${{ matrix.python-version }}
36+
run: uv python install ${{ matrix.python-version }}
37+
- name: Install the project
38+
run: uv sync --all-extras --dev
3839
- name: Run tests
39-
run: python -m tox -e py # Run tox using the version of Python in `PATH`
40+
run: uv run pytest tests

.github/workflows/pypi-release.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,58 @@ on:
1010
jobs:
1111
build_dist:
1212
name: Build source distribution
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v7
20+
- name: Set up Python
21+
run: uv python install 3.12
22+
- name: Install the project
23+
run: uv sync --all-extras --dev
1824

1925
- name: Build SDist and wheel
20-
run: pipx run build
26+
run: uv build
2127

22-
- uses: actions/upload-artifact@v4
28+
- uses: actions/upload-artifact@v7
2329
with:
2430
name: artifact
2531
path: dist/*
2632

2733
- name: Check metadata
28-
run: pipx run twine check dist/*
34+
run: uvx twine check dist/*
2935
publish:
30-
runs-on: ubuntu-latest
36+
runs-on: ubuntu-24.04
3137
if: github.event_name == 'push'
3238
needs: [ build_dist ]
3339
steps:
34-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v6
3541
with:
3642
fetch-depth: 0
37-
- name: Set up Python
38-
uses: actions/setup-python@v5
43+
- uses: actions/download-artifact@v7
3944
with:
40-
python-version: "3.12"
41-
cache: 'pip'
42-
- name: Install build dependencies
43-
run: pip install -U setuptools wheel build
44-
- uses: actions/download-artifact@v4
45-
with:
46-
# unpacks default artifact into dist/
47-
# if `name: artifact` is omitted, the action will create extra parent dir
4845
name: artifact
4946
path: dist
5047
- name: Publish
5148
uses: pypa/gh-action-pypi-publish@release/v1
5249
with:
5350
user: __token__
5451
password: ${{ secrets.pypi_password }}
55-
attestations: false
56-
- name: Install GitPython and cloudevents for pypi_packaging
57-
run: pip install -U -r requirements/publish.txt
58-
- name: Create Tag
59-
run: python pypi_packaging.py
52+
tag:
53+
runs-on: ubuntu-24.04
54+
needs: [ publish ]
55+
steps:
56+
- uses: actions/checkout@v6
57+
with:
58+
fetch-depth: 0
59+
- name: Extract version
60+
id: version
61+
run: |
62+
echo "version=$(grep -oP '__version__ = \"\K[^\"]+' src/cloudevents/__init__.py)" >> $GITHUB_OUTPUT
63+
- name: Create and push tag
64+
uses: pxpm/github-tag-action@1.0.1
65+
with:
66+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
67+
tag: ${{ steps.version.outputs.version }}

.pre-commit-config.yaml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
77
- id: check-toml
8-
- repo: https://github.com/pycqa/isort
9-
rev: 6.0.1
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.15.7
1010
hooks:
11-
- id: isort
12-
args: [ "--profile", "black", "--filter-files" ]
13-
- repo: https://github.com/psf/black
14-
rev: 25.1.0
15-
hooks:
16-
- id: black
17-
language_version: python3.11
11+
# Run the linter.
12+
- id: ruff
13+
# Run the formatter.
14+
- id: ruff-format
1815
- repo: https://github.com/pre-commit/mirrors-mypy
19-
rev: v1.16.0
16+
rev: v1.19.1
2017
hooks:
2118
- id: mypy
22-
files: ^(cloudevents/)
23-
exclude: ^(cloudevents/tests/)
24-
types: [ python ]
25-
args: [ ]
19+
files: ^(src/cloudevents/|tests/)
20+
exclude: ^(src/cloudevents/v1/|tests/test_v1_compat/)
21+
types: [python]
22+
args: ["--config-file=pyproject.toml"]
2623
additional_dependencies:
27-
- "pydantic~=2.7"
24+
- types-python-dateutil>=2.9.0.20260305

CHANGELOG.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.0.0]
10+
11+
### Changed
12+
13+
- Released stable v2.0.0. See [migration](./MIGRATION.md) for details and migration
14+
guidelines. ([#279])
15+
16+
## [2.0.0.alpha6]
17+
18+
### Changed
19+
20+
- Updated tooling and workflows. ([#278])
21+
22+
### Fixed
23+
24+
- Fixed the v1 compatibility layer. ([#276])
25+
26+
## [2.0.0.alpha5]
27+
28+
### Changed
29+
30+
- Improved spec compatibility of attributes processing. ([#275])
31+
32+
## [2.0.0.alpha4]
33+
34+
### Changed
35+
36+
- CloudEvents v2 is ready to become the main version. ([#273])
37+
938
## [1.12.1]
1039

1140
### Changed
1241

1342
- CloudEvents v1 moved to security fixes support stage.
14-
CloudEvents v2 is a rewrite with ongoing development ([])
43+
CloudEvents v2 is a rewrite with ongoing development ([#271])
1544

1645
## [1.12.0]
1746

@@ -309,3 +338,9 @@ CloudEvents v2 is a rewrite with ongoing development ([])
309338
[#240]: https://github.com/cloudevents/sdk-python/pull/240
310339
[#248]: https://github.com/cloudevents/sdk-python/pull/248
311340
[#249]: https://github.com/cloudevents/sdk-python/pull/249
341+
[#271]: https://github.com/cloudevents/sdk-python/pull/271
342+
[#273]: https://github.com/cloudevents/sdk-python/pull/273
343+
[#275]: https://github.com/cloudevents/sdk-python/pull/275
344+
[#276]: https://github.com/cloudevents/sdk-python/pull/276
345+
[#278]: https://github.com/cloudevents/sdk-python/pull/278
346+
[#279]: https://github.com/cloudevents/sdk-python/pull/279

0 commit comments

Comments
 (0)