]>
git.ipfire.org Git - thirdparty/psycopg.git/log
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.
Denis Laxalde [Fri, 12 Nov 2021 13:34:43 +0000 (14:34 +0100)]
Always stop monitoring fds in wait_{,conn_}async()
Denis Laxalde [Thu, 11 Nov 2021 09:59:59 +0000 (10:59 +0100)]
Handle RW-ready in wait(,_conn)_async()
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.
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().
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.
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
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
Daniele Varrazzo [Sun, 14 Nov 2021 23:36:06 +0000 (00:36 +0100)]
Fix sentence about binary packages not supporting Alpine Linux
Daniele Varrazzo [Sun, 14 Nov 2021 23:28:35 +0000 (00:28 +0100)]
Add missing classifiers for Python 3.10
Daniele Varrazzo [Sun, 14 Nov 2021 23:27:20 +0000 (00:27 +0100)]
Bump to next dev packages
Daniele Varrazzo [Sun, 14 Nov 2021 21:58:14 +0000 (22:58 +0100)]
Set packages version numbers for release
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.
Daniele Varrazzo [Sun, 14 Nov 2021 21:48:40 +0000 (22:48 +0100)]
Merge branch 'upgrade-lipbq'
Daniele Varrazzo [Sun, 14 Nov 2021 21:48:22 +0000 (22:48 +0100)]
Mention libpq upgrade in news file
Daniele Varrazzo [Thu, 11 Nov 2021 21:14:11 +0000 (22:14 +0100)]
Upgrade libpq in Windows packages
Daniele Varrazzo [Thu, 11 Nov 2021 21:20:38 +0000 (22:20 +0100)]
Update alpine linux packages before building wheels
Daniele Varrazzo [Thu, 11 Nov 2021 20:37:20 +0000 (21:37 +0100)]
Upgrade libpq in macOS packages
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.
Daniele Varrazzo [Thu, 11 Nov 2021 21:56:16 +0000 (22:56 +0100)]
strip_wheel: pass script parameters to the strip command
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.
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.
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.
Daniele Varrazzo [Sun, 14 Nov 2021 17:41:33 +0000 (18:41 +0100)]
Drop unneeded 'cursor()' in docs
Daniele Varrazzo [Sun, 14 Nov 2021 17:20:16 +0000 (18:20 +0100)]
Configure pytest color output in test using env var
Less repetitions.
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.
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.
Daniele Varrazzo [Sun, 14 Nov 2021 00:10:19 +0000 (01:10 +0100)]
Fix Python version in Windows test
Daniele Varrazzo [Sat, 13 Nov 2021 23:38:27 +0000 (00:38 +0100)]
Add news entry about _compat dependency removed.
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 .
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...
Daniele Varrazzo [Sat, 13 Nov 2021 22:25:06 +0000 (23:25 +0100)]
Bump pool version number to next dev release
Daniele Varrazzo [Sat, 13 Nov 2021 22:20:44 +0000 (23:20 +0100)]
Add news entry about zoneinfo segfault fix
Daniele Varrazzo [Sat, 13 Nov 2021 22:15:08 +0000 (23:15 +0100)]
Merge branch 'stricter-tests'
Daniele Varrazzo [Sat, 13 Nov 2021 22:08:05 +0000 (23:08 +0100)]
Docs typo fixed
Daniele Varrazzo [Sat, 13 Nov 2021 17:15:58 +0000 (18:15 +0100)]
Solve race conditions in test
Daniele Varrazzo [Sat, 13 Nov 2021 17:01:28 +0000 (18:01 +0100)]
Silence test warnings on Python 3.6
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
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.
Daniele Varrazzo [Sat, 13 Nov 2021 16:14:46 +0000 (17:14 +0100)]
Raise error on warnings in tests
Daniele Varrazzo [Sat, 13 Nov 2021 16:12:21 +0000 (17:12 +0100)]
Assume Python 3.10 available in the test runners
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
Daniele Varrazzo [Sat, 13 Nov 2021 15:02:46 +0000 (16:02 +0100)]
Enable error on str-bytes comparison in pytest
See #147
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.
Daniele Varrazzo [Thu, 11 Nov 2021 20:02:09 +0000 (21:02 +0100)]
Bump to next dev release
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
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
Daniele Varrazzo [Wed, 10 Nov 2021 13:28:38 +0000 (14:28 +0100)]
Fix duplicate sentence in connection pool docs
Daniele Varrazzo [Wed, 10 Nov 2021 02:00:59 +0000 (03:00 +0100)]
Merge branch 'fix-144'
Daniele Varrazzo [Wed, 10 Nov 2021 01:22:20 +0000 (02:22 +0100)]
Add release notes file for the psycopg_pool package
Daniele Varrazzo [Wed, 10 Nov 2021 01:21:37 +0000 (02:21 +0100)]
Don't leave connections in transaction after pool.check()
Close #144.
Daniele Varrazzo [Wed, 10 Nov 2021 01:57:45 +0000 (02:57 +0100)]
Merge branch 'mypy-tests/all'
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.
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.
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]
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.
Denis Laxalde [Fri, 5 Nov 2021 12:10:19 +0000 (13:10 +0100)]
Ignore mypy 'attr-defined' error about asyncio.ProactorEventLoop in tests
Denis Laxalde [Fri, 5 Nov 2021 12:08:56 +0000 (13:08 +0100)]
Ignore mypy 'index' errors about cursor.fetchone() in connection tests
Denis Laxalde [Fri, 5 Nov 2021 12:05:20 +0000 (13:05 +0100)]
Add type variable to *Cursor in connection tests
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.
Denis Laxalde [Fri, 5 Nov 2021 10:49:57 +0000 (11:49 +0100)]
Ignore mypy 'comparison-overlap' error about row_factory in tests
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.
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().
Denis Laxalde [Fri, 5 Nov 2021 10:45:15 +0000 (11:45 +0100)]
Ignore mypy 'comparison-overlap' in connection tests
Denis Laxalde [Tue, 2 Nov 2021 10:16:53 +0000 (11:16 +0100)]
Let mypy ignore uvloop imports, missing types
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.
Denis Laxalde [Fri, 5 Nov 2021 10:30:26 +0000 (11:30 +0100)]
Make test_concurrency*.py mypy-clean
Denis Laxalde [Fri, 5 Nov 2021 10:18:03 +0000 (11:18 +0100)]
Make test_copy*.py mypy-clean
Denis Laxalde [Tue, 2 Mar 2021 11:18:32 +0000 (12:18 +0100)]
Make cursor tests mypy-clean
Add a type annotation to 'rns' in test_rownumber(); assert that
cursor._query is not None.
Denis Laxalde [Fri, 5 Nov 2021 09:58:38 +0000 (10:58 +0100)]
Ignore 'arg-type' mypy error about list subclass in fix_db
Not sure why this is an error. Are we supposed to inherit from
List[Any]?
Denis Laxalde [Fri, 5 Nov 2021 09:51:33 +0000 (10:51 +0100)]
Make test_adapt.py mypy-clean
Declare dynamically filled variables; add assertions about value
returned by Transformer.get_dumper() when a ListDumper is expected
(because of 'sub_dumper' attribute only defined there); check None value
for optional attributes (e.g. sub_dumper); add '# type: ignore' as a
last resort.
Denis Laxalde [Fri, 5 Nov 2021 09:05:06 +0000 (10:05 +0100)]
Make fix_faker mypy-clean
Declare a couple of dynamically filled lists; add a type annotation for
the "key" function in sorted() call and defined the type of
get_supported_types; rename variables that change type; add '# type:
ignore' when it's not clear what to do.
Denis Laxalde [Fri, 5 Nov 2021 08:41:39 +0000 (09:41 +0100)]
Fix mypy errors in test_errors.py
Declare a couple a dynamic variables and check for None value before
checking optional properties' values.
Denis Laxalde [Fri, 5 Nov 2021 08:33:02 +0000 (09:33 +0100)]
Use a different iter variable in test_evict_lru_deallocate()
Resolves mypy error:
error: Incompatible types in assignment (expression has type "object", variable has type "int") [assignment]
And makes test_prepared*.py mypy clean.
Denis Laxalde [Fri, 5 Nov 2021 08:27:45 +0000 (09:27 +0100)]
Check that tzinfo.utcoffset() does not return None in conninfo tests
Avoids mypy error:
error: Item "None" of "Optional[timedelta]" has no attribute "total_seconds" [union-attr]
Now test_conninfo.py type checks.
Denis Laxalde [Tue, 2 Nov 2021 14:25:23 +0000 (15:25 +0100)]
Let mypy check tests/test_dns* code
We need to add dnspython to dev dependencies in order to get types for
the dns module when running mypy.
Denis Laxalde [Thu, 4 Nov 2021 15:04:38 +0000 (16:04 +0100)]
Do not catch TypeError in test_resolve_hostaddr_async_bad()
It appears that only psycopg.OperationalError is actually raised.
Denis Laxalde [Thu, 4 Nov 2021 14:59:37 +0000 (15:59 +0100)]
Add a type hint for a list in dns tests
Denis Laxalde [Fri, 5 Nov 2021 08:17:54 +0000 (09:17 +0100)]
Ignore (false) Mypy attr-defined error in dns tests
On test_dns*.py, Mypy raises:
error: Module has no attribute "resolve_hostaddr_async" [attr-defined]
error: Module has no attribute "resolve_srv" [attr-defined]
These are wrong since psycopg._dns actually has these names defined.
That's probably a mypy bug.
Denis Laxalde [Thu, 4 Nov 2021 14:58:50 +0000 (15:58 +0100)]
Add type parameter to AsyncConnection in dns tests
Daniele Varrazzo [Wed, 10 Nov 2021 00:42:26 +0000 (01:42 +0100)]
Docs typo: a -> an
Daniele Varrazzo [Wed, 10 Nov 2021 00:24:12 +0000 (01:24 +0100)]
Bump pool version number to next dev release
Daniele Varrazzo [Tue, 9 Nov 2021 23:37:22 +0000 (00:37 +0100)]
Merge branch 'musllinux'
Daniele Varrazzo [Tue, 9 Nov 2021 20:23:13 +0000 (21:23 +0100)]
Mention musllinux packages release in news file
Close #141.
Daniele Varrazzo [Tue, 9 Nov 2021 20:17:21 +0000 (21:17 +0100)]
Bump dev version numbers to prepare testpypi packages
Peter Lithammer [Mon, 8 Nov 2021 16:06:22 +0000 (17:06 +0100)]
Add Alpine support to `wheel_linux_before_all.sh` script
Peter Lithammer [Mon, 8 Nov 2021 14:24:03 +0000 (15:24 +0100)]
Update cibuildwheel to v2.2.2
The v2.2.x version of cibuildwheel adds supports for building
`musllinux`[^1] wheels. Meaning Alpine users can finally take advantage
of binary installations.
[^1]: https://www.python.org/dev/peps/pep-0656/
Daniele Varrazzo [Mon, 8 Nov 2021 21:28:02 +0000 (22:28 +0100)]
Expose the C package version in the _cmodule module
"Expose" just to say: this interface remains internal. But it's handy
for development and testing nonetheless.
Daniele Varrazzo [Mon, 8 Nov 2021 19:38:47 +0000 (20:38 +0100)]
Allow to run typing tests from an arbitrary location
Daniele Varrazzo [Mon, 8 Nov 2021 19:54:31 +0000 (20:54 +0100)]
Include typing information in psycopg-binary distribution
Daniele Varrazzo [Mon, 8 Nov 2021 20:09:58 +0000 (21:09 +0100)]
Merge branch 'wheel-strip' into packaging-love
Daniele Varrazzo [Mon, 8 Nov 2021 20:08:42 +0000 (21:08 +0100)]
Mention binary package size reduction in changelog
Daniele Varrazzo [Mon, 8 Nov 2021 18:33:23 +0000 (19:33 +0100)]
Install the zip command in the cibuildwheel image
Required to unpack the wheel archive and strip symbols.
Daniele Varrazzo [Mon, 8 Nov 2021 18:14:28 +0000 (19:14 +0100)]
Strip only psycopg dynamic libraries, not the system ones
Stripping symbols is beneficial (reduction of 30% of the final package, > %90%
of the installed libraries. However just running `auditwheel repair --strip`
breaks some of the libraries included from the system, which fail at import
with errors such as "ELF load command address/offset not properly aligned".
Daniele Varrazzo [Mon, 8 Nov 2021 16:55:54 +0000 (17:55 +0100)]
Strip debug symbols from wheel packages
Close #142
Daniele Varrazzo [Mon, 8 Nov 2021 18:55:06 +0000 (19:55 +0100)]
Bump to next dev release
Daniele Varrazzo [Mon, 8 Nov 2021 15:00:18 +0000 (16:00 +0100)]
Add Generic Counter and Deque to compat module
Daniele Varrazzo [Mon, 8 Nov 2021 14:03:45 +0000 (15:03 +0100)]
Set version number to 3.0.2
Daniele Varrazzo [Wed, 3 Nov 2021 15:56:12 +0000 (16:56 +0100)]
Merge branch 'mypy-tests/scripts'
Denis Laxalde [Tue, 2 Nov 2021 14:25:23 +0000 (15:25 +0100)]
Let mypy check tests/scripts code