Skip to content

Commit

Permalink
fix all mypy errors, add py.typed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuyukai committed Nov 19, 2023
1 parent bf8482d commit 944f028
Show file tree
Hide file tree
Showing 34 changed files with 792 additions and 502 deletions.
9 changes: 8 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ aaaa.py

.coverage
htmlcov/
dist/
dist/

*.pyc
profile.prof

.mypy_cache
.ruff_cache
.pytest_cache
3 changes: 1 addition & 2 deletions docs/api-highlevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ time, this provides an effective way of performinng multiple queries concurrentl
Connecting
----------

To create a connection pool, use :meth:`~.open_pool`.
To create a connection pool, use :meth:`.open_pool`.

.. automethod:: pg_purepy.pool.open_pool
:async-with: pool

.. warning::

Expand Down
5 changes: 1 addition & 4 deletions docs/api-midlevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Connecting
In order to get anywhere, you need to actually connect to the server.

.. autofunction:: pg_purepy.connection.open_database_connection
:async-with: conn

.. autoclass:: pg_purepy.connection.AsyncPostgresConnection
:members: ready, in_transaction, dead, connection_parameters, server_timezone
Expand Down Expand Up @@ -78,7 +77,6 @@ If you have large data sets, or want to query lazily for other reasons, then
asynchronous context manager, returning a :class:`~.QueryResult`.

.. automethod:: pg_purepy.connection.AsyncPostgresConnection.query
:async-with: query

.. autoclass:: pg_purepy.connection.QueryResult
:members:
Expand Down Expand Up @@ -197,11 +195,10 @@ it does supply a transaction helper which will automatically commit at the end o
block, or rollback if an error happens.

.. automethod:: pg_purepy.connection.AsyncPostgresConnection.with_transaction
:async-with:


.. warning::

This will NOT protect against different tasks from calling query functions inside your
transaction. This would require overly complicated locking logic! Instead, wrap your acquisition
of this inside a different lock, and guard all other transaction helpers with it.

8 changes: 7 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

0.9.0 (2023-11-19)
------------------

- Fix type hints and add a ``py.typed`` marker.
- Fix a mishap with ``ExceptionGroup`` in the pool handler.

0.8.2 (2023-06-09)
------------------

Expand Down Expand Up @@ -69,4 +75,4 @@ Changelog
0.7.0
-----

- Initial release.
- Initial release.
7 changes: 3 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import pkg_resources
from importlib.metadata import version as get_version

# -- Project information -----------------------------------------------------

project = "pg-purepy"
copyright = "2021, Lura Skye"
copyright = "2021-2023, Lura Skye"
author = "Lura Skye"

# The full version, including alpha/beta/rc tags
release = pkg_resources.get_distribution("pg_purepy").version
release = get_version("pg_purepy")


# -- General configuration ---------------------------------------------------
Expand All @@ -34,7 +34,6 @@
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx_autodoc_typehints",
"sphinxcontrib_trio",
"sphinx_inline_tabs",
]

Expand Down
164 changes: 122 additions & 42 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 944f028

Please sign in to comment.