Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyadi committed Jan 9, 2024
1 parent 6ff8751 commit 246f68c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 10s
--health-retries 10
--health-start-period 30s
strategy:
matrix:
Expand Down Expand Up @@ -172,6 +172,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install Microsoft ODBC
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Levente Hunyadi
Copyright (c) 2023-2024 Levente Hunyadi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion pysqlsync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

__version__ = "0.3.0"
__author__ = "Levente Hunyadi"
__copyright__ = "Copyright 2023, Levente Hunyadi"
__copyright__ = "Copyright 2023-2024, Levente Hunyadi"
__license__ = "MIT"
__maintainer__ = "Levente Hunyadi"
__status__ = "Production"
14 changes: 7 additions & 7 deletions pysqlsync/formation/sql_to_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import keyword
import sys
import types
import typing
from dataclasses import dataclass
from io import StringIO
from typing import Annotated, Any, Optional, Union
Expand Down Expand Up @@ -122,7 +123,7 @@ def qual_to_module(self, id: SupportsQualifiedId) -> str:

def column_to_field(
self, table: Table, column: Column
) -> tuple[str, TypeLike, dataclasses.Field]:
) -> tuple[str, type, dataclasses.Field]:
"""
Generates a dataclass field corresponding to a table column.
Expand Down Expand Up @@ -154,11 +155,10 @@ def column_to_field(
union_types = tuple(self.qual_to_module(r.table) for r in c.references)
field_type = Union[union_types]

return (
field_name,
field_type,
dataclasses.field(default=default),
)
# use cast to ensure compatibility with signature of `make_dataclass`
data_type = typing.cast(type, field_type)

return (field_name, data_type, dataclasses.field(default=default))

def table_to_dataclass(self, table: Table) -> type[DataclassInstance]:
"""
Expand All @@ -183,7 +183,7 @@ def table_to_dataclass(self, table: Table) -> type[DataclassInstance]:
typ = dataclasses.make_dataclass(class_name, fields, module=module.__name__)
else:
typ = dataclasses.make_dataclass(
class_name, fields, namespace={"__module__": module.__name__} # type: ignore
class_name, fields, namespace={"__module__": module.__name__}
)
with StringIO() as out:
for field in dataclasses.fields(typ):
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# core
json_strong_typing >= 0.3.1
json_strong_typing >= 0.3.2
typing_extensions >= 4.8; python_version<"3.12"

# development tools
mypy
flake8
build >= 1.0
mypy >= 1.8
flake8 >= 7.0

# data export/import
tsv2py >= 0.5.2
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include_package_data = True
packages = find:
python_requires = >=3.9
install_requires =
json_strong_typing >= 0.3.1
json_strong_typing >= 0.3.2
typing_extensions >= 4.8; python_version<"3.12"

[options.extras_require]
Expand Down

0 comments on commit 246f68c

Please sign in to comment.