From 4c561770af1f2415578549d29ba704392aa87dd8 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:39:05 +0200 Subject: [PATCH 01/35] Drop support for Python 3.7. --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 74fcd88..d7464da 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Changes 3.2 (unreleased) ---------------- -- Nothing changed yet. +* Drop support for Python 3.7. 3.1 (2023-09-12) From b475167eff2fcd8443487f4e7617a120c1031517 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:39:06 +0200 Subject: [PATCH 02/35] Drop support for Python {3.7,3.8,3.9,3.10,3.11}-sqlalchemy{14,20}. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index d7464da..62e334d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Drop support for Python {3.7,3.8,3.9,3.10,3.11}-sqlalchemy{14,20}. + * Drop support for Python 3.7. From c9a1fcf75477b971e51d75fe4ca2f0afab52a4aa Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:39:08 +0200 Subject: [PATCH 03/35] Drop support for Python {3.7,3.8,3.9,3.10}-sqlalchemy{12,13.}. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 62e334d..f96e394 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Drop support for Python {3.7,3.8,3.9,3.10}-sqlalchemy{12,13.}. + * Drop support for Python {3.7,3.8,3.9,3.10,3.11}-sqlalchemy{14,20}. * Drop support for Python 3.7. From 011d370f7b90621ca7ec966f5de1bd08b72d6c8e Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:39:09 +0200 Subject: [PATCH 04/35] Drop support for Python {3.7,3.8,3.9}-sqlalchemy11. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index f96e394..96ae271 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Drop support for Python {3.7,3.8,3.9}-sqlalchemy11. + * Drop support for Python {3.7,3.8,3.9,3.10}-sqlalchemy{12,13.}. * Drop support for Python {3.7,3.8,3.9,3.10,3.11}-sqlalchemy{14,20}. From 403f89a52611281b4a7a9938d24aa61e5f56c6e5 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:39:11 +0200 Subject: [PATCH 05/35] Add support for Python 3.12. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 96ae271..1978044 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Add support for Python 3.12. + * Drop support for Python {3.7,3.8,3.9}-sqlalchemy11. * Drop support for Python {3.7,3.8,3.9,3.10}-sqlalchemy{12,13.}. From 57bf133c5529591f64f3580776df7d1ab83296ed Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:43:28 +0200 Subject: [PATCH 06/35] Configuring for zope-product --- .github/workflows/tests.yml | 19 ++++++++++++------- .meta.toml | 9 +++++---- setup.cfg | 4 +--- tox.ini | 37 ++++++++++++++++++++++++++++--------- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f22689..694508d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,16 +17,17 @@ jobs: fail-fast: false matrix: os: - - ["ubuntu", "ubuntu-20.04"] + - ["ubuntu", "ubuntu-latest"] config: # [Python version, tox env] - - ["3.9", "lint"] - - ["3.7", "py37"] + - ["3.11", "release-check"] + - ["3.11", "lint"] - ["3.8", "py38"] - ["3.9", "py39"] - ["3.10", "py310"] - ["3.11", "py311"] - - ["3.9", "coverage"] + - ["3.12", "py312"] + - ["3.11", "coverage"] runs-on: ${{ matrix.os[1] }} if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name @@ -42,13 +43,13 @@ jobs: sudo su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' sudo su - postgres -c '/usr/lib/postgresql/14/bin/createdb zope_sqlalchemy_tests' sudo su - postgres -c '/usr/lib/postgresql/14/bin/psql -l' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.config[0] }} - name: Pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} @@ -60,8 +61,12 @@ jobs: python -m pip install --upgrade pip pip install tox - name: Test + if: ${{ !startsWith(runner.os, 'Mac') }} run: | tox -f ${{ matrix.config[1] }} + - name: Test (macOS) + if: ${{ startsWith(runner.os, 'Mac') }} + run: tox -e ${{ matrix.config[1] }}-universal2 - name: Coverage if: matrix.config[1] == 'coverage' run: | diff --git a/.meta.toml b/.meta.toml index 5d4a399..d3948bf 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/zope-product [meta] template = "zope-product" -commit-id = "1dc6b9e7" +commit-id = "6e808865" [python] with-pypy = false @@ -10,15 +10,16 @@ with-sphinx-doctests = false with-windows = false with-future-python = false with-macos = false +with-docs = false [coverage] fail-under = 65 [tox] additional-envlist = [ - "py{37,38,39}-sqlalchemy11", - "py{37,38,39,310}-sqlalchemy{12,13}", - "py{37,38,39,310,311}-sqlalchemy{14,20}", + "py{38,39}-sqlalchemy11", + "py{38,39,310}-sqlalchemy{12,13}", + "py{38,39,310,311,312}-sqlalchemy{14,20}", ] testenv-deps = [ "sqlalchemy11: SQLAlchemy==1.1.*", diff --git a/setup.cfg b/setup.cfg index 66b1ca8..a7bfdb4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,5 @@ # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/zope-product -[bdist_wheel] -universal = 0 [flake8] doctests = 1 @@ -17,7 +15,7 @@ ignore = force_single_line = True combine_as_imports = True sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER -known_third_party = six, docutils, pkg_resources, pytz +known_third_party = docutils, pkg_resources, pytz known_zope = known_first_party = default_section = ZOPE diff --git a/tox.ini b/tox.ini index 3ab3475..c14b25e 100644 --- a/tox.ini +++ b/tox.ini @@ -3,20 +3,22 @@ [tox] minversion = 3.18 envlist = + release-check lint - py37 py38 py39 py310 py311 + py312 coverage - py{37,38,39}-sqlalchemy11 - py{37,38,39,310}-sqlalchemy{12,13} - py{37,38,39,310,311}-sqlalchemy{14,20} + py{38,39}-sqlalchemy11 + py{38,39,310}-sqlalchemy{12,13} + py{38,39,310,311,312}-sqlalchemy{14,20} [testenv] skip_install = true deps = + setuptools < 69 zc.buildout >= 3.0.1 wheel > 0.37 sqlalchemy11: SQLAlchemy==1.1.* @@ -24,6 +26,9 @@ deps = sqlalchemy13: SQLAlchemy==1.3.* sqlalchemy14: SQLAlchemy==1.4.* sqlalchemy20: SQLAlchemy==2.0.* +setenv = + py312: VIRTUALENV_PIP=23.1.2 + py312: PIP_REQUIRE_VIRTUALENV=0 commands_pre = !sqlalchemy20: sh -c 'if [ '{env:CI:false}' = 'true' ]; then {envbindir}/buildout -nc {toxinidir}/github_actions.cfg buildout:directory={envdir} buildout:develop={toxinidir} ; fi' !sqlalchemy20: sh -c 'if [ '{env:CI:false}' != 'true' ]; then {envbindir}/buildout -nc {toxinidir}/postgres.cfg buildout:directory={envdir} buildout:develop={toxinidir} ; fi' @@ -41,6 +46,23 @@ passenv = allowlist_externals = sh +[testenv:release-check] +description = ensure that the distribution is ready to release +basepython = python3 +skip_install = true +deps = + twine + build + check-manifest + check-python-versions >= 0.20.0 + wheel +commands_pre = +commands = + check-manifest + check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml + python -m build --sdist --no-isolation + twine check dist/* + [testenv:lint] basepython = python3 commands_pre = @@ -50,11 +72,7 @@ allowlist_externals = commands = isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py flake8 {toxinidir}/src {toxinidir}/setup.py - check-manifest - check-python-versions deps = - check-manifest - check-python-versions flake8 isort # Useful flake8 plugins that are Python and Plone specific: @@ -81,7 +99,7 @@ deps = coverage commands = mkdir -p {toxinidir}/parts/htmlcov - coverage run {envdir}/bin/test {posargs:-cv} + coverage run {envbindir}/test {posargs:-cv} coverage html coverage report -m --fail-under=65 @@ -91,6 +109,7 @@ source = zope.sqlalchemy [coverage:report] precision = 2 +ignore_errors = True exclude_lines = pragma: no cover pragma: nocover From 62698ff8b9cf6932506fff2fc55477b7a02a6cf9 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 18 Jul 2024 08:45:42 +0200 Subject: [PATCH 07/35] Update Python version support. --- CHANGES.rst | 10 ++-------- setup.py | 8 +++----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1978044..d69672a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,15 +4,9 @@ Changes 3.2 (unreleased) ---------------- -* Add support for Python 3.12. +- Add support for Python 3.12. -* Drop support for Python {3.7,3.8,3.9}-sqlalchemy11. - -* Drop support for Python {3.7,3.8,3.9,3.10}-sqlalchemy{12,13.}. - -* Drop support for Python {3.7,3.8,3.9,3.10,3.11}-sqlalchemy{14,20}. - -* Drop support for Python 3.7. +- Drop support for Python 3.7. 3.1 (2023-09-12) diff --git a/setup.py b/setup.py index 969fe8b..940c1ce 100644 --- a/setup.py +++ b/setup.py @@ -16,14 +16,12 @@ namespace_packages=['zope'], test_suite='zope.sqlalchemy.tests.test_suite', author='Laurence Rowe', - author_email='laurence@lrowe.co.uk', url='https://github.com/zopefoundation/zope.sqlalchemy', description="Minimal Zope/SQLAlchemy transaction integration", long_description=( open(os.path.join('src', 'zope', 'sqlalchemy', 'README.rst')).read() + - "\n\n" + - open('CHANGES.rst').read()), + "\n\n" + open('CHANGES.rst').read()), license='ZPL 2.1', keywords='zope zope3 sqlalchemy', classifiers=[ @@ -35,16 +33,16 @@ "License :: OSI Approved :: Zope Public License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "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", "Topic :: Database", "Topic :: Software Development :: Libraries :: Python Modules", ], - python_requires='>=3.7', + python_requires='>=3.8', install_requires=[ 'packaging', 'setuptools', From b9839b6962f287612b450555f97264d55f08c774 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 18 Sep 2024 08:05:08 +0200 Subject: [PATCH 08/35] Trigger GHA. --- CHANGES.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index d69672a..b6e070c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,6 @@ Changes - Drop support for Python 3.7. - 3.1 (2023-09-12) ---------------- From 479058310d75ad4138104bec34a9a4b9b0a1e872 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:49:14 +0200 Subject: [PATCH 09/35] Drop support for Python {3.8,3.9,3.10,3.11,3.12}-sqlalchemy{14,20}. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index faa966c..1e17a7f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Drop support for Python {3.8,3.9,3.10,3.11,3.12}-sqlalchemy{14,20}. + - Add support for Python 3.12. - Drop support for Python 3.7. From be6d62c23cf5aaed5c07ef84af099011662bc38a Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:49:15 +0200 Subject: [PATCH 10/35] Drop support for Python {3.8,3.9,3.10}-sqlalchemy{12,13.}. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 1e17a7f..97b35fa 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Drop support for Python {3.8,3.9,3.10}-sqlalchemy{12,13.}. + * Drop support for Python {3.8,3.9,3.10,3.11,3.12}-sqlalchemy{14,20}. - Add support for Python 3.12. From ded31bfa9ab527d63dc6bcd1bd6f33835b188fb4 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:49:16 +0200 Subject: [PATCH 11/35] Drop support for Python {3.8,3.9}-sqlalchemy11. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 97b35fa..ed75487 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Drop support for Python {3.8,3.9}-sqlalchemy11. + * Drop support for Python {3.8,3.9,3.10}-sqlalchemy{12,13.}. * Drop support for Python {3.8,3.9,3.10,3.11,3.12}-sqlalchemy{14,20}. From f77cd05260796624e3484e0b7d057ace177c69e6 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:49:16 +0200 Subject: [PATCH 12/35] Add support for Python 3.13. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ed75487..47ca9cd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ Changes 3.2 (unreleased) ---------------- +* Add support for Python 3.13. + * Drop support for Python {3.8,3.9}-sqlalchemy11. * Drop support for Python {3.8,3.9,3.10}-sqlalchemy{12,13.}. From 34035084351278b162b39f2161722926a90e35ce Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:52:06 +0200 Subject: [PATCH 13/35] Configuring for zope-product --- .github/workflows/pre-commit.yml | 33 +++++++++++++++ .github/workflows/tests.yml | 17 ++++---- .meta.toml | 4 +- .pre-commit-config.yaml | 28 +++++++++++++ MANIFEST.in | 1 + pyproject.toml | 22 ++++++++++ tox.ini | 69 +++++++++++--------------------- 7 files changed, 119 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..eb4f0c6 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,33 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +name: pre-commit + +on: + pull_request: + push: + branches: + - master + # Allow to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + FORCE_COLOR: 1 + +jobs: + pre-commit: + name: linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 + with: + extra_args: --all-files --show-diff-on-failure + env: + PRE_COMMIT_COLOR: always + - uses: pre-commit-ci/lite-action@v1.0.2 + if: always() + with: + msg: Apply pre-commit code formatting diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 694508d..b49f4b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,14 +20,14 @@ jobs: - ["ubuntu", "ubuntu-latest"] config: # [Python version, tox env] - - ["3.11", "release-check"] - - ["3.11", "lint"] - - ["3.8", "py38"] - - ["3.9", "py39"] - - ["3.10", "py310"] - - ["3.11", "py311"] - - ["3.12", "py312"] - - ["3.11", "coverage"] + - ["3.11", "release-check"] + - ["3.8", "py38"] + - ["3.9", "py39"] + - ["3.10", "py310"] + - ["3.11", "py311"] + - ["3.12", "py312"] + - ["3.13", "py313"] + - ["3.11", "coverage"] runs-on: ${{ matrix.os[1] }} if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name @@ -48,6 +48,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.config[0] }} + allow-prereleases: true - name: Pip cache uses: actions/cache@v4 with: diff --git a/.meta.toml b/.meta.toml index d3948bf..ab058da 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/zope-product [meta] template = "zope-product" -commit-id = "6e808865" +commit-id = "85622de1" [python] with-pypy = false @@ -19,7 +19,7 @@ fail-under = 65 additional-envlist = [ "py{38,39}-sqlalchemy11", "py{38,39,310}-sqlalchemy{12,13}", - "py{38,39,310,311,312}-sqlalchemy{14,20}", + "py{38,39,310,311,312,313}-sqlalchemy{14,20}", ] testenv-deps = [ "sqlalchemy11: SQLAlchemy==1.1.*", diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8d0156c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +minimum_pre_commit_version: '3.6' +repos: + - repo: https://github.com/pycqa/isort + rev: "5.13.2" + hooks: + - id: isort + - repo: https://github.com/hhatto/autopep8 + rev: "v2.3.1" + hooks: + - id: autopep8 + args: [--in-place, --aggressive, --aggressive] + - repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + args: [--py38-plus] + - repo: https://github.com/isidentical/teyit + rev: 0.4.3 + hooks: + - id: teyit + - repo: https://github.com/PyCQA/flake8 + rev: "7.1.1" + hooks: + - id: flake8 + additional_dependencies: + - flake8-debugger == 4.1.2 diff --git a/MANIFEST.in b/MANIFEST.in index 6c35d80..4ea108d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,7 @@ include *.rst include *.txt include buildout.cfg include tox.ini +include .pre-commit-config.yaml recursive-include src *.py include github_actions.cfg diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..edd83ca --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +# +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product + +[build-system] +requires = ["setuptools<74"] +build-backend = "setuptools.build_meta" + +[tool.coverage] +[tool.coverage.run] +branch = true +source = ["zope.sqlalchemy"] + +[tool.coverage.report] +fail_under = 65 +precision = 2 +ignore_errors = true +show_missing = true +exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"] + +[tool.coverage.html] +directory = "parts/htmlcov" diff --git a/tox.ini b/tox.ini index c14b25e..91a610e 100644 --- a/tox.ini +++ b/tox.ini @@ -10,16 +10,17 @@ envlist = py310 py311 py312 + py313 coverage py{38,39}-sqlalchemy11 py{38,39,310}-sqlalchemy{12,13} - py{38,39,310,311,312}-sqlalchemy{14,20} + py{38,39,310,311,312,313}-sqlalchemy{14,20} [testenv] skip_install = true deps = - setuptools < 69 - zc.buildout >= 3.0.1 + setuptools <74 + zc.buildout >= 3.1 wheel > 0.37 sqlalchemy11: SQLAlchemy==1.1.* sqlalchemy12: SQLAlchemy==1.2.* @@ -27,8 +28,6 @@ deps = sqlalchemy14: SQLAlchemy==1.4.* sqlalchemy20: SQLAlchemy==2.0.* setenv = - py312: VIRTUALENV_PIP=23.1.2 - py312: PIP_REQUIRE_VIRTUALENV=0 commands_pre = !sqlalchemy20: sh -c 'if [ '{env:CI:false}' = 'true' ]; then {envbindir}/buildout -nc {toxinidir}/github_actions.cfg buildout:directory={envdir} buildout:develop={toxinidir} ; fi' !sqlalchemy20: sh -c 'if [ '{env:CI:false}' != 'true' ]; then {envbindir}/buildout -nc {toxinidir}/postgres.cfg buildout:directory={envdir} buildout:develop={toxinidir} ; fi' @@ -46,11 +45,25 @@ passenv = allowlist_externals = sh +[testenv:setuptools-latest] +basepython = python3 +deps = + git+https://github.com/pypa/setuptools.git\#egg=setuptools + zc.buildout >= 3.1 + wheel > 0.37 + sqlalchemy11: SQLAlchemy==1.1.* + sqlalchemy12: SQLAlchemy==1.2.* + sqlalchemy13: SQLAlchemy==1.3.* + sqlalchemy14: SQLAlchemy==1.4.* + sqlalchemy20: SQLAlchemy==2.0.* + + [testenv:release-check] description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = + setuptools <74 twine build check-manifest @@ -64,29 +77,14 @@ commands = twine check dist/* [testenv:lint] +description = This env runs all linters configured in .pre-commit-config.yaml basepython = python3 -commands_pre = - mkdir -p {toxinidir}/parts/flake8 -allowlist_externals = - mkdir -commands = - isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py - flake8 {toxinidir}/src {toxinidir}/setup.py +skip_install = true deps = - flake8 - isort - # Useful flake8 plugins that are Python and Plone specific: - flake8-coding - flake8-debugger - mccabe - -[testenv:isort-apply] -basepython = python3 + pre-commit commands_pre = -deps = - isort commands = - isort {toxinidir}/src {toxinidir}/setup.py [] + pre-commit run --all-files --show-diff-on-failure [testenv:coverage] basepython = python3 @@ -96,28 +94,9 @@ allowlist_externals = mkdir deps = {[testenv]deps} - coverage + coverage[toml] commands = mkdir -p {toxinidir}/parts/htmlcov coverage run {envbindir}/test {posargs:-cv} coverage html - coverage report -m --fail-under=65 - -[coverage:run] -branch = True -source = zope.sqlalchemy - -[coverage:report] -precision = 2 -ignore_errors = True -exclude_lines = - pragma: no cover - pragma: nocover - except ImportError: - raise NotImplementedError - if __name__ == '__main__': - self.fail - raise AssertionError - -[coverage:html] -directory = parts/htmlcov + coverage report From 0836c89e39abd4284c37218b3ec81bf2c794e420 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:53:37 +0200 Subject: [PATCH 14/35] Update Python version support. --- CHANGES.rst | 10 +------- setup.py | 1 + src/zope/sqlalchemy/tests.py | 47 ++++++++++++++++++++++++------------ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 47ca9cd..fe1607e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,15 +4,7 @@ Changes 3.2 (unreleased) ---------------- -* Add support for Python 3.13. - -* Drop support for Python {3.8,3.9}-sqlalchemy11. - -* Drop support for Python {3.8,3.9,3.10}-sqlalchemy{12,13.}. - -* Drop support for Python {3.8,3.9,3.10,3.11,3.12}-sqlalchemy{14,20}. - -- Add support for Python 3.12. +- Add support for Python 3.12, 3.13. - Drop support for Python 3.7. diff --git a/setup.py b/setup.py index 49a5540..a3a9f57 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Database", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/src/zope/sqlalchemy/tests.py b/src/zope/sqlalchemy/tests.py index 5083924..4845dc2 100644 --- a/src/zope/sqlalchemy/tests.py +++ b/src/zope/sqlalchemy/tests.py @@ -265,7 +265,7 @@ def testMarkUnknownSession(self): DummyDataManager(key="dummy.first") session = Session() mark_changed(session) - self.assertTrue(session in zope.sqlalchemy.datamanager._SESSION_STATE) + self.assertIn(session, zope.sqlalchemy.datamanager._SESSION_STATE) def testAbortBeforeCommit(self): # Simulate what happens in a conflict error @@ -399,18 +399,27 @@ def testSavepoint(self): s1 = t.savepoint() session.add(User(id=1, firstname="udo", lastname="juergens")) session.flush() - self.assertTrue(len(query.all()) == 1, - "Users table should have one row") + self.assertEqual( + len(query.all()), + 1, + "Users table should have one row" + ) s2 = t.savepoint() session.add(User(id=2, firstname="heino", lastname="n/a")) session.flush() - self.assertTrue(len(query.all()) == 2, - "Users table should have two rows") + self.assertEqual( + len(query.all()), + 2, + "Users table should have two rows" + ) s2.rollback() - self.assertTrue(len(query.all()) == 1, - "Users table should have one row") + self.assertEqual( + len(query.all()), + 1, + "Users table should have one row" + ) s1.rollback() self.assertFalse(query.all(), "Users table should be empty") @@ -771,12 +780,16 @@ def testRetry(self): tm1, tm2, s1, s2 = self.tm1, self.tm2, self.s1, self.s2 # make sure we actually start a session. tm1.begin() - self.assertTrue( - len(s1.query(User).all()) == 1, "Users table should have one row" + self.assertEqual( + len(s1.query(User).all()), + 1, + "Users table should have one row" ) tm2.begin() - self.assertTrue( - len(s2.query(User).all()) == 1, "Users table should have one row" + self.assertEqual( + len(s2.query(User).all()), + 1, + "Users table should have one row" ) s1.query(User).delete() if SA_GE_20: @@ -800,15 +813,19 @@ def testRetryThread(self): tm1, tm2, s1, s2 = self.tm1, self.tm2, self.s1, self.s2 # make sure we actually start a session. tm1.begin() - self.assertTrue( - len(s1.query(User).all()) == 1, "Users table should have one row" + self.assertEqual( + len(s1.query(User).all()), + 1, + "Users table should have one row" ) tm2.begin() s2.connection().execute(sql.text( "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE" )) - self.assertTrue( - len(s2.query(User).all()) == 1, "Users table should have one row" + self.assertEqual( + len(s2.query(User).all()), + 1, + "Users table should have one row" ) s1.query(User).delete() raised = False From 470d4d1045f6190681639ae344d122779b032799 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Sep 2024 08:59:25 +0200 Subject: [PATCH 15/35] Use Python 3.13 compatible function. --- src/zope/sqlalchemy/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zope/sqlalchemy/tests.py b/src/zope/sqlalchemy/tests.py index 4845dc2..43ed276 100644 --- a/src/zope/sqlalchemy/tests.py +++ b/src/zope/sqlalchemy/tests.py @@ -892,14 +892,14 @@ def tearDownReadMe(test): def test_suite(): import doctest from unittest import TestSuite - from unittest import makeSuite + from unittest import defaultTestLoader optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS suite = TestSuite() - suite.addTest(makeSuite(ZopeSQLAlchemyTests)) - suite.addTest(makeSuite(MultipleEngineTests)) + suite.addTest(defaultTestLoader.loadTestsFromTestCase(ZopeSQLAlchemyTests)) + suite.addTest(defaultTestLoader.loadTestsFromTestCase(MultipleEngineTests)) if TEST_DSN.startswith("postgres") or TEST_DSN.startswith("oracle"): - suite.addTest(makeSuite(RetryTests)) + suite.addTest(defaultTestLoader.loadTestsFromTestCase(RetryTests)) # examples in docs are only correct for SQLAlchemy >=1.4 if parse_version(sqlalchemy_version) >= parse_version('1.4.0'): From c25ccd0d07c2adb7466580bba3b0a698571076dc Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 23 Sep 2024 08:56:38 +0200 Subject: [PATCH 16/35] Improve SQLAlchemy version requirements readability. --- setup.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a3a9f57..7f62512 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,20 @@ tests_require = ['zope.testing'] +sqlalchemy_versions = ','.join([ + '>=1.1', + '!=1.4.0', + '!=1.4.1', + '!=1.4.2', + '!=1.4.3', + '!=1.4.4', + '!=1.4.5', + '!=1.4.6', + '!=2.0.32', + '!=2.0.33', + '!=2.0.34', + '!=2.0.35', +]) setup( name='zope.sqlalchemy', @@ -47,7 +61,7 @@ install_requires=[ 'packaging', 'setuptools', - 'SQLAlchemy>=1.1,!=1.4.0,!=1.4.1,!=1.4.2,!=1.4.3,!=1.4.4,!=1.4.5,!=1.4.6,!=2.0.32,!=2.0.33,!=2.0.34,!=2.0.35', # noqa: E501 line too long + f'SQLAlchemy{sqlalchemy_versions}', 'transaction>=1.6.0', 'zope.interface>=3.6.0', ], From 3ab57e2a7d098070130657d62a0754db5590c5ee Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Tue, 5 Nov 2024 17:22:10 +0100 Subject: [PATCH 17/35] 2.0.31 does not run on Python 3.12. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 7f62512..d873e85 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', + '!=2.0.31', '!=2.0.32', '!=2.0.33', '!=2.0.34', From 43e881532eee78242a3120583426d74994ea334e Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 6 Nov 2024 09:13:19 +0100 Subject: [PATCH 18/35] 2.0.36 also runs into a deadlock. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index d873e85..452eced 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ '!=2.0.33', '!=2.0.34', '!=2.0.35', + '!=2.0.36', ]) setup( From 777e0437eb8c2c6ae53f4daf9b2f243f90977bf5 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 11 Nov 2024 08:57:12 +0100 Subject: [PATCH 19/35] Exclude another non Py 3.12 version. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 452eced..96a1669 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', + '!=2.0.30', # Tests run into a deadlock on Python 3.12 from here on '!=2.0.31', '!=2.0.32', '!=2.0.33', From 9ce6dd25977fe2fdc20c2d639dc3e766bd85a2f6 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Tue, 12 Nov 2024 08:45:44 +0100 Subject: [PATCH 20/35] 2.0.29 does not work with Python 3.12. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 96a1669..340674e 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.30', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.29', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.30', '!=2.0.31', '!=2.0.32', '!=2.0.33', From 15d13415d3ba0e90ab930ae73b37206fbf3d8bb1 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 20 Nov 2024 08:30:18 +0100 Subject: [PATCH 21/35] Blacklist 2.0.28. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 340674e..81a3c3a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.29', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.28', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.29', '!=2.0.30', '!=2.0.31', '!=2.0.32', From 48ca41a9e5fbdefcb3fbd5335a8fb4a11baf1a68 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Thu, 21 Nov 2024 08:15:11 +0100 Subject: [PATCH 22/35] Blacklist 2.0.27 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 81a3c3a..e314a58 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.28', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.27', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.28', '!=2.0.29', '!=2.0.30', '!=2.0.31', From 2c7317d3d1b292f88bd6ca10bb4b90f516b5ab33 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 22 Nov 2024 08:38:42 +0100 Subject: [PATCH 23/35] Blacklist 2.0.26. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e314a58..3cab227 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.27', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.26', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.27', '!=2.0.28', '!=2.0.29', '!=2.0.30', From 51d1b8346c30a4d7756390ff919d184c5c110eaa Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 27 Nov 2024 08:59:06 +0100 Subject: [PATCH 24/35] Blacklist 2.0.25. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3cab227..9ed2bec 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.26', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.25', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.26', '!=2.0.27', '!=2.0.28', '!=2.0.29', From d808b448508f8917dc3414d3b3d017000fe63744 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 29 Nov 2024 07:52:43 +0100 Subject: [PATCH 25/35] Blacklist 2.0.24. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9ed2bec..0e23adc 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.25', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.24', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.25', '!=2.0.26', '!=2.0.27', '!=2.0.28', From a8944e81d6f8cc0ff57535a0ef44d31d6d780707 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Tue, 3 Dec 2024 08:48:54 +0100 Subject: [PATCH 26/35] Blacklist 2.0.23. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0e23adc..a18487b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.24', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.23', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.24', '!=2.0.25', '!=2.0.26', '!=2.0.27', From 96352fa7e5de4e50fe1a40689fe3acc9c7ac446a Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 6 Dec 2024 08:56:26 +0100 Subject: [PATCH 27/35] Blacklist: 2.0.22 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a18487b..82c4888 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.23', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.22', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.23', '!=2.0.24', '!=2.0.25', '!=2.0.26', From a81f7f00b31adc45f36ed5f9bbf5f2b9e8bf72df Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 9 Dec 2024 08:43:19 +0100 Subject: [PATCH 28/35] Blacklist: 2.0.21 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 82c4888..d1dda0a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.22', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.21', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.22', '!=2.0.23', '!=2.0.24', '!=2.0.25', From 4c781c1dea0d50514c0f797902fef3f435a6e8b4 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 20 Dec 2024 13:49:49 +0100 Subject: [PATCH 29/35] Blacklist 2.0.20. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d1dda0a..1ac3db8 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.21', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.20', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.21', '!=2.0.22', '!=2.0.23', '!=2.0.24', From 0268deeed89ab80e9ae14e72aa3f66032c86d794 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 15 Jan 2025 08:09:38 +0100 Subject: [PATCH 30/35] Blacklist 2.0.19. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1ac3db8..070a175 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,8 @@ '!=1.4.4', '!=1.4.5', '!=1.4.6', - '!=2.0.20', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.19', # Tests run into a deadlock on Python 3.12 from here on + '!=2.0.20', '!=2.0.21', '!=2.0.22', '!=2.0.23', From 10efda093838a0808b0c2975b35a7e4522624f2b Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 17 Jan 2025 09:11:41 +0100 Subject: [PATCH 31/35] Try if PostgreSQL 15 still exists. --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b49f4b7..6122c35 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,12 +37,12 @@ jobs: run: | sudo mkdir -p /usr/local/pgsql/data sudo chown postgres /usr/local/pgsql/data - sudo su - postgres -c '/usr/lib/postgresql/14/bin/initdb -D /usr/local/pgsql/data' + sudo su - postgres -c '/usr/lib/postgresql/15/bin/initdb -D /usr/local/pgsql/data' sudo su - postgres -c 'echo "max_prepared_transactions=10" >> /usr/local/pgsql/data/postgresql.conf' sudo su - postgres -c 'cat /usr/local/pgsql/data/postgresql.conf' - sudo su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' - sudo su - postgres -c '/usr/lib/postgresql/14/bin/createdb zope_sqlalchemy_tests' - sudo su - postgres -c '/usr/lib/postgresql/14/bin/psql -l' + sudo su - postgres -c '/usr/lib/postgresql/15/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' + sudo su - postgres -c '/usr/lib/postgresql/15/bin/createdb zope_sqlalchemy_tests' + sudo su - postgres -c '/usr/lib/postgresql/15/bin/psql -l' - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 From 0037105b70f957d1a18765aab81058563b6d652f Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 17 Jan 2025 09:13:17 +0100 Subject: [PATCH 32/35] Show existing postgres versions. --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6122c35..eb083a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,6 +37,7 @@ jobs: run: | sudo mkdir -p /usr/local/pgsql/data sudo chown postgres /usr/local/pgsql/data + sudo ls -l /usr/lib/postgresql sudo su - postgres -c '/usr/lib/postgresql/15/bin/initdb -D /usr/local/pgsql/data' sudo su - postgres -c 'echo "max_prepared_transactions=10" >> /usr/local/pgsql/data/postgresql.conf' sudo su - postgres -c 'cat /usr/local/pgsql/data/postgresql.conf' From 3b6bf2f7e548b4b8c0018bd473539eba53c0e837 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 17 Jan 2025 09:16:12 +0100 Subject: [PATCH 33/35] Try to install postgres before using it. --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb083a4..adb101d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,15 +35,15 @@ jobs: steps: - name: "Configure PostgreSQL" run: | + sudo apt-get install -y postgresql-14 sudo mkdir -p /usr/local/pgsql/data sudo chown postgres /usr/local/pgsql/data - sudo ls -l /usr/lib/postgresql - sudo su - postgres -c '/usr/lib/postgresql/15/bin/initdb -D /usr/local/pgsql/data' + sudo su - postgres -c '/usr/lib/postgresql/14/bin/initdb -D /usr/local/pgsql/data' sudo su - postgres -c 'echo "max_prepared_transactions=10" >> /usr/local/pgsql/data/postgresql.conf' sudo su - postgres -c 'cat /usr/local/pgsql/data/postgresql.conf' - sudo su - postgres -c '/usr/lib/postgresql/15/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' - sudo su - postgres -c '/usr/lib/postgresql/15/bin/createdb zope_sqlalchemy_tests' - sudo su - postgres -c '/usr/lib/postgresql/15/bin/psql -l' + sudo su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' + sudo su - postgres -c '/usr/lib/postgresql/14/bin/createdb zope_sqlalchemy_tests' + sudo su - postgres -c '/usr/lib/postgresql/14/bin/psql -l' - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 From d93ea47e326022f54449f2c81dcfb1b11b81cffc Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 17 Jan 2025 09:17:26 +0100 Subject: [PATCH 34/35] 2nd attempt --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index adb101d..c8ffc9b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: steps: - name: "Configure PostgreSQL" run: | - sudo apt-get install -y postgresql-14 + sudo apt install postgresql sudo mkdir -p /usr/local/pgsql/data sudo chown postgres /usr/local/pgsql/data sudo su - postgres -c '/usr/lib/postgresql/14/bin/initdb -D /usr/local/pgsql/data' From 767ea6746d6b1a20d88a22aaf5003a0fee3e2d66 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Fri, 17 Jan 2025 09:18:44 +0100 Subject: [PATCH 35/35] It installed version 16. --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8ffc9b..83d4560 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,12 +38,12 @@ jobs: sudo apt install postgresql sudo mkdir -p /usr/local/pgsql/data sudo chown postgres /usr/local/pgsql/data - sudo su - postgres -c '/usr/lib/postgresql/14/bin/initdb -D /usr/local/pgsql/data' + sudo su - postgres -c '/usr/lib/postgresql/16/bin/initdb -D /usr/local/pgsql/data' sudo su - postgres -c 'echo "max_prepared_transactions=10" >> /usr/local/pgsql/data/postgresql.conf' sudo su - postgres -c 'cat /usr/local/pgsql/data/postgresql.conf' - sudo su - postgres -c '/usr/lib/postgresql/14/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' - sudo su - postgres -c '/usr/lib/postgresql/14/bin/createdb zope_sqlalchemy_tests' - sudo su - postgres -c '/usr/lib/postgresql/14/bin/psql -l' + sudo su - postgres -c '/usr/lib/postgresql/16/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start' + sudo su - postgres -c '/usr/lib/postgresql/16/bin/createdb zope_sqlalchemy_tests' + sudo su - postgres -c '/usr/lib/postgresql/16/bin/psql -l' - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5