Skip to content

Commit

Permalink
lint: some typing imports
Browse files Browse the repository at this point in the history
adjust: readme
  • Loading branch information
tanbro committed Apr 3, 2024
1 parent 5d1fd38 commit 987486f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
43 changes: 41 additions & 2 deletions docs/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
README
======

.. APIDOCS command: sphinx-apidoc -o docs/apidocs -eMTf src
.. include:: ../README.md
:parser: myst_parser.sphinx_

How to build docs
=================

#. This documentation is made with `Sphinx <https://www.sphinx-doc.org/>`_, be sure to install it's dependencies:

.. code:: sh
pip install -r docs/requirements.txt
Ignore this step if requirements already installed.

#. (*Optional*) Re-generate API-Docs, if source tree changed:

.. code:: sh
sphinx-apidoc -o docs/apidocs -eMTf src
#. Build HTML documentation:

.. code:: sh
docs/make html
The built static web site is output to ``docs/_build/html``, we can serve it:

.. code:: sh
python -m http.server -d docs/_build/html
then open http://localhost:8000/ in a web browser.

.. tip::
Try another port if ``8000`` is already in use.
For example, to serve on port ``8080``:

.. code:: sh
python -m http.server -d docs/_build/html 8080
.. seealso:: Python ``stdlib``'s :mod:`http.server`
4 changes: 1 addition & 3 deletions src/sqlalchemy_dlock/asyncio/lock/mysql.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Union
from typing import Union

from ...exceptions import SqlAlchemyDLockDatabaseError
from ...lock.mysql import MysqlSadLockMixin
Expand All @@ -13,8 +13,6 @@

MYSQL_LOCK_NAME_MAX_LENGTH = 64

TConvertFunction = Callable[[Any], str]


def default_convert(key: Union[bytearray, bytes, int, float]) -> str:
if isinstance(key, (bytearray, bytes)):
Expand Down
3 changes: 2 additions & 1 deletion src/sqlalchemy_dlock/lock/mysql.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
from typing import Any, Callable, Optional, Union
from collections.abc import Callable
from typing import Any, Optional, Union

from ..exceptions import SqlAlchemyDLockDatabaseError
from ..statement.mysql import LOCK, UNLOCK
Expand Down
3 changes: 2 additions & 1 deletion src/sqlalchemy_dlock/lock/postgresql.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
from collections.abc import Callable
from time import sleep, time
from typing import Any, Callable, Optional, Union
from typing import Any, Optional, Union
from warnings import warn

from ..exceptions import SqlAlchemyDLockDatabaseError
Expand Down

0 comments on commit 987486f

Please sign in to comment.