vsql-python 1.2.7__tar.gz → 1.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {vsql_python-1.2.7 → vsql_python-1.2.8}/.github/workflows/test.yml +7 -0
  2. {vsql_python-1.2.7 → vsql_python-1.2.8}/PKG-INFO +7 -1
  3. {vsql_python-1.2.7 → vsql_python-1.2.8}/README.md +6 -0
  4. {vsql_python-1.2.7 → vsql_python-1.2.8}/pyproject.toml +3 -0
  5. vsql_python-1.2.8/src/vsql/__init__.pyi +239 -0
  6. vsql_python-1.2.8/src/vsql/_libvsql.pyi +6 -0
  7. vsql_python-1.2.8/src/vsql/py.typed +0 -0
  8. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql_python.egg-info/PKG-INFO +7 -1
  9. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql_python.egg-info/SOURCES.txt +3 -0
  10. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql_python.egg-info/scm_file_list.json +3 -0
  11. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql_python.egg-info/scm_version.json +2 -2
  12. {vsql_python-1.2.7 → vsql_python-1.2.8}/.github/workflows/release.yml +0 -0
  13. {vsql_python-1.2.7 → vsql_python-1.2.8}/.gitignore +0 -0
  14. {vsql_python-1.2.7 → vsql_python-1.2.8}/LICENSE +0 -0
  15. {vsql_python-1.2.7 → vsql_python-1.2.8}/MANIFEST.in +0 -0
  16. {vsql_python-1.2.7 → vsql_python-1.2.8}/example/main.py +0 -0
  17. {vsql_python-1.2.7 → vsql_python-1.2.8}/internal/amalgamation/LICENSE +0 -0
  18. {vsql_python-1.2.7 → vsql_python-1.2.8}/internal/amalgamation/LICENSE-V +0 -0
  19. {vsql_python-1.2.7 → vsql_python-1.2.8}/internal/amalgamation/libvsql.c +0 -0
  20. {vsql_python-1.2.7 → vsql_python-1.2.8}/internal/amalgamation/libvsql.h +0 -0
  21. {vsql_python-1.2.7 → vsql_python-1.2.8}/libvsql_flags.json +0 -0
  22. {vsql_python-1.2.7 → vsql_python-1.2.8}/scripts/update-amalgamation.sh +0 -0
  23. {vsql_python-1.2.7 → vsql_python-1.2.8}/setup.cfg +0 -0
  24. {vsql_python-1.2.7 → vsql_python-1.2.8}/setup.py +0 -0
  25. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql/__init__.py +0 -0
  26. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql/_connection.py +0 -0
  27. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql/_convert.py +0 -0
  28. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql/_errors.py +0 -0
  29. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql/_libvsql.c +0 -0
  30. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql_python.egg-info/dependency_links.txt +0 -0
  31. {vsql_python-1.2.7 → vsql_python-1.2.8}/src/vsql_python.egg-info/top_level.txt +0 -0
  32. {vsql_python-1.2.7 → vsql_python-1.2.8}/tests/test_vsql.py +0 -0
@@ -33,3 +33,10 @@ jobs:
33
33
  - run: pip install . pytest
34
34
  - run: pytest -v tests
35
35
  - run: python example/main.py
36
+ # The type hints (__init__.pyi) match the module, and the example passes
37
+ # mypy --strict with them.
38
+ - if: matrix.os == 'Linux' && matrix.arch == 'x86-64' && matrix.python == '3.14'
39
+ run: |
40
+ pip install mypy
41
+ python -m mypy.stubtest vsql --ignore-missing-stub
42
+ mypy --strict example/main.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vsql-python
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: A DB-API 2.0 (PEP 249) driver for vsql, a single file or in-memory SQL database.
5
5
  Author-email: Elliot Chance <elliotchance@gmail.com>
6
6
  License-Expression: MIT
@@ -256,6 +256,12 @@ be used from different threads at the same time (`threadsafety` is 1: threads
256
256
  can share the module, but not connections). The GIL is released while libvsql
257
257
  runs.
258
258
 
259
+ ## Type hints
260
+
261
+ The package has type hints (`vsql/__init__.pyi`), so type checkers such as
262
+ mypy and pyright know the types of the module, `Connection`, `Cursor`, the
263
+ parameters and the rows.
264
+
259
265
  ## Requirements
260
266
 
261
267
  Python 3.9 or later. Wheels are built for macOS (ARM64 and x86-64), Linux
@@ -237,6 +237,12 @@ be used from different threads at the same time (`threadsafety` is 1: threads
237
237
  can share the module, but not connections). The GIL is released while libvsql
238
238
  runs.
239
239
 
240
+ ## Type hints
241
+
242
+ The package has type hints (`vsql/__init__.pyi`), so type checkers such as
243
+ mypy and pyright know the types of the module, `Connection`, `Cursor`, the
244
+ parameters and the rows.
245
+
240
246
  ## Requirements
241
247
 
242
248
  Python 3.9 or later. Wheels are built for macOS (ARM64 and x86-64), Linux
@@ -27,6 +27,9 @@ vsql = "https://github.com/elliotchance/vsql"
27
27
  package-dir = { "" = "src" }
28
28
  packages = ["vsql"]
29
29
 
30
+ [tool.setuptools.package-data]
31
+ vsql = ["py.typed", "*.pyi"]
32
+
30
33
  [tool.setuptools_scm]
31
34
  # For a build without the git history (such as a copy of the repository).
32
35
  fallback_version = "0.0.0"
@@ -0,0 +1,239 @@
1
+ # Type hints for the vsql package (see __init__.py for the documentation).
2
+
3
+ import builtins
4
+ import datetime
5
+ import decimal
6
+ import os
7
+ from collections.abc import Iterable, Iterator, Sequence
8
+ from types import TracebackType
9
+ from typing import Any, Literal, Optional, Union
10
+
11
+ from typing_extensions import Self, TypeAlias
12
+
13
+ __all__ = [
14
+ "BINARY",
15
+ "DATETIME",
16
+ "NUMBER",
17
+ "ROWID",
18
+ "STRING",
19
+ "Binary",
20
+ "Connection",
21
+ "Cursor",
22
+ "DataError",
23
+ "DatabaseError",
24
+ "Date",
25
+ "DateFromTicks",
26
+ "Error",
27
+ "IntegrityError",
28
+ "InterfaceError",
29
+ "InternalError",
30
+ "NotSupportedError",
31
+ "OperationalError",
32
+ "ProgrammingError",
33
+ "Time",
34
+ "TimeFromTicks",
35
+ "Timestamp",
36
+ "TimestampFromTicks",
37
+ "Warning",
38
+ "YearMonthInterval",
39
+ "apilevel",
40
+ "build_info",
41
+ "connect",
42
+ "paramstyle",
43
+ "threadsafety",
44
+ "vsql_version",
45
+ "vsql_version_info",
46
+ ]
47
+
48
+ apilevel: str
49
+ threadsafety: int
50
+ paramstyle: str
51
+ vsql_version: str
52
+ vsql_version_info: tuple[int, ...]
53
+ build_info: dict[str, str]
54
+
55
+ # A value that can be a parameter.
56
+ _Parameter: TypeAlias = Union[
57
+ None,
58
+ bool,
59
+ int,
60
+ float,
61
+ str,
62
+ decimal.Decimal,
63
+ datetime.datetime,
64
+ datetime.date,
65
+ datetime.time,
66
+ bytes,
67
+ bytearray,
68
+ memoryview,
69
+ datetime.timedelta,
70
+ YearMonthInterval,
71
+ ]
72
+ # A value of a column.
73
+ _Value: TypeAlias = Union[
74
+ None,
75
+ bool,
76
+ int,
77
+ float,
78
+ str,
79
+ decimal.Decimal,
80
+ datetime.datetime,
81
+ datetime.date,
82
+ datetime.time,
83
+ bytes,
84
+ datetime.timedelta,
85
+ YearMonthInterval,
86
+ ]
87
+ _Row: TypeAlias = tuple[_Value, ...]
88
+ # (name, type_code, display_size, internal_size, precision, scale, null_ok)
89
+ _Column: TypeAlias = tuple[str, str, Optional[int], int, Optional[int], Optional[int], bool]
90
+ # None, but Any rather than Optional for an attribute that's usually checked
91
+ # by the code before (like typeshed's MaybeNone), such as the description of
92
+ # a query.
93
+ _MaybeNone: TypeAlias = Any
94
+ _IsolationLevel: TypeAlias = Literal[
95
+ "READ UNCOMMITTED", "READ COMMITTED", "REPEATABLE READ", "SERIALIZABLE"
96
+ ]
97
+
98
+ def connect(
99
+ database: Union[str, bytes, os.PathLike[str], os.PathLike[bytes]],
100
+ autocommit: bool = False,
101
+ isolation_level: _IsolationLevel = "READ COMMITTED",
102
+ read_only: bool = False,
103
+ ) -> Connection: ...
104
+
105
+ class Connection:
106
+ def __init__(
107
+ self,
108
+ database: Union[str, bytes, os.PathLike[str], os.PathLike[bytes]],
109
+ autocommit: bool = False,
110
+ isolation_level: _IsolationLevel = "READ COMMITTED",
111
+ read_only: bool = False,
112
+ ) -> None: ...
113
+ @property
114
+ def closed(self) -> bool: ...
115
+ @property
116
+ def autocommit(self) -> bool: ...
117
+ @autocommit.setter
118
+ def autocommit(self, value: bool) -> None: ...
119
+ @property
120
+ def in_transaction(self) -> bool: ...
121
+ @property
122
+ def file_version(self) -> tuple[int, int]: ...
123
+ def commit(self) -> None: ...
124
+ def rollback(self) -> None: ...
125
+ def rollback_to_savepoint(self, name: str) -> None: ...
126
+ def cursor(self) -> Cursor: ...
127
+ def execute(
128
+ self, operation: str, parameters: Optional[Sequence[_Parameter]] = None
129
+ ) -> Cursor: ...
130
+ def close(self) -> None: ...
131
+ def __del__(self) -> None: ...
132
+ def __enter__(self) -> Self: ...
133
+ def __exit__(
134
+ self,
135
+ exc_type: Optional[type[BaseException]],
136
+ exc_value: Optional[BaseException],
137
+ traceback: Optional[TracebackType],
138
+ ) -> None: ...
139
+
140
+ class Cursor:
141
+ connection: Connection
142
+ description: Union[tuple[_Column, ...], _MaybeNone]
143
+ rowcount: int
144
+ arraysize: int
145
+ lastrowid: None
146
+ def __init__(self, connection: Connection) -> None: ...
147
+ def execute(
148
+ self, operation: str, parameters: Optional[Sequence[_Parameter]] = None
149
+ ) -> Self: ...
150
+ def executemany(
151
+ self, operation: str, seq_of_parameters: Iterable[Sequence[_Parameter]]
152
+ ) -> None: ...
153
+ def fetchone(self) -> Optional[_Row]: ...
154
+ def fetchmany(self, size: Optional[int] = None) -> list[_Row]: ...
155
+ def fetchall(self) -> list[_Row]: ...
156
+ def __iter__(self) -> Iterator[_Row]: ...
157
+ def __next__(self) -> _Row: ...
158
+ def setinputsizes(self, sizes: Any) -> None: ...
159
+ def setoutputsize(self, size: Any, column: Optional[int] = None) -> None: ...
160
+ def close(self) -> None: ...
161
+ def __del__(self) -> None: ...
162
+ def __enter__(self) -> Self: ...
163
+ def __exit__(
164
+ self,
165
+ exc_type: Optional[type[BaseException]],
166
+ exc_value: Optional[BaseException],
167
+ traceback: Optional[TracebackType],
168
+ ) -> None: ...
169
+
170
+ class YearMonthInterval:
171
+ def __init__(self, years: int = 0, months: int = 0) -> None: ...
172
+ @property
173
+ def total_months(self) -> int: ...
174
+ @property
175
+ def years(self) -> int: ...
176
+ @property
177
+ def months(self) -> int: ...
178
+ def __eq__(self, other: object) -> bool: ...
179
+ def __hash__(self) -> int: ...
180
+ def __neg__(self) -> YearMonthInterval: ...
181
+
182
+ Date = datetime.date
183
+ Time = datetime.time
184
+ Timestamp = datetime.datetime
185
+ Binary = bytes
186
+
187
+ def DateFromTicks(ticks: float) -> datetime.date: ...
188
+ def TimeFromTicks(ticks: float) -> datetime.time: ...
189
+ def TimestampFromTicks(ticks: float) -> datetime.datetime: ...
190
+
191
+ class _TypeObject:
192
+ type_names: frozenset[str]
193
+ def __init__(self, *type_names: str) -> None: ...
194
+ def __eq__(self, other: object) -> bool: ...
195
+ def __ne__(self, other: object) -> bool: ...
196
+ def __hash__(self) -> int: ...
197
+
198
+ STRING: _TypeObject
199
+ BINARY: _TypeObject
200
+ NUMBER: _TypeObject
201
+ DATETIME: _TypeObject
202
+ ROWID: _TypeObject
203
+
204
+ class Warning(builtins.Exception): ...
205
+
206
+ class Error(builtins.Exception):
207
+ message: str
208
+ sqlstate: Optional[str]
209
+ constraint_catalog: Optional[str]
210
+ constraint_schema: Optional[str]
211
+ constraint_name: Optional[str]
212
+ catalog_name: Optional[str]
213
+ schema_name: Optional[str]
214
+ table_name: Optional[str]
215
+ column_name: Optional[str]
216
+ cursor_name: Optional[str]
217
+ def __init__(
218
+ self,
219
+ message: str,
220
+ sqlstate: Optional[str] = None,
221
+ *,
222
+ constraint_catalog: Optional[str] = None,
223
+ constraint_schema: Optional[str] = None,
224
+ constraint_name: Optional[str] = None,
225
+ catalog_name: Optional[str] = None,
226
+ schema_name: Optional[str] = None,
227
+ table_name: Optional[str] = None,
228
+ column_name: Optional[str] = None,
229
+ cursor_name: Optional[str] = None,
230
+ ) -> None: ...
231
+
232
+ class InterfaceError(Error): ...
233
+ class DatabaseError(Error): ...
234
+ class DataError(DatabaseError): ...
235
+ class OperationalError(DatabaseError): ...
236
+ class IntegrityError(DatabaseError): ...
237
+ class InternalError(DatabaseError): ...
238
+ class ProgrammingError(DatabaseError): ...
239
+ class NotSupportedError(DatabaseError): ...
@@ -0,0 +1,6 @@
1
+ # The extension module (_libvsql.c) is private, so its functions and constants
2
+ # aren't typed.
3
+
4
+ from typing import Any
5
+
6
+ def __getattr__(name: str) -> Any: ...
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vsql-python
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: A DB-API 2.0 (PEP 249) driver for vsql, a single file or in-memory SQL database.
5
5
  Author-email: Elliot Chance <elliotchance@gmail.com>
6
6
  License-Expression: MIT
@@ -256,6 +256,12 @@ be used from different threads at the same time (`threadsafety` is 1: threads
256
256
  can share the module, but not connections). The GIL is released while libvsql
257
257
  runs.
258
258
 
259
+ ## Type hints
260
+
261
+ The package has type hints (`vsql/__init__.pyi`), so type checkers such as
262
+ mypy and pyright know the types of the module, `Connection`, `Cursor`, the
263
+ parameters and the rows.
264
+
259
265
  ## Requirements
260
266
 
261
267
  Python 3.9 or later. Wheels are built for macOS (ARM64 and x86-64), Linux
@@ -14,10 +14,13 @@ internal/amalgamation/libvsql.c
14
14
  internal/amalgamation/libvsql.h
15
15
  scripts/update-amalgamation.sh
16
16
  src/vsql/__init__.py
17
+ src/vsql/__init__.pyi
17
18
  src/vsql/_connection.py
18
19
  src/vsql/_convert.py
19
20
  src/vsql/_errors.py
20
21
  src/vsql/_libvsql.c
22
+ src/vsql/_libvsql.pyi
23
+ src/vsql/py.typed
21
24
  src/vsql_python.egg-info/PKG-INFO
22
25
  src/vsql_python.egg-info/SOURCES.txt
23
26
  src/vsql_python.egg-info/dependency_links.txt
@@ -16,10 +16,13 @@
16
16
  "scripts/update-amalgamation.sh",
17
17
  "setup.py",
18
18
  "src/vsql/__init__.py",
19
+ "src/vsql/__init__.pyi",
19
20
  "src/vsql/_connection.py",
20
21
  "src/vsql/_convert.py",
21
22
  "src/vsql/_errors.py",
22
23
  "src/vsql/_libvsql.c",
24
+ "src/vsql/_libvsql.pyi",
25
+ "src/vsql/py.typed",
23
26
  "tests/test_vsql.py"
24
27
  ]
25
28
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "1.2.7",
2
+ "tag": "1.2.8",
3
3
  "distance": 0,
4
- "node": "gb80bd041eedd2fe41cd10171ed6b5a77ca59f954",
4
+ "node": "gd09cbcb2c3550b92fc010f3885949334060233b0",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-11-27"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes