Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyadi committed Dec 23, 2024
1 parent 256ec9e commit 7806afc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 5 additions & 3 deletions pysqlsync/python_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import inspect
import io
import re
import sys
import textwrap
import typing
from types import ModuleType
Expand All @@ -15,7 +16,7 @@
is_dataclass_type,
is_type_enum,
)
from strong_typing.name import python_type_to_str
from strong_typing.name import TypeFormatter


def module_to_stream(module: ModuleType, target: TextIO) -> None:
Expand Down Expand Up @@ -101,15 +102,16 @@ def dataclass_to_stream(typ: type[DataclassInstance], target: TextIO) -> None:
print(file=target)

# member variables
fmt = TypeFormatter(context=sys.modules[typ.__module__])
for field in dataclasses.fields(typ):
type_name = python_type_to_str(field.type)
type_name = fmt.python_type_to_str(field.type)
metadata = dict(field.metadata)

field_initializer: dict[str, str] = {}
if field.default is not dataclasses.MISSING:
field_initializer["default"] = repr(field.default)
if field.default_factory is not dataclasses.MISSING:
field_initializer["default_factory"] = python_type_to_str(
field_initializer["default_factory"] = fmt.python_type_to_str(
field.default_factory
)
if metadata:
Expand Down
14 changes: 7 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ include_package_data = True
packages = find:
python_requires = >=3.9
install_requires =
json_strong_typing >= 0.3.4
certifi >= 2024.8.30; python_version<"3.10"
truststore >= 0.9; python_version>="3.10"
json_strong_typing >= 0.3.5
certifi >= 2024.12.14; python_version<"3.10"
truststore >= 0.10; python_version>="3.10"
typing_extensions >= 4.12; python_version<"3.12"

[options.extras_require]
tsv =
tsv2py >= 0.7
postgresql =
asyncpg >= 0.29
asyncpg >= 0.30
oracle =
oracledb >= 2.4
oracledb >= 2.5
mysql =
aiomysql >= 0.2
PyMySQL[rsa]
PyMySQL[rsa] >= 1.1
mssql =
pyodbc >= 5.1
pyodbc >= 5.2
snowflake =
snowflake-connector-python >= 3.12
trino =
Expand Down
1 change: 1 addition & 0 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def test_struct_reference(self) -> None:
],
)

@unittest.skip("create_module")
def test_module(self) -> None:
catalog = module_to_catalog(
tables,
Expand Down

0 comments on commit 7806afc

Please sign in to comment.