]> git.ipfire.org Git - thirdparty/psycopg.git/log
thirdparty/psycopg.git
3 years agoUse the clear() method in PrepareManager.maintain()
Daniele Varrazzo [Tue, 16 Nov 2021 13:16:57 +0000 (14:16 +0100)] 
Use the clear() method in PrepareManager.maintain()

3 years agoAdd handle() and validate() methods to PrepareManager
Denis Laxalde [Mon, 18 Oct 2021 09:42:11 +0000 (11:42 +0200)] 
Add handle() and validate() methods to PrepareManager

These essentially perform the same steps as maintain() but with only
query information first, and then once results become available.

3 years agoAdd a rotate() method to PrepareManager
Denis Laxalde [Mon, 18 Oct 2021 09:31:33 +0000 (11:31 +0200)] 
Add a rotate() method to PrepareManager

3 years agoAdd a check_results() method to PrepareManager
Denis Laxalde [Mon, 18 Oct 2021 09:31:33 +0000 (11:31 +0200)] 
Add a check_results() method to PrepareManager

3 years agoAdd a setdefault() method to PrepareManager
Denis Laxalde [Mon, 18 Oct 2021 09:28:03 +0000 (11:28 +0200)] 
Add a setdefault() method to PrepareManager

3 years agoAdd a should_discard() method to PrepareManager
Denis Laxalde [Mon, 18 Oct 2021 09:18:12 +0000 (11:18 +0200)] 
Add a should_discard() method to PrepareManager

3 years agoAdd a key() method to PrepareManager
Denis Laxalde [Mon, 18 Oct 2021 09:00:28 +0000 (11:00 +0200)] 
Add a key() method to PrepareManager

3 years agoPeg version of the docs theme package
Daniele Varrazzo [Sun, 28 Nov 2021 23:16:24 +0000 (00:16 +0100)] 
Peg version of the docs theme package

3 years agoInstall the pool in the docs environment in editable mode
Daniele Varrazzo [Sun, 28 Nov 2021 22:49:40 +0000 (23:49 +0100)] 
Install the pool in the docs environment in editable mode

3 years agoAdd sphinx link to docs footer, drop page source link
Daniele Varrazzo [Sun, 28 Nov 2021 22:39:36 +0000 (23:39 +0100)] 
Add sphinx link to docs footer, drop page source link

3 years agoMerge branch 'two-phase-commit'
Daniele Varrazzo [Sun, 28 Nov 2021 19:24:46 +0000 (20:24 +0100)] 
Merge branch 'two-phase-commit'

3 years agoClose connections in TPC tests to avoid warnings in tests
Daniele Varrazzo [Sun, 28 Nov 2021 18:50:59 +0000 (19:50 +0100)] 
Close connections in TPC tests to avoid warnings in tests

3 years agoAdd documentation for two-phase commit support
Daniele Varrazzo [Sun, 28 Nov 2021 18:26:24 +0000 (19:26 +0100)] 
Add documentation for two-phase commit support

3 years agoAdd type annotations to two-phase commit tests
Daniele Varrazzo [Mon, 8 Nov 2021 14:43:39 +0000 (15:43 +0100)] 
Add type annotations to two-phase commit tests

3 years agoMove two-phase transaction fixture to a common place
Daniele Varrazzo [Sat, 30 Oct 2021 17:44:37 +0000 (19:44 +0200)] 
Move two-phase transaction fixture to a common place

Importing it across test cases requires too silly workarounds.

Also do without attrgetter.

3 years agoAdd two-phase support method to async connection
Daniele Varrazzo [Sat, 30 Oct 2021 17:35:28 +0000 (19:35 +0200)] 
Add two-phase support method to async connection

3 years agoAdd two-phase commit DBAPI Connection methods
Daniele Varrazzo [Tue, 26 Oct 2021 23:50:45 +0000 (01:50 +0200)] 
Add two-phase commit DBAPI Connection methods

3 years agoDrop in dbapi tests for two-phase commit support
Daniele Varrazzo [Tue, 26 Oct 2021 15:58:21 +0000 (16:58 +0100)] 
Drop in dbapi tests for two-phase commit support

3 years agoStart working on Psycopg 3.1
Daniele Varrazzo [Sun, 28 Nov 2021 17:02:32 +0000 (18:02 +0100)] 
Start working on Psycopg 3.1

3 years agoBump to next release number 3.0.5
Daniele Varrazzo [Sun, 28 Nov 2021 16:52:07 +0000 (17:52 +0100)] 
Bump to next release number

3 years agoMerge branch 'fix-165'
Daniele Varrazzo [Sun, 28 Nov 2021 16:40:37 +0000 (17:40 +0100)] 
Merge branch 'fix-165'

3 years agoDon't clobber exception if rollback fails on transaction exit
Daniele Varrazzo [Sun, 28 Nov 2021 16:15:16 +0000 (17:15 +0100)] 
Don't clobber exception if rollback fails on transaction exit

Just raise a warning, consistently with what happens to the connection.

Close #165.

3 years agoMerge branch 'fix-158'
Daniele Varrazzo [Sun, 28 Nov 2021 16:39:54 +0000 (17:39 +0100)] 
Merge branch 'fix-158'

3 years agoMake sure to close selectors after usage
Daniele Varrazzo [Sat, 27 Nov 2021 22:30:53 +0000 (23:30 +0100)] 
Make sure to close selectors after usage

Failing to do so leaks file descriptors and may lead to "Too many open
files" errors (experienced on macOS, using kqueue selector).

Close #158

3 years agodocs: fetch libpq functions index from PostgreSQL 14 docs
Daniele Varrazzo [Sat, 27 Nov 2021 23:08:27 +0000 (00:08 +0100)] 
docs: fetch libpq functions index from PostgreSQL 14 docs

3 years agoImprove a few adaptation-related error messages
Daniele Varrazzo [Tue, 23 Nov 2021 20:23:47 +0000 (21:23 +0100)] 
Improve a few adaptation-related error messages

3 years agoGitignore the build directories, but not /tools/build/
Daniele Varrazzo [Tue, 23 Nov 2021 20:22:30 +0000 (21:22 +0100)] 
Gitignore the build directories, but not /tools/build/

Consolidate other local ignores into the main one, as all the ignores
are generic.

3 years agoGuard delay_connection in tests for negative sleep argument
Daniele Varrazzo [Mon, 22 Nov 2021 01:44:49 +0000 (02:44 +0100)] 
Guard delay_connection in tests for negative sleep argument

It happens if connection time was slow enough.

3 years agoUse an empty string instead on None in the copy work queue
Daniele Varrazzo [Mon, 22 Nov 2021 01:23:36 +0000 (02:23 +0100)] 
Use an empty string instead on None in the copy work queue

The test for copy end is just "if not item", so the empty string is
actually never used as a piece of data. This simplifies the type of the
queue.

3 years agoFix typo in comment
Daniele Varrazzo [Sun, 21 Nov 2021 20:24:48 +0000 (21:24 +0100)] 
Fix typo in comment

3 years agoAdd a minimal coverage configuration
Denis Laxalde [Sun, 21 Nov 2021 08:49:58 +0000 (09:49 +0100)] 
Add a minimal coverage configuration

We use pytest-cov, as it enables running coverage with pytest in a
single command.
We exclude 'if TYPE_CHECKING:' and ellipsis lines from report.

3 years agoMerge pull request #120 from dlax/waiting
Daniele Varrazzo [Tue, 16 Nov 2021 10:31:42 +0000 (11:31 +0100)] 
Merge pull request #120 from dlax/waiting

support RW ready in waiting functions

3 years agoPossibly send a Ready.RW value to generators waiting on RW 120/head
Denis Laxalde [Tue, 12 Oct 2021 13:40:36 +0000 (15:40 +0200)] 
Possibly send a Ready.RW value to generators waiting on RW

In some generators, we might be interested in receiving both read-ready
and write-ready event at the same time.

Per previous commits, all wait*() functions support this.

This is covered by test_wait_ready(), which now maps Wait.RW to
Ready.RW.

3 years agoAlways stop monitoring fds in wait_{,conn_}async()
Denis Laxalde [Fri, 12 Nov 2021 13:34:43 +0000 (14:34 +0100)] 
Always stop monitoring fds in wait_{,conn_}async()

3 years agoHandle RW-ready in wait(,_conn)_async()
Denis Laxalde [Thu, 11 Nov 2021 09:59:59 +0000 (10:59 +0100)] 
Handle RW-ready in wait(,_conn)_async()

3 years agoAdd an assertion in wait_selector() / wait_epoll()
Denis Laxalde [Sun, 17 Oct 2021 19:02:41 +0000 (21:02 +0200)] 
Add an assertion in wait_selector() / wait_epoll()

Making sure the ready event matches what we're waiting on.

3 years agoFix wait_epoll() when the fd is read- and write-ready
Denis Laxalde [Sun, 17 Oct 2021 18:59:58 +0000 (20:59 +0200)] 
Fix wait_epoll() when the fd is read- and write-ready

We follow the implementation of EpollSelector.select(). The
test_wait_ready() introduced previously added now passes for
wait_epoll().

3 years agoAdd unit tests for wait*() functions
Denis Laxalde [Sun, 17 Oct 2021 15:25:32 +0000 (17:25 +0200)] 
Add unit tests for wait*() functions

We check that when a generator waits for a Wait value, it gets a Ready
value that matches. The socket we wait on is read- and write-ready.

These tests hang on non-Linux platform in CI, perhaps because some
socket operations (e.g. fileno()) are not portable, so we only run them
on Linux.

As is, wait_epoll() fails this test because it assumes that readiness is
either read or write, not both.

3 years agoWarm up database before running tests
Daniele Varrazzo [Mon, 15 Nov 2021 01:15:47 +0000 (02:15 +0100)] 
Warm up database before running tests

Sometimes, in the test CI, the first connection may take a long time,
and if the first test is about connection timeout, it might fail.

https://github.com/psycopg/psycopg/runs/4206004327?check_suite_focus=true

3 years agoDisable running CI tests on tag
Daniele Varrazzo [Mon, 15 Nov 2021 00:00:45 +0000 (01:00 +0100)] 
Disable running CI tests on tag

At least I hope. According to GitHub Docs [1]:

> If you define only `tags` or only `branches`, the workflow won't run for
> events affecting the undefined Git ref.

[1]: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestbranchestags

3 years agoFix sentence about binary packages not supporting Alpine Linux
Daniele Varrazzo [Sun, 14 Nov 2021 23:36:06 +0000 (00:36 +0100)] 
Fix sentence about binary packages not supporting Alpine Linux

3 years agoAdd missing classifiers for Python 3.10
Daniele Varrazzo [Sun, 14 Nov 2021 23:28:35 +0000 (00:28 +0100)] 
Add missing classifiers for Python 3.10

3 years agoBump to next dev packages
Daniele Varrazzo [Sun, 14 Nov 2021 23:27:20 +0000 (00:27 +0100)] 
Bump to next dev packages

3 years agoSet packages version numbers for release 3.0.4 pool-3.0.2
Daniele Varrazzo [Sun, 14 Nov 2021 21:58:14 +0000 (22:58 +0100)] 
Set packages version numbers for release

3 years agoAdd mention to the libpq upgrade ticket in out tracker
Daniele Varrazzo [Sun, 14 Nov 2021 21:55:41 +0000 (22:55 +0100)] 
Add mention to the libpq upgrade ticket in out tracker

Close #149.

3 years agoMerge branch 'upgrade-lipbq'
Daniele Varrazzo [Sun, 14 Nov 2021 21:48:40 +0000 (22:48 +0100)] 
Merge branch 'upgrade-lipbq'

3 years agoMention libpq upgrade in news file
Daniele Varrazzo [Sun, 14 Nov 2021 21:48:22 +0000 (22:48 +0100)] 
Mention libpq upgrade in news file

3 years agoUpgrade libpq in Windows packages
Daniele Varrazzo [Thu, 11 Nov 2021 21:14:11 +0000 (22:14 +0100)] 
Upgrade libpq in Windows packages

3 years agoUpdate alpine linux packages before building wheels
Daniele Varrazzo [Thu, 11 Nov 2021 21:20:38 +0000 (22:20 +0100)] 
Update alpine linux packages before building wheels

3 years agoUpgrade libpq in macOS packages
Daniele Varrazzo [Thu, 11 Nov 2021 20:37:20 +0000 (21:37 +0100)] 
Upgrade libpq in macOS packages

3 years agostrip_wheel: don't require to install the zip system package
Daniele Varrazzo [Thu, 11 Nov 2021 22:12:16 +0000 (23:12 +0100)] 
strip_wheel: don't require to install the zip system package

Use the zipfile module command line.

3 years agostrip_wheel: pass script parameters to the strip command
Daniele Varrazzo [Thu, 11 Nov 2021 21:56:16 +0000 (22:56 +0100)] 
strip_wheel: pass script parameters to the strip command

3 years agoInitialize UTC in the timezones cache
Daniele Varrazzo [Sun, 14 Nov 2021 18:30:18 +0000 (19:30 +0100)] 
Initialize UTC in the timezones cache

Not having it might cause spurious errors in particular cases, we see it
failing sometimes in the CI on Windows (which lacks the timezone
database) on Python 3.6 with a ridiculous:

    unknown PostgreSQL timezone: 'UTC'; will use UTC

The similar cache on the Python side is primed the same way.

3 years agoDispose more carefully of connections and threads in concurrency tests
Daniele Varrazzo [Sun, 14 Nov 2021 19:34:22 +0000 (20:34 +0100)] 
Dispose more carefully of connections and threads in concurrency tests

I have seen some segfault on Windows sometimes, probably with the
test_concurrency thread stomping over the memory of the process forked
in test_multiprocess_close.

Async tests refactored the same way, although they don't exhibit the
same problem.

3 years agoFix CI tests
Daniele Varrazzo [Sun, 14 Nov 2021 18:52:42 +0000 (19:52 +0100)] 
Fix CI tests

I made this change earlier but committed the wrong branch... Sowwy.

3 years agoDrop unneeded 'cursor()' in docs
Daniele Varrazzo [Sun, 14 Nov 2021 17:41:33 +0000 (18:41 +0100)] 
Drop unneeded 'cursor()' in docs

3 years agoConfigure pytest color output in test using env var
Daniele Varrazzo [Sun, 14 Nov 2021 17:20:16 +0000 (18:20 +0100)] 
Configure pytest color output in test using env var

Less repetitions.

3 years agoConfigure pytest warning control in pyproject.toml
Denis Laxalde [Sun, 14 Nov 2021 16:15:10 +0000 (17:15 +0100)] 
Configure pytest warning control in pyproject.toml

This reduces duplication and makes the configuration available when
testing outside CI.

3 years agoSpecify older libpq in test matrix now that 14 is the default.
Daniele Varrazzo [Sat, 13 Nov 2021 22:58:54 +0000 (23:58 +0100)] 
Specify older libpq in test matrix now that 14 is the default.

3 years agoFix Python version in Windows test
Daniele Varrazzo [Sun, 14 Nov 2021 00:10:19 +0000 (01:10 +0100)] 
Fix Python version in Windows test

3 years agoAdd news entry about _compat dependency removed.
Daniele Varrazzo [Sat, 13 Nov 2021 23:38:27 +0000 (00:38 +0100)] 
Add news entry about _compat dependency removed.

3 years agoAdd psycopg_pool._compat module.
Daniele Varrazzo [Sat, 13 Nov 2021 22:41:42 +0000 (23:41 +0100)] 
Add psycopg_pool._compat module.

Using psycopg._compat creates an unwanted coupling between the modules.
As it is now psycopg_pool 3.0.1 is not compatible with psycopg < 3.0.3
because of the dependency on Deque added in 1a5b09b2.

3 years agoLess strict gitignore of the 'build' dir
Daniele Varrazzo [Sat, 13 Nov 2021 22:25:54 +0000 (23:25 +0100)] 
Less strict gitignore of the 'build' dir

It was hiding changes in the `tools/build` directory...

3 years agoBump pool version number to next dev release
Daniele Varrazzo [Sat, 13 Nov 2021 22:25:06 +0000 (23:25 +0100)] 
Bump pool version number to next dev release

3 years agoAdd news entry about zoneinfo segfault fix
Daniele Varrazzo [Sat, 13 Nov 2021 22:20:44 +0000 (23:20 +0100)] 
Add news entry about zoneinfo segfault fix

3 years agoMerge branch 'stricter-tests'
Daniele Varrazzo [Sat, 13 Nov 2021 22:15:08 +0000 (23:15 +0100)] 
Merge branch 'stricter-tests'

3 years agoDocs typo fixed
Daniele Varrazzo [Sat, 13 Nov 2021 22:08:05 +0000 (23:08 +0100)] 
Docs typo fixed

3 years agoSolve race conditions in test
Daniele Varrazzo [Sat, 13 Nov 2021 17:15:58 +0000 (18:15 +0100)] 
Solve race conditions in test

3 years agoSilence test warnings on Python 3.6
Daniele Varrazzo [Sat, 13 Nov 2021 17:01:28 +0000 (18:01 +0100)] 
Silence test warnings on Python 3.6

3 years agoFix segfault using timezones on Python 3.6 in -Werror mode
Daniele Varrazzo [Sat, 13 Nov 2021 18:16:52 +0000 (19:16 +0100)] 
Fix segfault using timezones on Python 3.6 in -Werror mode

Also fix a couple of attribute errors in less used code paths (in the
branches reporting errors when using unsupported datestyles).

Related: https://github.com/pganssle/zoneinfo/issues/109

3 years agoClose all the resources during tests
Daniele Varrazzo [Sat, 13 Nov 2021 14:56:43 +0000 (15:56 +0100)] 
Close all the resources during tests

This allows to run the test suite with -Werror.

3 years agoRaise error on warnings in tests
Daniele Varrazzo [Sat, 13 Nov 2021 16:14:46 +0000 (17:14 +0100)] 
Raise error on warnings in tests

3 years agoAssume Python 3.10 available in the test runners
Daniele Varrazzo [Sat, 13 Nov 2021 16:12:21 +0000 (17:12 +0100)] 
Assume Python 3.10 available in the test runners

3 years agoDrop string-bytes comparisons
Daniele Varrazzo [Sat, 13 Nov 2021 14:05:19 +0000 (15:05 +0100)] 
Drop string-bytes comparisons

They were mostly internal ones, coming from dicts containing strings and
bytes as keys.

Close #147

3 years agoEnable error on str-bytes comparison in pytest
Daniele Varrazzo [Sat, 13 Nov 2021 15:02:46 +0000 (16:02 +0100)] 
Enable error on str-bytes comparison in pytest

See #147

3 years agoShorter names in the build
Daniele Varrazzo [Thu, 11 Nov 2021 21:49:34 +0000 (22:49 +0100)] 
Shorter names in the build

This way we should be able to more of the grid parameters in the left
column of the Github build run page.

3 years agoBump to next dev release
Daniele Varrazzo [Thu, 11 Nov 2021 20:02:09 +0000 (21:02 +0100)] 
Bump to next dev release

3 years agoUpdate dep on pytest-asyncio
Mikel Olasagasti Uranga [Wed, 10 Nov 2021 23:31:19 +0000 (00:31 +0100)] 
Update dep on pytest-asyncio

Works fine with 0.16.0

See #143

3 years agoBump version numbers to release psycopg 3.0.3 and pool 3.0.1 3.0.3 pool-3.0.1
Daniele Varrazzo [Wed, 10 Nov 2021 13:30:31 +0000 (14:30 +0100)] 
Bump version numbers to release psycopg 3.0.3 and pool 3.0.1

3 years agoFix duplicate sentence in connection pool docs
Daniele Varrazzo [Wed, 10 Nov 2021 13:28:38 +0000 (14:28 +0100)] 
Fix duplicate sentence in connection pool docs

3 years agoMerge branch 'fix-144'
Daniele Varrazzo [Wed, 10 Nov 2021 02:00:59 +0000 (03:00 +0100)] 
Merge branch 'fix-144'

3 years agoAdd release notes file for the psycopg_pool package
Daniele Varrazzo [Wed, 10 Nov 2021 01:22:20 +0000 (02:22 +0100)] 
Add release notes file for the psycopg_pool package

3 years agoDon't leave connections in transaction after pool.check()
Daniele Varrazzo [Wed, 10 Nov 2021 01:21:37 +0000 (02:21 +0100)] 
Don't leave connections in transaction after pool.check()

Close #144.

3 years agoMerge branch 'mypy-tests/all'
Daniele Varrazzo [Wed, 10 Nov 2021 01:57:45 +0000 (02:57 +0100)] 
Merge branch 'mypy-tests/all'

3 years agoLet mypy check all tests/*
Denis Laxalde [Tue, 2 Nov 2021 10:58:00 +0000 (11:58 +0100)] 
Let mypy check all tests/*

Per previous commits, the whole test suite should be clean.

3 years agoInstall test dependencies in 'mypy' tox env
Denis Laxalde [Fri, 5 Nov 2021 12:35:13 +0000 (13:35 +0100)] 
Install test dependencies in 'mypy' tox env

We need this at least for tenacity.

3 years agoDeclare 'elapsed' value before usage in async connection tests
Denis Laxalde [Fri, 5 Nov 2021 12:21:23 +0000 (13:21 +0100)] 
Declare 'elapsed' value before usage in async connection tests

Resolves mypy error:
  error: No binding for nonlocal "elapsed" found  [misc]

3 years agoDeclare tx_params using TypeDict values in connection tests
Denis Laxalde [Fri, 5 Nov 2021 12:18:56 +0000 (13:18 +0100)] 
Declare tx_params using TypeDict values in connection tests

This resolves a bunch of mypy errors because the second-level values of
tx_params are of heterogeneous types.

3 years agoIgnore mypy 'attr-defined' error about asyncio.ProactorEventLoop in tests
Denis Laxalde [Fri, 5 Nov 2021 12:10:19 +0000 (13:10 +0100)] 
Ignore mypy 'attr-defined' error about asyncio.ProactorEventLoop in tests

3 years agoIgnore mypy 'index' errors about cursor.fetchone() in connection tests
Denis Laxalde [Fri, 5 Nov 2021 12:08:56 +0000 (13:08 +0100)] 
Ignore mypy 'index' errors about cursor.fetchone() in connection tests

3 years agoAdd type variable to *Cursor in connection tests
Denis Laxalde [Fri, 5 Nov 2021 12:05:20 +0000 (13:05 +0100)] 
Add type variable to *Cursor in connection tests

3 years agoAdjust types in test_connection*::test_row_factory()
Denis Laxalde [Fri, 5 Nov 2021 11:05:58 +0000 (12:05 +0100)] 
Adjust types in test_connection*::test_row_factory()

We avoid using the same variable name for different types. At the end,
there seems to be something wrong, thus add a TODO for later.

3 years agoIgnore mypy 'comparison-overlap' error about row_factory in tests
Denis Laxalde [Fri, 5 Nov 2021 10:49:57 +0000 (11:49 +0100)] 
Ignore mypy 'comparison-overlap' error about row_factory in tests

3 years agoCatch explicit exception type in test_connect_badargs()
Denis Laxalde [Fri, 5 Nov 2021 10:47:10 +0000 (11:47 +0100)] 
Catch explicit exception type in test_connect_badargs()

Work around the type of pytest.raises() which appears too strict.

3 years agoOnly declare type of 'the_conninfo' in test_connect_args()
Denis Laxalde [Fri, 5 Nov 2021 10:45:48 +0000 (11:45 +0100)] 
Only declare type of 'the_conninfo' in test_connect_args()

Inform mypy that we're not passing a None to conninfo_to_dict().

3 years agoIgnore mypy 'comparison-overlap' in connection tests
Denis Laxalde [Fri, 5 Nov 2021 10:45:15 +0000 (11:45 +0100)] 
Ignore mypy 'comparison-overlap' in connection tests

3 years agoLet mypy ignore uvloop imports, missing types
Denis Laxalde [Tue, 2 Nov 2021 10:16:53 +0000 (11:16 +0100)] 
Let mypy ignore uvloop imports, missing types

3 years agoAllow mypy implicit re-export for tenacity
Denis Laxalde [Tue, 2 Nov 2021 09:53:35 +0000 (10:53 +0100)] 
Allow mypy implicit re-export for tenacity

Tenacity does not explicitly re-export names. Ignoring this fixes a
couple of mypy warning in tests/conftests.py.

3 years agoMake test_concurrency*.py mypy-clean
Denis Laxalde [Fri, 5 Nov 2021 10:30:26 +0000 (11:30 +0100)] 
Make test_concurrency*.py mypy-clean

3 years agoMake test_copy*.py mypy-clean
Denis Laxalde [Fri, 5 Nov 2021 10:18:03 +0000 (11:18 +0100)] 
Make test_copy*.py mypy-clean