Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 78 additions & 37 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.10']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', 'pypy3.10', 'pypy3.11']
tarantool: ['1.10', '2', '3']
exclude:
- os: macos-latest
tarantool: '1.10'
- os: macos-latest
tarantool: '2'
- os: macos-latest
python-version: '3.7'
- python-version: 'pypy3.10'
tarantool: '1.10'
- python-version: 'pypy3.11'
tarantool: '1.10'

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -40,24 +41,41 @@ jobs:
if: matrix.os == 'macos-latest'
run: brew install tarantool

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel coveralls
run: uv sync --extra test

- name: Run ruff check
run: uv run ruff check .

- name: Run ruff format check
run: uv run ruff format --check .

- name: Run tests
run: |
if [[ "$RUNNER_OS" == "Linux" && ${{ matrix.python-version }} == "3.12" && ${{ matrix.tarantool }} == "3" ]]; then
make build && make test
make clean && make debug && make coverage
# coveralls
else
make build && make lint && make quicktest
fi
run: uv run pytest .

- name: Run tests with uvloop
if: "!contains(matrix.python-version, 'pypy')"
env:
USE_UVLOOP: "1"
run: uv run pytest .

- name: Run coverage tests
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14' && matrix.tarantool == '3'
env:
ASYNCTNT_DEBUG: "1"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
run: |
make clean
uv pip install -e '.[test]'
uv run pytest --cov
./scripts/run_until_success.sh uv run coverage report -m
./scripts/run_until_success.sh uv run coverage html

build-wheels:
name: Build wheels on ${{ matrix.os }}
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -71,75 +89,100 @@ jobs:
submodules: recursive

- uses: actions/setup-python@v5
with:
python-version: '3.14'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install cibuildwheel
run: python -m pip install --upgrade cibuildwheel
run: uv tool install cibuildwheel

- name: Install pyproject-build
run: uv tool install build

- name: Build source archive
if: matrix.os == 'ubuntu-latest'
run: |
pyproject-build -s .

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
run: cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp310-*"
CIBW_ENABLE: pypy pypy-eol
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-* cp314t-* pp310-* pp311-*"

- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
path: ./dist/*

publish:
name: Publish wheels
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs:
- build-wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/asynctnt
permissions:
id-token: write # Required for trusted publishing
contents: write # Required for releases
steps:
- name: Get tag
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}

- run: echo "Current tag is ${{ steps.get_tag.outputs.TAG }}"

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.14'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine build
uv pip install --upgrade build

- uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-latest
path: wheels-ubuntu
path: dist

- uses: actions/download-artifact@v4
with:
name: wheels-macos-latest
path: wheels-macos
path: dist

- uses: actions/download-artifact@v4
with:
name: wheels-windows-latest
path: wheels-windows
path: dist

- name: Publish dist
- name: Build source archive
run: |
python -m build . -s
tree dist wheels-ubuntu wheels-macos wheels-windows
twine upload dist/* wheels-ubuntu/*.whl wheels-macos/*.whl wheels-windows/*.whl
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
tree dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true

- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: ${{ steps.get_tag.outputs.TAG }}
files: |
wheels-ubuntu/*.whl
wheels-macos/*.whl
wheels-windows/*.whl
dist/*

docs:
Expand All @@ -156,12 +199,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.14'

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
make build
- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Build docs
run: make docs
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ celerybeat-schedule
.env

# virtualenv
.venv/
.venv*/
venv/
ENV/

Expand Down Expand Up @@ -113,3 +113,10 @@ deploy_key*
cython_debug

temp
bin
include
instances.enabled
modules
templates
uv.lock
.DS_Store
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## v2.5.0
**Breaking changes**
* Dropped support for Python 3.7 and 3.8 (minimum required version is now 3.9)

**New features**
* Added support for Python 3.14, including free-threaded (no-GIL) builds
* Added support for PyPy 3.11

**Other changes**
* Upgraded Cython to 3.2.4
* Declared Cython module as `freethreading_compatible` for Python 3.13+
* Disabled C freelist in free-threaded builds to ensure thread safety

## v2.4.0
**New features**
* Added support for Python 3.13 [#37](https://github.com/igorcoding/asynctnt/issues/37)
Expand Down
81 changes: 38 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,67 +1,62 @@
.PHONY: clean build local debug annotate dist docs style mypy ruff style-check lint test quicktest coverage

PYTHON?=python

all: local

clean:
pip uninstall -y asynctnt
rm -rf asynctnt/*.c asynctnt/*.h asynctnt/*.cpp
rm -rf asynctnt/*.so asynctnt/*.html
rm -rf asynctnt/iproto/*.c asynctnt/iproto/*.h
rm -rf asynctnt/iproto/*.so asynctnt/iproto/*.html asynctnt/iproto/requests/*.html
rm -rf build *.egg-info .eggs dist
find . -name '__pycache__' | xargs rm -rf
rm -rf htmlcov
rm -rf __tnt*
rm -rf tests/__tnt*


build:
$(PYTHON) -m pip install -e '.[test,docs]'
uv pip install -e '.[test,docs]'

local:
$(PYTHON) -m pip install -e .

uv pip install -e .

debug: clean
ASYNCTNT_DEBUG=1 $(PYTHON) -m pip install -e '.[test]'

ASYNCTNT_DEBUG=1 uv pip install -e '.[test]'

annotate:
cython -3 -a asynctnt/iproto/protocol.pyx

dist:
$(PYTHON) -m build .

docs: build
$(MAKE) -C docs html
lint: style-check ruff

style:
$(PYTHON) -m black .
$(PYTHON) -m isort .
uv run --active ruff format .
uv run --active ruff check --select I,F401 --fix .

mypy:
$(PYTHON) -m mypy --enable-error-code ignore-without-code .
style-check:
uv run --active ruff format --check .

ruff:
$(PYTHON) -m ruff check .

style-check:
$(PYTHON) -m black --check --diff .
$(PYTHON) -m isort --check --diff .
uv run --active ruff check .

lint: style-check ruff
mypy:
uv run --active mypy --enable-error-code ignore-without-code .

test: lint
PYTHONASYNCIODEBUG=1 $(PYTHON) -m pytest
$(PYTHON) -m pytest
USE_UVLOOP=1 $(PYTHON) -m pytest
test:
PYTHONASYNCIODEBUG=1 uv run --active pytest
uv run --active pytest
USE_UVLOOP=1 uv run --active pytest

quicktest:
$(PYTHON) -m pytest
uv run --active pytest

coverage:
$(PYTHON) -m pytest --cov
./scripts/run_until_success.sh $(PYTHON) -m coverage report -m
./scripts/run_until_success.sh $(PYTHON) -m coverage html
uv run --active pytest --cov
./scripts/run_until_success.sh uv run --active coverage report -m
./scripts/run_until_success.sh uv run --active coverage html

dist:
uv pip install build
uv run --active python -m build .

docs: build
$(MAKE) -C docs html

clean:
uv pip uninstall asynctnt
rm -rf asynctnt/*.c asynctnt/*.h asynctnt/*.cpp
rm -rf asynctnt/*.so asynctnt/*.html
rm -rf asynctnt/iproto/*.c asynctnt/iproto/*.h
rm -rf asynctnt/iproto/*.so asynctnt/iproto/*.html asynctnt/iproto/requests/*.html
rm -rf build *.egg-info .eggs dist
find . -name '__pycache__' | xargs rm -rf
rm -rf htmlcov
rm -rf __tnt*
rm -rf tests/__tnt*
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
[![Build](https://github.com/igorcoding/asynctnt/actions/workflows/actions.yaml/badge.svg?branch=master)](https://github.com/igorcoding/asynctnt/actions)
[![PyPI](https://img.shields.io/pypi/v/asynctnt.svg)](https://pypi.python.org/pypi/asynctnt)
[![Maintainability](https://api.codeclimate.com/v1/badges/6cec8adae280cda3e161/maintainability)](https://codeclimate.com/github/igorcoding/asynctnt/maintainability)
<a href="http://tarantool.org">
<a href="https://tarantool.org">
<img src="https://avatars2.githubusercontent.com/u/2344919?v=2&s=250" align="right">
</a>

asynctnt is a high-performance [Tarantool](https://tarantool.org/) database
connector library for Python/asyncio. It was highly inspired by
[asyncpg](https://github.com/MagicStack/asyncpg) module.

asynctnt requires Python 3.7 or later and is supported for Tarantool
asynctnt requires Python 3.9 or later and is supported for Tarantool
versions 1.10+.


Expand Down
2 changes: 1 addition & 1 deletion asynctnt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
TarantoolTuple,
)

__version__ = "2.4.0"
__version__ = "2.5.0"
Loading