]>
git.ipfire.org Git - thirdparty/psycopg.git/log
Daniele Varrazzo [Thu, 13 Feb 2025 15:58:44 +0000 (16:58 +0100)]
docs: mention UUID speedup in release news
henadzit [Mon, 10 Feb 2025 22:37:50 +0000 (23:37 +0100)]
chore(c): remove C UUIDDumper and UUIDBinaryDumper
Daniele Varrazzo [Sat, 8 Feb 2025 15:36:25 +0000 (16:36 +0100)]
perf(uuid): speed up UUID creation using a writable subclass
Introduce an object memory-compatible with UUID, but writable. Try to
create this object in the fastest possible way: calling __new__ and
setting its attributes. Then replace the class with the standard UUID.
henadzit [Fri, 7 Feb 2025 18:43:49 +0000 (19:43 +0100)]
perf(c): use PyObject_CallFunctionObjArgs in UUIDBinaryLoader
henadzit [Fri, 7 Feb 2025 18:11:40 +0000 (19:11 +0100)]
perf(c): use PyObject_CallFunctionObjArgs in UUIDLoader
henadzit [Fri, 7 Feb 2025 17:03:43 +0000 (18:03 +0100)]
test(c): test UUID.__slots__
henadzit [Sun, 2 Feb 2025 18:29:01 +0000 (19:29 +0100)]
perf(c): Use hex_to_int_map in UUIDLoader
henadzit [Thu, 30 Jan 2025 10:02:39 +0000 (11:02 +0100)]
perf(c): lazy load UUID
henadzit [Wed, 29 Jan 2025 23:32:17 +0000 (00:32 +0100)]
perf(c): use UUID.__new__
henadzit [Mon, 27 Jan 2025 18:26:00 +0000 (19:26 +0100)]
perf(c): add Cython UUID dumper and loader
Daniele Varrazzo [Fri, 14 Feb 2025 16:38:22 +0000 (17:38 +0100)]
chore(ci): drop stale comment
Daniele Varrazzo [Thu, 13 Feb 2025 17:44:32 +0000 (18:44 +0100)]
ci(crdb): enable back crdb 25.1 tests
Test were failing because of the setting 'autocommit_before_ddl' now
defaulting to 'on'. After exchanging with CRDB developer, this seems the
correct behaviour for their database moving on.
Daniele Varrazzo [Thu, 13 Feb 2025 13:36:33 +0000 (14:36 +0100)]
ci: add missing dependency to run isort --color
Daniele Varrazzo [Wed, 12 Feb 2025 11:38:38 +0000 (12:38 +0100)]
ci(crdb): suspend testing with 25.1
There are some failures with the current image, reported upstream.
Daniele Varrazzo [Thu, 13 Feb 2025 12:57:40 +0000 (13:57 +0100)]
chore: tweak linters output in pre-commit
Daniele Varrazzo [Thu, 13 Feb 2025 12:57:08 +0000 (13:57 +0100)]
Merge pull request #1006 from psycopg/isort
Use isort to standardise imports
Daniele Varrazzo [Thu, 13 Feb 2025 10:54:46 +0000 (11:54 +0100)]
chore(isort): add source link to project metadata, tweak readme
Daniele Varrazzo [Tue, 11 Feb 2025 21:54:25 +0000 (22:54 +0100)]
style: apply isort on codebase
Daniele Varrazzo [Tue, 11 Feb 2025 21:23:50 +0000 (22:23 +0100)]
chore: add isort configuration
Daniele Varrazzo [Wed, 12 Feb 2025 12:26:40 +0000 (13:26 +0100)]
style: add isort plugin to sort imports with the desired style
Sort imports by length, imported objects naturally.
Daniele Varrazzo [Tue, 28 Jan 2025 13:57:18 +0000 (14:57 +0100)]
ci: bump Python version in Django main test to 3.12
Python 3.11 is no longer supported in Django main version..
install libmemcached-dev to satisfy a Django dev dependency for a
package that doesn't provide a wheel distribution. Close #999.
Tests with both the oldest and the newest versions supported by Django.
Daniele Varrazzo [Wed, 29 Jan 2025 10:27:04 +0000 (11:27 +0100)]
ci: avoid segfault building binary packages caused by qemu bugs
Discussion at https://github.com/pypa/cibuildwheel/discussions/2256
Daniele Varrazzo [Wed, 29 Jan 2025 12:48:10 +0000 (13:48 +0100)]
style: adjust docstrings after black 25.1.0 upgrade
Daniele Varrazzo [Tue, 28 Jan 2025 13:54:00 +0000 (14:54 +0100)]
docs: document why pre-commit language is set to 'local'
Daniele Varrazzo [Tue, 28 Jan 2025 13:48:16 +0000 (14:48 +0100)]
chore: typos fixed
Daniele Varrazzo [Tue, 28 Jan 2025 13:39:51 +0000 (14:39 +0100)]
docs(ci): add notes about libpq caching
Daniele Varrazzo [Sun, 19 Jan 2025 23:12:17 +0000 (00:12 +0100)]
ci(crdb): test with oldest supported Python release
Daniele Varrazzo [Sun, 19 Jan 2025 21:49:45 +0000 (22:49 +0100)]
ci(crdb): test with the master release
Daniele Varrazzo [Sun, 19 Jan 2025 10:44:30 +0000 (11:44 +0100)]
ci(crdb): bump CockroachDB versions in tests
Daniele Varrazzo [Wed, 15 Jan 2025 00:03:55 +0000 (01:03 +0100)]
chore: bump psycopg package version to 3.2.4
Daniele Varrazzo [Tue, 14 Jan 2025 23:54:40 +0000 (00:54 +0100)]
docs: mention the binary packages changes in news file
Daniele Varrazzo [Tue, 14 Jan 2025 11:24:47 +0000 (12:24 +0100)]
chore(binary): bump libpq to 17.2
Note: on vcpkg, v17 is not available yet. Furthermore it's not easy to
pin the version. See https://github.com/microsoft/vcpkg/discussions/25622
Daniele Varrazzo [Tue, 14 Jan 2025 11:23:42 +0000 (12:23 +0100)]
chore(binary): bump OpenSSL to 3.4.0
Daniele Varrazzo [Tue, 14 Jan 2025 18:28:24 +0000 (19:28 +0100)]
Merge pull request #986 from psycopg/build-libpq-macos
Build libpq on macOS
Daniele Varrazzo [Fri, 10 Jan 2025 12:07:23 +0000 (13:07 +0100)]
ci(binary): less verbose libpq build
Daniele Varrazzo [Sun, 5 Jan 2025 23:48:36 +0000 (00:48 +0100)]
ci(macos): build libpq instead of using Homebrew libraries
This avoids problems with MACOSX_DEPLOYMENT_TARGET drifting in builders
(see #858).
Largely contributed by @bwoodsend in https://github.com/psycopg/psycopg2/pull/1755.
Daniele Varrazzo [Fri, 10 Jan 2025 14:17:01 +0000 (15:17 +0100)]
refactor: don't keep the notifiers backlog handler in the connection state
Just keep the queue in the state and special-case its handling in the
`_notify_handler` connection method instead of registering a standard handler.
Set the queue to None to signify that we are in the `notifies()` generator.
This way we don't need the awkward weak-self + class method to avoid a
reference loop and to dereference the connection weak reference another
time, as we just did in `_notify_handler()`. Setting the queue to None
also feels cleaner than adding/removing the handler.
Relates to #975.
Daniele Varrazzo [Fri, 10 Jan 2025 00:38:58 +0000 (01:38 +0100)]
Merge pull request #989 from psycopg/fix-clobbered-error-on-disconnect
Fix clobbered error on disconnect
Daniele Varrazzo [Wed, 8 Jan 2025 13:10:16 +0000 (14:10 +0100)]
test: soften disconnection tests on platforms knwon to behave differently
Daniele Varrazzo [Wed, 8 Jan 2025 12:36:26 +0000 (13:36 +0100)]
test: add test to verify that a server disconnection now raises AdminShutdown
Previously it was raising OperationalError, but this was just the result
of the issue reported in #988. Note that AdminShutdown is a subclass of
OperationalError, therefore this change is backward compatible.
Daniele Varrazzo [Wed, 8 Jan 2025 00:33:52 +0000 (01:33 +0100)]
fix(c): don't clobber an error from the server with a server disconnection
Instead of raising the exception here, return the result and let the
caller handle the exception. This might make code paths more uniform and
helps the C implementation, because we actually never call
`error_from_result()` in the Cython code.
Daniele Varrazzo [Wed, 8 Jan 2025 00:21:22 +0000 (01:21 +0100)]
fix: don't clobber an error from the server with a server disconnection
The server error is assumed to contain more information, as it is
returned as a result, whereas a communication error caused by a server
disconnection will only make available the error message.
Close #988 (but we need to fix the Cython side too).
Daniele Varrazzo [Wed, 8 Jan 2025 00:16:46 +0000 (01:16 +0100)]
test: add test to reproduce the wrong error on disconnect
We raise `OperationalError` instead of `IdleInTransactionSessionTimeout`.
See #988.
Daniele Varrazzo [Wed, 8 Jan 2025 00:23:41 +0000 (01:23 +0100)]
fix(debug): print exceptions eventually raised by libpq calls
Daniele Varrazzo [Wed, 8 Jan 2025 12:08:51 +0000 (13:08 +0100)]
docs: improve organization of adaptation objects docs
Move the life cycle section above the examples, closer to the
configuration top section; explain better how `format` affects the
loader used, highlight better the connection between the protocols
defined in the `abc` module and the abstract base classes in the `adapt`
module.
The meaning of `Loader.format` wasn't explained anywhere: see #990.
stankudrow [Sat, 4 Jan 2025 06:58:30 +0000 (09:58 +0300)]
docs: fix ']]' return value in Dumper.get_key() docs
Close #921.
Daniele Varrazzo [Sat, 4 Jan 2025 02:04:10 +0000 (03:04 +0100)]
Merge pull request #982 from psycopg/cleanup-compat
Clean up compat modules after dropping Python 3.8
Daniele Varrazzo [Sat, 4 Jan 2025 01:11:16 +0000 (02:11 +0100)]
chore: fix problems reported by mypy 1.14.1
Daniele Varrazzo [Fri, 3 Jan 2025 20:24:35 +0000 (21:24 +0100)]
chore(tests): drop Python 2 check
Daniele Varrazzo [Sat, 28 Dec 2024 01:47:34 +0000 (02:47 +0100)]
refactor: remove unneeded objects from _compat modules
Daniele Varrazzo [Sat, 28 Dec 2024 00:57:02 +0000 (01:57 +0100)]
refactor(tests): remove Counter from utils module
Daniele Varrazzo [Fri, 27 Dec 2024 23:27:51 +0000 (00:27 +0100)]
chore: drop pre-3.9 if blocks
Daniele Varrazzo [Sat, 28 Dec 2024 00:28:30 +0000 (01:28 +0100)]
refactor: replace list comprehension with generators in multiple assignments
Daniele Varrazzo [Sat, 28 Dec 2024 00:19:16 +0000 (01:19 +0100)]
refactor: use pytest canonical assert method names
Daniele Varrazzo [Fri, 27 Dec 2024 23:45:13 +0000 (00:45 +0100)]
refactor: drop deprecated collection.abc aliases
Daniele Varrazzo [Fri, 27 Dec 2024 23:32:55 +0000 (00:32 +0100)]
refactor: use re objects for typing of Match and Pattern
Daniele Varrazzo [Fri, 27 Dec 2024 23:20:05 +0000 (00:20 +0100)]
docs: suggest using pyupgrade when dropping a Python version
stankudrow [Fri, 27 Dec 2024 05:23:40 +0000 (08:23 +0300)]
run through pyupgrade --py38-plus
Daniele Varrazzo [Fri, 27 Dec 2024 23:18:15 +0000 (00:18 +0100)]
Merge pull request #980 from psycopg/pre-commit
Add pre-commit hooks
Daniele Varrazzo [Fri, 27 Dec 2024 02:34:00 +0000 (03:34 +0100)]
docs: document pre-commit usage
Daniele Varrazzo [Fri, 27 Dec 2024 02:30:28 +0000 (03:30 +0100)]
lint: add typing annotations to pass pre-commit
Pre-commit seems to run mypy in parallel batches, each with about 20
files. In this mode, certain tests that pass when running mypy all in
once or file-by-file, fail.
In the current state, both running mypy without arguments or running it
in pre-commit seem to work.
Daniele Varrazzo [Fri, 27 Dec 2024 01:55:16 +0000 (02:55 +0100)]
ci: configure lint step to run pre-commit
Daniele Varrazzo [Fri, 27 Dec 2024 01:48:20 +0000 (02:48 +0100)]
ci: add pre-commit configuration
Daniele Varrazzo [Fri, 27 Dec 2024 01:44:43 +0000 (02:44 +0100)]
chore: ignore certain files from mypy linting
Something weird happens. Certain files pass mypy lint on their own, but
not in combination. This is mostly related to `psycopg/pq/pq_ctypes.py`
and `psycopg/pq/_pq_ctypes.py`. This problem seems largely related to
incomplete ctypes definitions.
Daniele Varrazzo [Thu, 26 Dec 2024 18:46:32 +0000 (19:46 +0100)]
chore: drop annotation on empty lists, now unneeded
If needed, it is considered wrong anyway, because it should be annotated
as class attribute.
Daniele Varrazzo [Thu, 26 Dec 2024 16:58:16 +0000 (17:58 +0100)]
docs: restore some lost comments in pyproject.toml files
Daniele Varrazzo [Thu, 26 Dec 2024 16:37:46 +0000 (17:37 +0100)]
Merge branch 'dont-lose-notifies'
Daniele Varrazzo [Sun, 22 Dec 2024 19:38:58 +0000 (20:38 +0100)]
fix: always gather the notifications received
Starting to register them after the first call to notifies() is somewhat
weird. We also risk to lose notifications in a case such as:
conn.execute("listen foo")
conn.execute("listen bar")
for n in conn.notifies():
...
Daniele Varrazzo [Sat, 21 Dec 2024 01:16:57 +0000 (02:16 +0100)]
fix: don't lose notifications between notifies() calls
This allows to stop periodically the generator to run some queries (for
example to LISTEN/UNLISTEN certain channels) and start the generator
again without fearing to lose notification in the window.
Cloes #962.
Daniele Varrazzo [Thu, 26 Dec 2024 16:35:38 +0000 (17:35 +0100)]
Merge pull request #977 from stankudrow/drop-py38
Drop Py3.8 dependencies from `pyproject.toml`s and CI/CD workflows
stankudrow [Mon, 23 Dec 2024 16:52:26 +0000 (19:52 +0300)]
chore: drop Python 3.8 support
Close #976.
Daniele Varrazzo [Mon, 23 Dec 2024 16:27:58 +0000 (17:27 +0100)]
chore: bump psycopg package version to 3.3.0.dev1
Daniele Varrazzo [Mon, 23 Dec 2024 16:38:25 +0000 (17:38 +0100)]
Merge pull request #974 from psycopg/convert-to-toml
Convert setup.py/setup.cfg files to pyproject.toml
Daniele Varrazzo [Mon, 23 Dec 2024 16:37:14 +0000 (17:37 +0100)]
chore: drop Download links from metadata
Daniele Varrazzo [Sun, 22 Dec 2024 01:37:44 +0000 (02:37 +0100)]
chore: adapt development tools to toml files
Daniele Varrazzo [Sun, 22 Dec 2024 01:50:55 +0000 (02:50 +0100)]
refactor(pool): convert setup.cfg to pyproject.toml
Daniele Varrazzo [Sun, 22 Dec 2024 01:43:43 +0000 (02:43 +0100)]
refactor(c): convert setup.cfg to pyproject.toml
Drop setup.py: move the build configuration to a build backend module.
Daniele Varrazzo [Sun, 22 Dec 2024 01:26:17 +0000 (02:26 +0100)]
refactor(psycopg): convert setup.cfg to pyproject.toml
Drop unneeded setup.py. The end of an era.
Daniele Varrazzo [Sun, 22 Dec 2024 00:05:16 +0000 (01:05 +0100)]
ci: move Python packages used for test into before-build script
Daniele Varrazzo [Sat, 21 Dec 2024 03:50:45 +0000 (04:50 +0100)]
ci(windows): use bash as default shell
Make packages-bin and tests workflow consistent.
dependabot[bot] [Sun, 1 Dec 2024 07:11:57 +0000 (07:11 +0000)]
chore(deps): bump pypa/cibuildwheel in the actions group
Bumps the actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel).
Updates `pypa/cibuildwheel` from 2.21.3 to 2.22.0
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.21.3...v2.22.0)
---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: actions
...
Signed-off-by: dependabot[bot] <support@github.com>
Daniele Varrazzo [Sat, 21 Dec 2024 14:31:21 +0000 (15:31 +0100)]
Merge pull request #966 from trim21/try-vcpkg
Use vcpkg to install libpq on windows
Daniele Varrazzo [Sat, 21 Dec 2024 02:21:43 +0000 (03:21 +0100)]
refactor: rewrite the pg_config stub in a more idiomatic way
Trim21 [Sun, 15 Dec 2024 22:38:08 +0000 (06:38 +0800)]
ci: use vcpkg to install libpq on windows
Daniele Varrazzo [Mon, 16 Dec 2024 12:44:37 +0000 (13:44 +0100)]
test(windows): verify that the libpq used is what expected
Daniele Varrazzo [Fri, 20 Dec 2024 12:12:54 +0000 (13:12 +0100)]
fix: call the notifies callback while the notifies generator is used
Close #972
Daniele Varrazzo [Fri, 20 Dec 2024 13:57:37 +0000 (14:57 +0100)]
ci: bump runner to macOS 13
macOS 12 runners are now deprecated.
Daniele Varrazzo [Fri, 20 Dec 2024 17:55:19 +0000 (18:55 +0100)]
chore: bump mypy version to 1.14
Daniele Varrazzo [Sat, 23 Nov 2024 23:26:57 +0000 (00:26 +0100)]
docs: drop duplicate, out of place, statement
Daniele Varrazzo [Sat, 16 Nov 2024 20:40:45 +0000 (21:40 +0100)]
docs(pool): fix ticket link in news page
Máté Gyöngyösi [Fri, 15 Nov 2024 13:58:02 +0000 (14:58 +0100)]
docs: extend `libpq` install instructions for cross-platform use
See #950.
Christian Clauss [Tue, 15 Oct 2024 07:40:25 +0000 (09:40 +0200)]
build_macos_arm64.sh: Upgrade to Python 3.13 production release
Daniele Varrazzo [Thu, 14 Nov 2024 13:56:03 +0000 (14:56 +0100)]
chore: bump psycopg_pool package version to 3.2.4
Daniele Varrazzo [Wed, 13 Nov 2024 13:19:12 +0000 (14:19 +0100)]
fix(pool): print a warning if gather times out on del
In Python 3.13 something changed on interpreter shutdown and now
stopping threads on __del__ fails.
See #930, #954.
Daniele Varrazzo [Sun, 15 Sep 2024 11:53:37 +0000 (13:53 +0200)]
docs(pool): note compatibility with Python 3.13
Daniele Varrazzo [Thu, 14 Nov 2024 09:32:58 +0000 (10:32 +0100)]
chore: gitignore IntelliJ .idea file
Daniele Varrazzo [Wed, 13 Nov 2024 14:07:39 +0000 (15:07 +0100)]
ci: bump SQLAlchemy test versions
Daniele Varrazzo [Wed, 13 Nov 2024 13:31:32 +0000 (14:31 +0100)]
docs(pool): suggest closing the pool explicitly
On Python 3.13 threads may fail to stop.
See #930, #954.
Stanley Kudrow [Thu, 31 Oct 2024 06:23:11 +0000 (09:23 +0300)]
test(numpy): account for 32 bits systems in size checks
dependabot[bot] [Fri, 1 Nov 2024 07:25:31 +0000 (07:25 +0000)]
chore(deps): bump pypa/cibuildwheel in the actions group
Bumps the actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel).
Updates `pypa/cibuildwheel` from 2.21.1 to 2.21.3
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.21.1...v2.21.3)
---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: actions
...
Signed-off-by: dependabot[bot] <support@github.com>