diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0c629a3..ea56cf5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.1.0b1 +current_version = 3.1.0 [bumpversion:file:pyproject.toml] search = version = "{current_version}" diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index 7ce0c8b..99cba8a 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - 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: "3.10" + python-version: "3.11" - name: Install build tool run: python -m pip install build --user diff --git a/.github/workflows/test_with_tox.yml b/.github/workflows/test_with_tox.yml index d829641..5a0f068 100644 --- a/.github/workflows/test_with_tox.yml +++ b/.github/workflows/test_with_tox.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python ${{ matrix.python }} uses: actions/setup-python@v4 @@ -21,5 +21,5 @@ jobs: - run: tox -e py - - if: matrix.python == 3.10 + - if: matrix.python == 3.11 run: TOXENV=ruff,manifest,docs,spell tox diff --git a/LICENSE b/LICENSE index 15287a3..de120c4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Christoph Zwerschke +Copyright (c) 2024 Christoph Zwerschke Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 09ccb37..fa3b0ef 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ to a database that can be used in all kinds of multi-threaded environments. The suite supports DB-API 2 compliant database interfaces and the classic PyGreSQL interface. -The current version 3.0.3 of DBUtils supports Python versions 3.6 to 3.11. +The current version 3.1.0 of DBUtils supports Python versions 3.7 to 3.12. **Please have a look at the [changelog](https://webwareforpython.github.io/DBUtils/changelog.html), because there were some breaking changes in version 2.0.** diff --git a/dbutils/__init__.py b/dbutils/__init__.py index 9008cfc..e503c5d 100644 --- a/dbutils/__init__.py +++ b/dbutils/__init__.py @@ -5,4 +5,4 @@ 'simple_pooled_pg', 'steady_pg', 'pooled_pg', 'persistent_pg', 'simple_pooled_db', 'steady_db', 'pooled_db', 'persistent_db'] -__version__ = '3.0.3' +__version__ = '3.1.0' diff --git a/docs/changelog.html b/docs/changelog.html index 1f5ce90..c30f65b 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -2,8 +2,8 @@
+ -DBUtils 3.1.0 was released on March 17, 2024.
+Changes:
+Support Python version 3.12, cease support for Python 3.6.
Various small internal improvements and modernizations.
DBUtils 3.0.3 was released on April 27, 2023.
Changes:
@@ -21,19 +30,19 @@Minor fixes and section an advanced usage in docs.
DBUtils 3.0.2 was released on January 14, 2022.
The optional iterator protocol on cursors is now supported.
DBUtils 3.0.1 was released on December 22, 2021.
It includes InterfaceError to the default list of exceptions for which the connection failover mechanism is applied. You can override this with the failures parameter.
DBUtils 3.0.0 was released on November 26, 2021.
It is intended to be used with Python versions 3.6 to 3.10.
@@ -42,7 +51,7 @@Cease support for Python 2 and 3.5, minor optimizations.
DBUtils 2.0.3 was released on November 26, 2021.
Changes:
@@ -50,7 +59,7 @@Support Python version 3.10.
DBUtils 2.0.2 was released on June 8, 2021.
Changes:
@@ -58,7 +67,7 @@Allow using context managers for pooled connections.
DBUtils 2.0.1 was released on April 8, 2021.
Changes:
@@ -66,7 +75,7 @@Avoid "name Exception is not defined" when exiting.
DBUtils 2.0 was released on September 26, 2020.
It is intended to be used with Python versions 2.7 and 3.5 to 3.9.
@@ -82,7 +91,7 @@This changelog has been compiled from the former release notes.
DBUtils 1.4 was released on September 26, 2020.
It is intended to be used with Python versions 2.7 and 3.5 to 3.9.
@@ -93,7 +102,7 @@DBUtils 1.3 was released on March 3, 2018.
It is intended to be used with Python versions 2.6, 2.7 and 3.4 to 3.7.
@@ -102,12 +111,12 @@This version now supports context handlers for connections and cursors.
DBUtils 1.2 was released on February 5, 2017.
It is intended to be used with Python versions 2.6, 2.7 and 3.0 to 3.6.
DBUtils 1.1.1 was released on February 4, 2017.
It is intended to be used with Python versions 2.3 to 2.7.
@@ -121,7 +130,7 @@Fixed a problem when running under Jython (reported by Vitaly Kruglikov).
DBUtils 1.1 was released on August 14, 2011.
Improvements:
@@ -150,7 +159,7 @@Fixed some minor issues with the DBUtilsExample for Webware.
DBUtils 1.0 was released on November 29, 2008.
It is intended to be used with Python versions 2.2 to 2.6.
@@ -183,7 +192,7 @@DBUtils 0.9.4 was released on July 7, 2007.
This release fixes a problem in the destructor code and has been supplemented @@ -192,7 +201,7 @@
DBUtils 0.9.3 was released on May 21, 2007.
Changes:
@@ -207,7 +216,7 @@DBUtils 0.9.2 was released on September 22, 2006.
It is intended to be used with Python versions 2.2 to 2.5.
@@ -217,7 +226,7 @@DBUtils 0.9.1 was released on May 8, 2006.
It is intended to be used with Python versions 2.2 to 2.4.
@@ -231,7 +240,7 @@Improved the documentation and added a User's Guide.
DBUtils 0.8.1 was released on September 13, 2005.
It is intended to be used with Python versions 2.0 to 2.4.
diff --git a/docs/changelog.rst b/docs/changelog.rst index 6d0833f..796684e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,17 @@ Changelog for DBUtils +++++++++++++++++++++ +3.1.0 +===== + +DBUtils 3.1.0 was released on March 17, 2024. + +Changes: + +* Support Python version 3.12, cease support for Python 3.6. +* Various small internal improvements and modernizations. + + 3.0.3 ===== diff --git a/docs/main.de.html b/docs/main.de.html index 1a2dda7..e4f5834 100644 --- a/docs/main.de.html +++ b/docs/main.de.html @@ -2,8 +2,8 @@ + -English | German
DBUtils unterstützt die Python Versionen 3.6 bis 3.11.
+DBUtils unterstützt die Python Versionen 3.7 bis 3.12.
Die Module in der Variante für klassisches PyGreSQL benötigen PyGreSQL Version 4.0 oder höher, während die Module in der allgemeinen Variante für DB-API 2 mit jedem beliebigen Python-Datenbankadapter-Modul zusammenarbeiten, @@ -536,7 +536,7 @@
Copyright © 2005-2023 Christoph Zwerschke. +
Copyright © 2005-2024 Christoph Zwerschke. Alle Rechte vorbehalten.
DBUtils ist freie und quelloffene Software, lizenziert unter der MIT-Lizenz.
diff --git a/docs/main.de.rst b/docs/main.de.rst index aa800d6..a42853b 100644 --- a/docs/main.de.rst +++ b/docs/main.de.rst @@ -1,7 +1,7 @@ Benutzeranleitung für DBUtils +++++++++++++++++++++++++++++ -:Version: 3.0.3 +:Version: 3.1.0 :Translations: English_ | German .. _English: main.html @@ -98,7 +98,7 @@ herunterzuladen und zu installieren:: Anforderungen ============= -DBUtils unterstützt die Python_ Versionen 3.6 bis 3.11. +DBUtils unterstützt die Python_ Versionen 3.7 bis 3.12. Die Module in der Variante für klassisches PyGreSQL benötigen PyGreSQL_ Version 4.0 oder höher, während die Module in der allgemeinen Variante @@ -583,7 +583,7 @@ Autoren Copyright und Lizenz ==================== -Copyright © 2005-2023 Christoph Zwerschke. +Copyright © 2005-2024 Christoph Zwerschke. Alle Rechte vorbehalten. DBUtils ist freie und quelloffene Software, diff --git a/docs/main.html b/docs/main.html index 50c9ffd..9290bb2 100644 --- a/docs/main.html +++ b/docs/main.html @@ -2,8 +2,8 @@ + -English | German
DBUtils supports Python versions 3.6 to 3.11.
+DBUtils supports Python versions 3.7 to 3.12.
The modules in the classic PyGreSQL variant need PyGreSQL version 4.0 or above, while the modules in the universal DB-API 2 variant run with any Python DB-API 2 compliant database interface module.
@@ -494,7 +494,7 @@Copyright © 2005-2023 by Christoph Zwerschke. +
Copyright © 2005-2024 by Christoph Zwerschke. All Rights Reserved.
DBUtils is free and open source software, licensed under the MIT license.
diff --git a/docs/main.rst b/docs/main.rst index fa574b7..e2fdbd9 100644 --- a/docs/main.rst +++ b/docs/main.rst @@ -1,7 +1,7 @@ DBUtils User's Guide ++++++++++++++++++++ -:Version: 3.0.3 +:Version: 3.1.0 :Translations: English | German_ .. _German: main.de.html @@ -95,7 +95,7 @@ It is even easier to download and install the package in one go using `pip`_:: Requirements ============ -DBUtils supports Python_ versions 3.6 to 3.11. +DBUtils supports Python_ versions 3.7 to 3.12. The modules in the classic PyGreSQL variant need PyGreSQL_ version 4.0 or above, while the modules in the universal DB-API 2 variant run with @@ -543,7 +543,7 @@ Credits Copyright and License ===================== -Copyright © 2005-2023 by Christoph Zwerschke. +Copyright © 2005-2024 by Christoph Zwerschke. All Rights Reserved. DBUtils is free and open source software, diff --git a/docs/make.py b/docs/make.py index c071071..a00977b 100755 --- a/docs/make.py +++ b/docs/make.py @@ -1,15 +1,14 @@ -#!/usr/bin/python3.10 +#!/usr/bin/python3.11 """Build HTML from reST files.""" -from glob import glob from pathlib import Path from docutils.core import publish_file print("Creating the documentation...") -for rst_file in glob('*.rst'): +for rst_file in Path().glob('*.rst'): rst_path = Path(rst_file) name = Path(rst_file).stem lang = Path(name).suffix diff --git a/pyproject.toml b/pyproject.toml index 3426c54..d4f3aa4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools>=61.2", + "setuptools>=69", ] [project] name = "DBUtils" -version = "3.1.0b1" +version = "3.1.0" description = "Database connections for multi-threaded environments." license = {text = "MIT License"} authors = [{name = "Christoph Zwerschke", email = "cito@online.de"}] @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Database", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", @@ -58,19 +59,27 @@ platforms = ["any"] include-package-data = false [tool.ruff] +line-length = 79 +target-version = "py37" + +[tool.ruff.lint] select = [ "A", # flake8-builtins + # "ANN", # flake8-annotations "ARG", # flake8-unused-arguments "B", # flake8-bugbear + # "BLE", # flake8-blind-except "C4", # flake8-comprehensions "C90", # McCabe cyclomatic complexity "COM", # flake8-commas "D", # pydocstyle "DTZ", # flake8-datetimez "E", # pycodestyle + # "EM", # flake8-errmsg "ERA", # eradicate "EXE", # flake8-executable "F", # Pyflakes + # "FBT", # flake8-boolean-trap "G", # flake8-logging-format "I", # isort "ICN", # flake8-import-conventions @@ -84,43 +93,40 @@ select = [ "PT", # flake8-pytest-style "PTH", # flake8-use-pathlib "PYI", # flake8-pyi + # "Q", # flake8-quotes "RET", # flake8-return "RSE", # flake8-raise "RUF", # Ruff-specific rules "S", # flake8-bandit + # "SLF", # flake8-self "SIM", # flake8-simplify "T10", # flake8-debugger "T20", # flake8-print "TCH", # flake8-type-checking "TID", # flake8-tidy-imports + # "TRY", # tryceratops "UP", # pyupgrade "W", # pycodestyle "YTT", # flake8-2020 - # "ANN", # flake8-annotations - # "BLE", # flake8-blind-except - # "EM", # flake8-errmsg - # "FBT", # flake8-boolean-trap - # "Q", # flake8-quotes - # "SLF", # flake8-self - # "TRY", # tryceratops ] # Note: use `ruff rule ...` to see explanations of rules ignore = [ "D203", # no blank line before class docstring "D213", # multi-line docstrings should not start at second line ] -line-length = 79 -target-version = "py37" -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 30 -[tool.ruff.pylint] +[tool.ruff.lint.flake8-quotes] +inline-quotes = "double" + +[tool.ruff.lint.pylint] max-args = 12 max-branches = 35 max-statements = 95 -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "docs/*" = [ "INP001", # allow stand-alone scripts "T201", # allow print statements diff --git a/tests/test_threading_local.py b/tests/test_threading_local.py index 2c86525..3871e6c 100644 --- a/tests/test_threading_local.py +++ b/tests/test_threading_local.py @@ -71,7 +71,7 @@ def f(): assert not hasattr(my_data, 'color') class MyLocal(local): - __slots__ = 'number' + __slots__ = ('number',) my_data = MyLocal() my_data.number = 42 diff --git a/tox.ini b/tox.ini index 529d75c..62aab9d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{7,8,9,10,11}, ruff, manifest, docs, spell +envlist = py3{7,8,9,10,11,12}, ruff, manifest, docs, spell [testenv] setenv = @@ -9,25 +9,25 @@ commands = pytest {posargs} [testenv:spell] -basepython = python3.10 +basepython = python3.11 deps = codespell commands = codespell . [testenv:ruff] -basepython = python3.10 +basepython = python3.11 deps = ruff commands = - ruff . + ruff check . [testenv:manifest] -basepython = python3.10 +basepython = python3.11 deps = check-manifest commands = check-manifest -v [testenv:docs] -basepython = python3.10 +basepython = python3.11 extras = docs changedir = docs commands =