From aa84287a748f7ecb1e96fdd87960396d96d99091 Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Fri, 9 May 2025 21:26:28 +0200 Subject: [PATCH 1/4] feat: update dependencies to support python 3.12 --- pytest.ini | 1 + setup.py | 19 +++++++++++-------- tox.ini | 11 +---------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/pytest.ini b/pytest.ini index 854c392..2cf510f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,4 @@ filterwarnings = ignore::DeprecationWarning python_classes = TestSuite* +asyncio_mode = auto diff --git a/setup.py b/setup.py index 1432bf3..4e7ab1f 100644 --- a/setup.py +++ b/setup.py @@ -27,10 +27,10 @@ "Operating System :: Microsoft", "Operating System :: POSIX", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python", @@ -58,10 +58,12 @@ "async_timeout", "psycopg[pool]>=3.0,<4", "aiopg[sa]~=1.4.0", - "asyncpg~=0.29.0", - "pytest~=6.2.5", + "asyncpg~=0.30.0", + "pytest~=8.2.0", "pytest-cov~=3.0.0", - "aiomisc~=15.2.4", + "pytest-asyncio~=0.26.0", + "aiomisc~=17.7.7", + "aiomisc-pytest~=1.2.1", "mock~=4.0.1", "sqlalchemy[asyncio]~=1.4.27", ], @@ -69,11 +71,12 @@ "async_timeout", "psycopg[pool]>=3.0,<4", "aiopg[sa]~=1.4.0", - "asyncpg~=0.27.0", - "pytest~=6.2.5", + "asyncpg~=0.30.0", + "pytest~=8.2.0", "pytest-cov~=3.0.0", - "pylama~=7.7.1", - "aiomisc~=15.2.4", + "pytest-asyncio~=0.26.0", + "aiomisc~=17.7.7", + "aiomisc-pytest~=1.2.1", "mock~=4.0.3", "sqlalchemy[asyncio]~=1.4.27", "black~=21.9b0", diff --git a/tox.ini b/tox.ini index c887bc8..dc7d632 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint,mypy,py3{8,9,10,11}{,-uvloop} +envlist = lint,mypy,py3{9,10,11,12}{,-uvloop} [testenv] passenv = COVERALLS_*, FORCE_COLOR, PG_DSN @@ -16,15 +16,6 @@ commands= tests - coveralls -[testenv:lint] -allowlist_externals = pylama -deps = - pyflakes==2.4.0 - pylama - -commands= - pylama -o pylama.ini hasql tests - [testenv:checkdoc] deps = collective.checkdocs From c3312cd066e1cb35ec885e4ec4441d379812dfc1 Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Fri, 9 May 2025 21:33:35 +0200 Subject: [PATCH 2/4] fix: replace pylama with ruff, fix python version in ci --- .github/workflows/tox.yml | 2 +- pylama.ini | 8 -------- ruff.toml | 10 ++++++++++ setup.py | 1 + tox.ini | 8 ++++++++ 5 files changed, 20 insertions(+), 9 deletions(-) delete mode 100644 pylama.ini create mode 100644 ruff.toml diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index ba6a3b2..961342f 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -46,10 +46,10 @@ jobs: matrix: toxenv: - - py38 - py39 - py310 - py311 + - py312 steps: - uses: actions/checkout@v2 diff --git a/pylama.ini b/pylama.ini deleted file mode 100644 index 3558601..0000000 --- a/pylama.ini +++ /dev/null @@ -1,8 +0,0 @@ -[pylama] -linters = mccabe,pycodestyle,pyflakes -skip = venv/* - -[pylama:pycodestyle] -max_line_length = 80 -show-pep8 = True -show-source = True diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..1a85b6b --- /dev/null +++ b/ruff.toml @@ -0,0 +1,10 @@ +line-length = 80 +target-version = "py39" + +[lint] +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "C90", # mccabe + "F", # pyflakes +] \ No newline at end of file diff --git a/setup.py b/setup.py index 4e7ab1f..ffdc794 100644 --- a/setup.py +++ b/setup.py @@ -81,6 +81,7 @@ "sqlalchemy[asyncio]~=1.4.27", "black~=21.9b0", "tox~=3.24", + "ruff~=0.11.9", "twine", "wheel", "types-psycopg2", diff --git a/tox.ini b/tox.ini index dc7d632..c838d8f 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,14 @@ commands= tests - coveralls +[testenv:lint] +allowlist_externals = ruff +deps = + ruff + +commands= + ruff check hasql tests + [testenv:checkdoc] deps = collective.checkdocs From 8fed6bc8f3bbbafd1554ce59be1dd959632cdab9 Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Fri, 9 May 2025 21:40:34 +0200 Subject: [PATCH 3/4] ci: use container instead of uses syntax --- .github/workflows/tox.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 961342f..98de84d 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -10,6 +10,7 @@ jobs: lint: runs-on: ubuntu-latest + container: snakepacker/python:all strategy: matrix: @@ -19,17 +20,16 @@ jobs: - mypy steps: - - uses: actions/checkout@v2 - - name: tox ${{ matrix.linter }} - uses: docker://snakepacker/python:all + - uses: actions/checkout@v4 + - name: Run tox ${{ matrix.linter }} + run: tox env: TOXENV: ${{ matrix.linter }} - with: - args: tox build: needs: lint runs-on: ubuntu-latest + container: snakepacker/python:all services: postgres: @@ -52,14 +52,11 @@ jobs: - py312 steps: - - uses: actions/checkout@v2 - - - name: tox ${{ matrix.toxenv }} - uses: docker://snakepacker/python:all + - uses: actions/checkout@v4 + - name: Run tox ${{ matrix.toxenv }} + run: tox env: FORCE_COLOR: 1 TOXENV: ${{ matrix.toxenv }} PG_DSN: postgres://test:test@postgres:5432/test COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - with: - args: /bin/bash -c "wait-for-port postgres:5432 && tox" From 9892ce503e46947f08fff506b1337d356b56df2b Mon Sep 17 00:00:00 2001 From: Anfimov Dima Date: Fri, 9 May 2025 23:05:12 +0200 Subject: [PATCH 4/4] fix: update mypy version, because old version produces error during psycopg check --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c838d8f..f59a088 100644 --- a/tox.ini +++ b/tox.ini @@ -38,7 +38,7 @@ basepython = python3.10 usedevelop = true deps = - mypy==1.5.1 + mypy==1.15.0 commands = mypy --install-types --non-interactive hasql tests