From 93ee6c45097876fe4378928b8499151fd1c92320 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Fri, 20 Dec 2024 10:33:52 +0800 Subject: [PATCH 1/4] Version bump to 0.2.0 --- pyproject.toml | 2 +- src/athreading/__init__.py | 2 +- tests/unit/test_athreading.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3c55701..a900b66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "athreading" -version = "0.1.2" +version = "0.2.0" description = "" authors = ["Callan Gray "] license = "BSD-3-Clause" diff --git a/src/athreading/__init__.py b/src/athreading/__init__.py index ea08d7d..2a5531d 100644 --- a/src/athreading/__init__.py +++ b/src/athreading/__init__.py @@ -4,7 +4,7 @@ from .generator import ThreadedAsyncGenerator, generate from .iterator import ThreadedAsyncIterator, iterate -__version__ = "0.1.2" +__version__ = "0.2.0" __all__ = ( diff --git a/tests/unit/test_athreading.py b/tests/unit/test_athreading.py index 3e31887..037ab63 100644 --- a/tests/unit/test_athreading.py +++ b/tests/unit/test_athreading.py @@ -4,4 +4,4 @@ def test_version(): """Check that the version is acceptable.""" - assert __version__ == "0.1.2" + assert __version__ == "0.2.0" From 8cc9c9a363c9d65ee0f89496598a71577a26adb1 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Wed, 1 Jan 2025 17:55:06 +0800 Subject: [PATCH 2/4] Run benchmarks once on CI Signed-off-by: Callan Gray --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- pyproject.toml | 12 +++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f713e4d..5e2b53d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,4 +53,25 @@ jobs: if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.13') }} uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} + + benchmark: + needs: qa + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.13 + + - name: Install Poetry + uses: abatilo/actions-poetry@v3.0.1 + with: + poetry-version: 1.2.2 + + - name: Install dependencies + run: poetry install + + - name: Run tests + run: poetry run pytest --benchmark-only diff --git a/pyproject.toml b/pyproject.toml index 0f633c7..061f1b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,4 +69,14 @@ docstring-convention = 'google' profile = "black" [tool.pytest.ini_options] -addopts = "-v --mypy -p no:warnings --cov=athreading --cov-report=html --doctest-modules --ignore=athreading/__main__.py" +addopts = [ + "-v", + "--mypy", + "-p", + "no:warnings", + "--cov=athreading", + "--cov-report=html", + "--doctest-modules", + "--benchmark-disable", + "--ignore=athreading/__main__.py" +] From 2b1ea1da364063b212ed25ee441fc2af3fca7b03 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Wed, 1 Jan 2025 18:27:19 +0800 Subject: [PATCH 3/4] Test module version Signed-off-by: Callan Gray --- tests/unit/test_athreading.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_athreading.py b/tests/unit/test_athreading.py index d0bc915..f1d64ef 100644 --- a/tests/unit/test_athreading.py +++ b/tests/unit/test_athreading.py @@ -1,8 +1,12 @@ """Tests for the main module.""" +from importlib.metadata import version + from athreading import __version__ +PACKAGE_VER = version("athreading") + -def test_version(): - """Check that the version is acceptable.""" - assert __version__ == "0.2.0" +def test_module_version(): + """Check that the module and package versions match.""" + assert __version__ == PACKAGE_VER From 728a49885c62450c6059afebe9f6993c26ef3709 Mon Sep 17 00:00:00 2001 From: Callan Gray Date: Wed, 1 Jan 2025 18:42:18 +0800 Subject: [PATCH 4/4] Add changelog Signed-off-by: Callan Gray --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2d56d41 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Version History + +## 0.2.0 + +### Added + +* Added support for python 3.13 with free threading. +* Added support for python 3.9 with nogil. +* Added support for providing explicit background executor to decorators. +* Added call and iterate benchmarks. + +### Changed + +* Added `call`, `iterate` and `generate` functions. +* Added call benchmarks.