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 29
29
run : |
30
30
poetry build
31
31
- 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
+
1
4
# Byte-compiled / optimized / DLL files
2
5
__pycache__ /
3
6
* .py [cod ]
Original file line number Diff line number Diff line change 1
1
fail_fast : true
2
2
3
3
repos :
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
6
6
hooks :
7
- - id : black
8
- args : [--diff, --check]
7
+ - id : check-yaml
8
+ - id : end-of-file-fixer
9
+ - id : trailing-whitespace
9
10
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
12
13
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]
17
23
18
24
- repo : https://github.com/compilerla/conventional-pre-commit
19
25
rev : v3.1.0
Original file line number Diff line number Diff line change @@ -82,5 +82,5 @@ users may find useful:
82
82
convenient for human inspection while still being usable by
83
83
libraries like Shapely.
84
84
* ` 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
86
86
connection. This is the default behavior.
Original file line number Diff line number Diff line change 13
13
from wherobots .db import connect , connect_direct
14
14
from wherobots .db .constants import DEFAULT_ENDPOINT
15
15
from wherobots .db .connection import Connection
16
- from wherobots .db .region import Region
17
- from wherobots .db .runtime import Runtime
18
16
19
17
if __name__ == "__main__" :
20
18
parser = argparse .ArgumentParser ()
Original file line number Diff line number Diff line change 1
1
from .connection import Connection
2
2
from .cursor import Cursor
3
3
from .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
+ )
5
13
from .region import Region
6
14
from .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 15
15
16
16
17
17
class Cursor :
18
-
19
18
def __init__ (self , exec_fn , cancel_fn ) -> None :
20
19
self .__exec_fn = exec_fn
21
20
self .__cancel_fn = cancel_fn
Original file line number Diff line number Diff line change 8
8
import logging
9
9
from packaging .version import Version
10
10
import platform
11
- import queue
12
11
import requests
13
12
import tenacity
14
13
from typing import Union , Dict
@@ -170,7 +169,6 @@ def connect_direct(
170
169
data_compression : Union [DataCompression , None ] = None ,
171
170
geometry_representation : Union [GeometryRepresentation , None ] = None ,
172
171
) -> Connection :
173
- q = queue .SimpleQueue ()
174
172
uri_with_protocol = f"{ uri } /{ protocol } "
175
173
176
174
try :
You can’t perform that action at this time.
0 commit comments