File tree Expand file tree Collapse file tree 9 files changed +77
-18
lines changed Expand file tree Collapse file tree 9 files changed +77
-18
lines changed Original file line number Diff line number Diff line change 1+ name : pre-commit
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+
11+ permissions :
12+ contents : read
13+
14+ jobs :
15+ pre-commit :
16+ name : " pre-commit"
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ - uses : actions/setup-python@v5
21+ with :
22+ python-version : ' 3.x'
23+ - name : pre-commit (cache)
24+ uses : actions/cache@v4
25+ with :
26+ path : ~/.cache/pre-commit
27+ key : pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
28+ - name : pre-commit (--all-files)
29+ run : |
30+ python -m pip install pre-commit
31+ pre-commit run --show-diff-on-failure --color=always --all-files
Original file line number Diff line number Diff line change 2929 run : |
3030 poetry build
3131 - name : Publish package distributions to PyPI
32- uses : pypa/gh-action-pypi-publish@release/v1
32+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 1+
2+ .vscode
3+
14# Byte-compiled / optimized / DLL files
25__pycache__ /
36* .py [cod ]
Original file line number Diff line number Diff line change 11fail_fast : true
22
33repos :
4- - repo : https://github.com/ambv/black
5- rev : 24.2 .0
4+ - repo : https://github.com/pre-commit/pre-commit-hooks
5+ rev : v5.0 .0
66 hooks :
7- - id : black
8- args : [--diff, --check]
7+ - id : check-yaml
8+ - id : end-of-file-fixer
9+ - id : trailing-whitespace
910
10- - repo : https://github.com/pre-commit/mirrors-mypy
11- rev : v1.7.0
11+ - repo : https://github.com/astral-sh/ruff-pre-commit
12+ rev : v0.1.5
1213 hooks :
13- - id : mypy
14- exclude : ^tests/
15- verbose : true
16- entry : bash -c '"$@" || true' --
14+ - id : ruff
15+ args : [ --fix ]
16+ - id : ruff-format
17+
18+ - repo : https://github.com/codespell-project/codespell
19+ rev : v2.4.1
20+ hooks :
21+ - id : codespell
22+ additional_dependencies : [tomli]
1723
1824 - repo : https://github.com/compilerla/conventional-pre-commit
1925 rev : v3.1.0
Original file line number Diff line number Diff line change @@ -82,5 +82,5 @@ users may find useful:
8282 convenient for human inspection while still being usable by
8383 libraries like Shapely.
8484* ` reuse_session ` : controls whether an existing runtime of the same type
85- and in the same region that is available should be re-used for this
85+ and in the same region that is available should be reused for this
8686 connection. This is the default behavior.
Original file line number Diff line number Diff line change 1313from wherobots .db import connect , connect_direct
1414from wherobots .db .constants import DEFAULT_ENDPOINT
1515from wherobots .db .connection import Connection
16- from wherobots .db .region import Region
17- from wherobots .db .runtime import Runtime
1816
1917if __name__ == "__main__" :
2018 parser = argparse .ArgumentParser ()
Original file line number Diff line number Diff line change 11from .connection import Connection
22from .cursor import Cursor
33from .driver import connect , connect_direct
4- from .errors import *
4+ from .errors import (
5+ Error ,
6+ DatabaseError ,
7+ InternalError ,
8+ InterfaceError ,
9+ OperationalError ,
10+ ProgrammingError ,
11+ NotSupportedError ,
12+ )
513from .region import Region
614from .runtime import Runtime
15+
16+ __all__ = [
17+ "Connection" ,
18+ "Cursor" ,
19+ "connect" ,
20+ "connect_direct" ,
21+ "Error" ,
22+ "DatabaseError" ,
23+ "InternalError" ,
24+ "InterfaceError" ,
25+ "OperationalError" ,
26+ "ProgrammingError" ,
27+ "NotSupportedError" ,
28+ "Region" ,
29+ "Runtime" ,
30+ ]
Original file line number Diff line number Diff line change 1515
1616
1717class Cursor :
18-
1918 def __init__ (self , exec_fn , cancel_fn ) -> None :
2019 self .__exec_fn = exec_fn
2120 self .__cancel_fn = cancel_fn
Original file line number Diff line number Diff line change 88import logging
99from packaging .version import Version
1010import platform
11- import queue
1211import requests
1312import tenacity
1413from typing import Union , Dict
@@ -170,7 +169,6 @@ def connect_direct(
170169 data_compression : Union [DataCompression , None ] = None ,
171170 geometry_representation : Union [GeometryRepresentation , None ] = None ,
172171) -> Connection :
173- q = queue .SimpleQueue ()
174172 uri_with_protocol = f"{ uri } /{ protocol } "
175173
176174 try :
You can’t perform that action at this time.
0 commit comments