]>
git.ipfire.org Git - thirdparty/psycopg.git/log
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
Denis Laxalde [Tue, 2 Nov 2021 14:19:57 +0000 (15:19 +0100)]
Make spiketest.py script mypy-clean
- allow untyped defs/calls (as everywhere else in tests/*)
- avoid list comprehension filled with no value
- add a type variable to Connection subclass
- drop useless sys.exit() call, since main() does not return a value
Denis Laxalde [Tue, 2 Nov 2021 14:15:11 +0000 (15:15 +0100)]
Add a type hint for main() in dectest's scripts
Denis Laxalde [Tue, 2 Nov 2021 14:12:43 +0000 (15:12 +0100)]
Allow Iterable type for cursor.executemany() parameters
An iterable is enough since we only iterate over the parameters value
using a for loop (in _executemany_gen()).
There's an usage with a generator expression in
tests/scripts/dectest.py. (Spotted by running mypy.)
Daniele Varrazzo [Wed, 3 Nov 2021 15:55:26 +0000 (16:55 +0100)]
Merge branch 'mypy-tests/pool'
Denis Laxalde [Tue, 2 Nov 2021 12:11:19 +0000 (13:11 +0100)]
Let mypy check tests/pool code
Denis Laxalde [Tue, 2 Nov 2021 13:44:38 +0000 (14:44 +0100)]
Ignore mypy errors about cursor.fetchone()
fetchone() can return None, so mypy complains that '"None" object is
not iterable' (or not indexable).
Denis Laxalde [Tue, 2 Nov 2021 12:41:29 +0000 (13:41 +0100)]
Use the correct connection class in test_pool_async.py::test_putconn_no_pool()
Denis Laxalde [Tue, 2 Nov 2021 12:40:59 +0000 (13:40 +0100)]
Declare type variable for Counter in pool tests
We use the comment-style for type annotation because collections.Counter
is generic only since Python 3.9.
Denis Laxalde [Tue, 2 Nov 2021 12:40:27 +0000 (13:40 +0100)]
Declare types for dynamically populated lists in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:39:30 +0000 (13:39 +0100)]
Add required type variable to (Async)Connection in pool tests
Denis Laxalde [Tue, 2 Nov 2021 12:34:42 +0000 (13:34 +0100)]
Avoid unassigned list comprehensions in pool tests
Mypy complains that Thread.start()/join() does not return a value.
Denis Laxalde [Tue, 2 Nov 2021 12:14:12 +0000 (13:14 +0100)]
Use setattr() when monkeypatching in pool tests
This is to avoid mypy error: Cannot assign to a method.
Denis Laxalde [Tue, 2 Nov 2021 12:09:05 +0000 (13:09 +0100)]
Make tests/pool a Python package
Otherwise, per-module mypy configuration does not apply (and we, e.g.,
get error about "no-untyped-defs").
Daniele Varrazzo [Wed, 3 Nov 2021 15:54:50 +0000 (16:54 +0100)]
Merge branch 'mypy-tests/dbapi20'
Denis Laxalde [Tue, 2 Nov 2021 10:07:34 +0000 (11:07 +0100)]
Make dbapi20 tests mypy-clean
Denis Laxalde [Tue, 2 Nov 2021 10:44:23 +0000 (11:44 +0100)]
Catch only expected exception in test_psycopg_dbapi20.py::test_connect_args()
Denis Laxalde [Tue, 2 Nov 2021 10:05:05 +0000 (11:05 +0100)]
Drop duplicated test_nextset() method of DatabaseAPI20Test
Spotted by mypy:
error: Name "test_nextset" already defined on line 742
Daniele Varrazzo [Wed, 3 Nov 2021 15:54:06 +0000 (16:54 +0100)]
Merge branch 'mypy-tests/test_sql'
Denis Laxalde [Tue, 2 Nov 2021 10:32:46 +0000 (11:32 +0100)]
Let mypy check tests/test_sql.py
Denis Laxalde [Tue, 2 Nov 2021 10:30:00 +0000 (11:30 +0100)]
Fix type of re.sub() call in sql tests
All values of re.sub() must be of the type, here bytes.
Denis Laxalde [Tue, 2 Nov 2021 10:26:14 +0000 (11:26 +0100)]
Let mypy ignore expected type errors in sql tests
Denis Laxalde [Tue, 2 Nov 2021 10:24:30 +0000 (11:24 +0100)]
Work around a mypy 'Incompatible types in assignment' in sql tests
By defining 'obj' as a Composed value, we avoid the mypy error about
variable type change.
Daniele Varrazzo [Wed, 3 Nov 2021 15:53:16 +0000 (16:53 +0100)]
Merge branch 'mypy-tests/pq'
Denis Laxalde [Thu, 28 Oct 2021 09:35:04 +0000 (11:35 +0200)]
Let mypy check tests/pq code
Denis Laxalde [Tue, 2 Nov 2021 09:26:33 +0000 (10:26 +0100)]
Let mypy ignore an expected type error in pq tests
Denis Laxalde [Tue, 2 Nov 2021 09:26:22 +0000 (10:26 +0100)]
Adjust test_pgconn::test_info() for mypy
Resolves the following error:
error: Item "None" of "Optional[bytes]" has no attribute "decode"
Denis Laxalde [Tue, 2 Nov 2021 09:18:06 +0000 (10:18 +0100)]
Rename a variable in test_conninfo_parse()
To silent a 'incompatible types in assignment' mypy error.
Denis Laxalde [Tue, 2 Nov 2021 09:18:06 +0000 (10:18 +0100)]
Rename a variable in tests/pq/test_copy.py
To silent a 'incompatible types in assignment' mypy error.
Denis Laxalde [Tue, 2 Nov 2021 09:07:47 +0000 (10:07 +0100)]
Adjust test_pq::test_build_version() for mypy
pq.__build_version__ might be None.
Denis Laxalde [Tue, 2 Mar 2021 11:25:10 +0000 (12:25 +0100)]
Rename a variable in test_conninfo_parse() to silent a mypy error
Daniele Varrazzo [Wed, 3 Nov 2021 15:52:39 +0000 (16:52 +0100)]
Merge branch 'mypy-tests/types'
Denis Laxalde [Thu, 28 Oct 2021 09:35:04 +0000 (11:35 +0200)]
Let mypy check tests/types code
We configure mypy to check untyped defs in tests/ directory, but only
let it check tests/types files at the moment.
Denis Laxalde [Thu, 28 Oct 2021 08:42:49 +0000 (10:42 +0200)]
Rename a variable in test_composite.py::test_register_scope()
To make mypy happy.
Denis Laxalde [Thu, 28 Oct 2021 08:55:21 +0000 (10:55 +0200)]
Add a couple of "# type: ignore" in datetime tests
Mypy cannot check map() calls on split-strings.
Denis Laxalde [Thu, 28 Oct 2021 08:42:49 +0000 (10:42 +0200)]
Rename a variable in test_array.py::test_all_chars()
To make mypy happy.
Denis Laxalde [Thu, 28 Oct 2021 08:24:44 +0000 (10:24 +0200)]
Make test_multirange.py mypy-clean
Either ignoring errors (often intended) or adding type hints/ignore as
in previous commit.
Denis Laxalde [Thu, 28 Oct 2021 08:40:28 +0000 (10:40 +0200)]
Make test_range.py mypy-clean
This consists in adding the type variable to Range type when it makes
sense or to let mypy ignore the 'var-annotated' error for ranges
declared as empty, and where we do not use the underlying value.
In test_in(), we add an extra check to verify that mypy warns about
types incompatibility.
Denis Laxalde [Thu, 28 Oct 2021 07:59:11 +0000 (09:59 +0200)]
Ignore typing errors in test_no_info_error() tests
Denis Laxalde [Thu, 28 Oct 2021 07:57:31 +0000 (09:57 +0200)]
Pass a dummy oid in test_hstore::test_parse_{ok,bad}
HstoreLoader() wants an integer value as first parameter 'oid'. In these
tests, the value does not matter but at least pass the expected type.
Daniele Varrazzo [Thu, 28 Oct 2021 15:33:00 +0000 (17:33 +0200)]
Make __version__ importable, although not included in __all__
Daniele Varrazzo [Thu, 28 Oct 2021 15:30:40 +0000 (17:30 +0200)]
Make the mypy fixture available to the whole test suite
Also make mypy tests automatically slow.
See #130 for other cases where a mypy fixture would be useful.
Daniele Varrazzo [Sat, 30 Oct 2021 16:30:17 +0000 (18:30 +0200)]
Harmless refactoring to server-side cursors
It's cool that mypy finds the common base of the two expressions in the
ternary operator.
Daniele Varrazzo [Sat, 30 Oct 2021 15:26:54 +0000 (17:26 +0200)]
Shorten server-side cursor execute() tracebacks
Daniele Varrazzo [Sat, 30 Oct 2021 15:24:07 +0000 (17:24 +0200)]
Merge remote-tracking branch 'sureshdsk/issue-125'
Daniele Varrazzo [Sat, 30 Oct 2021 15:22:55 +0000 (17:22 +0200)]
Ignore .venv dir in any subdir
Suresh Kumar [Sat, 30 Oct 2021 15:13:21 +0000 (20:43 +0530)]
added async server cursor close tests for fetchone, fetchmany, fetchall
Suresh Kumar [Sat, 30 Oct 2021 15:08:27 +0000 (20:38 +0530)]
fixed cursor close check + updated news
Suresh Kumar [Sat, 30 Oct 2021 14:39:56 +0000 (20:09 +0530)]
added issue-125 fix to news
Daniele Varrazzo [Sat, 30 Oct 2021 14:36:57 +0000 (16:36 +0200)]
Fix Sphinx setup version specification
Also specify other dependencies using the ~= operator.
Suresh Kumar [Sat, 30 Oct 2021 14:28:27 +0000 (19:58 +0530)]
added async cursor close tests for fetchone, fetchmany, fetchall
Suresh Kumar [Sat, 30 Oct 2021 14:16:33 +0000 (19:46 +0530)]
fixed cursor close check + added tests for fetchone, fetchmany, fetchall
Suresh Kumar [Sat, 23 Oct 2021 14:45:36 +0000 (20:15 +0530)]
fix: check if cursor is closed
Daniele Varrazzo [Thu, 28 Oct 2021 23:36:03 +0000 (01:36 +0200)]
Fix test range comparison with empty ranges
Daniele Varrazzo [Thu, 28 Oct 2021 23:08:12 +0000 (01:08 +0200)]
Mark slow every test taking more than 0.1s to run
Daniele Varrazzo [Thu, 28 Oct 2021 22:51:11 +0000 (00:51 +0200)]
Better workaround for bad datetime comparison Python bug
The problem doesn't just happen far away in the future. 2255 is enough.
See https://bugs.python.org/issue45347#msg405284
Compare timestamps by checking if their delta is 0, convert ranges bounds
to utc.
Fun fact: pytest --randomly-seed=
293472621 triggers both the multirange
array bug and this.
Daniele Varrazzo [Thu, 28 Oct 2021 22:49:57 +0000 (00:49 +0200)]
Avoid error in multirange arrays random testing
Don't create arrays with first element empty if dumping in binary. It is
known to not work (see xfail in multirange tests).
Daniele Varrazzo [Thu, 28 Oct 2021 21:20:32 +0000 (23:20 +0200)]
Retry a brittle test
Daniele Varrazzo [Thu, 28 Oct 2021 16:11:16 +0000 (18:11 +0200)]
Make ServerCursorHelper.format private
Reduce duplicate code, remove a race condition (the format set outside
the lock section), make _declare_gen() interface more similar to
_execute_gen().
Daniele Varrazzo [Thu, 28 Oct 2021 15:55:37 +0000 (17:55 +0200)]
refactor: compose DECLARE in the helper common path
...instead of in the separate sync/async branches.
Daniele Varrazzo [Thu, 28 Oct 2021 11:34:45 +0000 (13:34 +0200)]
Clean up imports/exports in psycopg package
Drop file-level F401 ignore and declare explicitly what is exported.
Something reordered to keep together package-level types registration,
to use a somewhat alphabetical order to group of things.
Daniele Varrazzo [Tue, 26 Oct 2021 15:56:14 +0000 (16:56 +0100)]
Rename test file dropping the 3 from psycopg
Denis Laxalde [Thu, 28 Oct 2021 08:13:39 +0000 (10:13 +0200)]
Raise a TypeError when slice-setting a Multirange with a non-iterable value
The type declaration is:
def __setitem__(index: slice, value: Iterable[Range[T]]) -> None:
...
so passing a non-iterable value should not be allowed. However, the
method implementation makes a special-case for non-iterable values with
a slice.
In accordance with MutableSequence behavior, e.g.:
>>> x = [1, 2, 3]
>>> x[1:3] = 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can only assign an iterable
it seems more correct to raise a TypeError.
Denis Laxalde [Thu, 28 Oct 2021 09:31:25 +0000 (11:31 +0200)]
Re-export DB-API type constructors and singletons
Following https://www.python.org/dev/peps/pep-0249/#type-objects-and-constructors
Daniele Varrazzo [Tue, 26 Oct 2021 12:16:01 +0000 (13:16 +0100)]
Fix formatting in news page
Daniele Varrazzo [Tue, 26 Oct 2021 12:14:59 +0000 (13:14 +0100)]
Fix type hint for `Connection.notifies()`
Close #128.
Daniele Varrazzo [Tue, 26 Oct 2021 12:11:59 +0000 (13:11 +0100)]
Fix type hint for `sql.SQL.join()`
Close #127.
Daniele Varrazzo [Mon, 25 Oct 2021 08:59:09 +0000 (09:59 +0100)]
Remove the pgresult structure from the cursor on close
This is what the dbapi demands and helps with make the cursor
unavailable after close.
Daniele Varrazzo [Mon, 25 Oct 2021 10:14:40 +0000 (11:14 +0100)]
Bump sphinx to 4.2 to build docs
Version 4.1 has problems with Python 3.10
Daniele Varrazzo [Mon, 25 Oct 2021 09:15:06 +0000 (10:15 +0100)]
Install shapely requirements to validate docs
If it works the same change will be applied to the psycopg-website
repos.
Close #123
Daniele Varrazzo [Thu, 21 Oct 2021 11:47:44 +0000 (12:47 +0100)]
Extend docs about connection context
Highlight the difference from normal connection (implicit rollback vs.
explicit commit) after conversation on the mailing list about the
inconsistency between the operations.
Daniele Varrazzo [Wed, 20 Oct 2021 11:16:42 +0000 (13:16 +0200)]
Fix wrong error message on unknown PostgreSQL encoding
Reported in #122.
Daniele Varrazzo [Wed, 20 Oct 2021 11:20:07 +0000 (13:20 +0200)]
Bump version number to next dev release
Ramiro Morales [Sun, 17 Oct 2021 01:04:35 +0000 (22:04 -0300)]
Fix var name in transactions doc examples
Daniele Varrazzo [Sat, 16 Oct 2021 10:16:56 +0000 (12:16 +0200)]
Highlight meaningful lines in transaction examples
Daniele Varrazzo [Sat, 16 Oct 2021 10:04:54 +0000 (12:04 +0200)]
Fix docs wording after Daniel Fortunov's suggestion
Daniel Fortunov [Fri, 15 Oct 2021 21:22:26 +0000 (22:22 +0100)]
Tweak "Multiple statements in the same query" docs
Minor wording and typographical tweaks in follow-up to
650e215b
Daniele Varrazzo [Fri, 15 Oct 2021 11:53:59 +0000 (13:53 +0200)]
Add documentation about multiple statements execution
Close #109.
Daniele Varrazzo [Fri, 15 Oct 2021 10:47:43 +0000 (12:47 +0200)]
Improve transactions documentation
close #110
Daniele Varrazzo [Thu, 14 Oct 2021 09:36:14 +0000 (11:36 +0200)]
Bump to version 3.0.1
Daniele Varrazzo [Thu, 14 Oct 2021 08:59:35 +0000 (10:59 +0200)]
Merge branch 'bug-112'
Daniele Varrazzo [Thu, 14 Oct 2021 00:26:02 +0000 (02:26 +0200)]
Mention bug fixed in news file
Close #112.