diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 50e3ed8d..bb8d608a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.x"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.x"] steps: - uses: actions/checkout@v2 - uses: NiklasRosenstein/slap@gha/install/v1 @@ -28,4 +28,5 @@ jobs: - run: slap --version && slap install --only-extras docs --no-venv-check - run: slap run --no-venv-check docs:build - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: { branch: gh-pages, folder: docs/_site, ssh-key: "${{ secrets.DEPLOY_KEY }}" } \ No newline at end of file + with: { branch: gh-pages, folder: docs/_site, ssh-key: "${{ secrets.DEPLOY_KEY }}" } + if: github.ref == 'refs/heads/develop' diff --git a/databind.core/.changelog/_unreleased.toml b/databind.core/.changelog/_unreleased.toml new file mode 100644 index 00000000..cdd0b3f6 --- /dev/null +++ b/databind.core/.changelog/_unreleased.toml @@ -0,0 +1,9 @@ +[[entries]] +id = "04482ac4-46c4-461d-962c-d7998cd01548" +type = "breaking change" +description = "Support typing-extensions>4.7 for Python 3.8 or greater" +author = "@rhaps0dy" +pr = "https://github.com/NiklasRosenstein/python-databind/pull/60" +issues = [ + "https://github.com/NiklasRosenstein/python-databind/issues/59", +] diff --git a/databind.core/pyproject.toml b/databind.core/pyproject.toml index 29d726c9..26733a2e 100644 --- a/databind.core/pyproject.toml +++ b/databind.core/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "databind.core" version = "4.4.2" -description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.7 and newer." +description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.8 and newer." authors = ["Niklas Rosenstein "] license = "MIT" readme = "README.md" @@ -14,20 +14,20 @@ Documentation = "https://niklasrosenstein.github.io/python-databind/" Repository = "https://github.com/NiklasRosenstein/python-databind" [tool.poetry.dependencies] -python = "^3.6.3" +python = "^3.8.0" Deprecated = "^1.2.12" nr-date = "^2.0.0" nr-stream = "^1.0.0" setuptools = { version = ">=40.8.0", markers = "python_version < '3.10'" } -typeapi = "^2.0.1" -typing-extensions = ">=3.10.0,<4.7" # See https://github.com/python/typing_extensions/issues/265#issuecomment-1616809112 +typeapi = ">=2.0.1,<3" +typing-extensions = ">=3.10.0,<5" [tool.poetry.dev-dependencies] -black = "*" -flake8 = "*" -isort = "*" -pytest = "*" -mypy = "*" +black = ">=23.0.0,<24.0.0" +flake8 = ">=5.0.4,<8.0.0" +isort = ">=5.13.2,<6.0.0" +pytest = ">=8.1.1,<9.0.0" +mypy = ">=1.9.0,<2.0.0" types-dataclasses = "*" types-deprecated = "*" types-setuptools = "*" @@ -37,7 +37,7 @@ types-termcolor = "*" typed = true [build-system] -requires = ["poetry-core==1.0.8"] +requires = ["poetry-core==1.9.0"] build-backend = "poetry.core.masonry.api" [tool.slap.test] @@ -52,7 +52,7 @@ flake8 = "flake8 src/" fmt = "black src/ && isort src/" [tool.mypy] -python_version = "3.6" +python_version = "3.8" explicit_package_bases = true mypy_path = ["src"] namespace_packages = true diff --git a/databind.core/src/databind/core/tests/schema_test.py b/databind.core/src/databind/core/tests/schema_test.py index dcd773b9..83873117 100644 --- a/databind.core/src/databind/core/tests/schema_test.py +++ b/databind.core/src/databind/core/tests/schema_test.py @@ -1,9 +1,3 @@ -# In Python 3.6, we get a warning about an unused ignore later in the file, but not in other versions of Python. -# Let's ignore that warning for the whole file, there doesn't seem to be a better way to have Mypy ignore the unused -# ignore comment. - -# mypy: no-warn-unused-ignores - import dataclasses import typing as t diff --git a/databind.json/.changelog/_unreleased.toml b/databind.json/.changelog/_unreleased.toml new file mode 100644 index 00000000..933da1db --- /dev/null +++ b/databind.json/.changelog/_unreleased.toml @@ -0,0 +1,9 @@ +[[entries]] +id = "6aab96f1-c6c0-4afe-bd73-0071d5dedebb" +type = "breaking change" +description = "Support typing-extensions>4.7 for Python 3.8 or greater" +author = "@rhaps0dy" +pr = "https://github.com/NiklasRosenstein/python-databind/pull/60" +issues = [ + "https://github.com/NiklasRosenstein/python-databind/issues/59", +] diff --git a/databind.json/.flake8 b/databind.json/.flake8 index 6deafc26..414087b0 100644 --- a/databind.json/.flake8 +++ b/databind.json/.flake8 @@ -1,2 +1,3 @@ [flake8] max-line-length = 120 +extend-ignore = W503,W504,E203,E704,E701 diff --git a/databind.json/pyproject.toml b/databind.json/pyproject.toml index 29d2859a..77ed1e37 100644 --- a/databind.json/pyproject.toml +++ b/databind.json/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "databind.json" version = "4.4.2" -description = "De-/serialize Python dataclasses to or from JSON payloads. Compatible with Python 3.7 and newer." +description = "De-/serialize Python dataclasses to or from JSON payloads. Compatible with Python 3.8 and newer." authors = ["Niklas Rosenstein "] license = "MIT" readme = "README.md" @@ -14,21 +14,21 @@ Documentation = "https://niklasrosenstein.github.io/python-databind/" Repository = "https://github.com/NiklasRosenstein/python-databind" [tool.poetry.dependencies] -python = "^3.6.3" +python = "^3.8.0" "databind.core" = "^4.4.2" nr-date = "^2.0.0" -typeapi = "^2.0.1" -typing-extensions = ">=3.10.0,<4.7" # See https://github.com/python/typing_extensions/issues/265#issuecomment-1616809112 +typeapi = ">=2.0.1,<3" +typing-extensions = ">=3.10.0,<5" [tool.poetry.dev-dependencies] -black = "*" -flake8 = "*" -isort = "*" -pytest = "*" -mypy = "*" +black = ">=23.0.0,<24.0.0" +flake8 = ">=5.0.4,<8.0.0" +isort = ">=5.13.2,<6.0.0" +pytest = ">=8.1.1,<9.0.0" +mypy = ">=1.9.0,<2.0.0" [build-system] -requires = ["poetry-core==1.0.8"] +requires = ["poetry-core==1.9.0"] build-backend = "poetry.core.masonry.api" [tool.slap] @@ -46,7 +46,7 @@ flake8 = "flake8 src/" fmt = "black src/ && isort src/" [tool.mypy] -python_version = "3.6" +python_version = "3.8" explicit_package_bases = true mypy_path = ["src"] namespace_packages = true diff --git a/databind.json/src/databind/json/converters.py b/databind.json/src/databind/json/converters.py index 20d52737..9f7f8497 100644 --- a/databind.json/src/databind/json/converters.py +++ b/databind.json/src/databind/json/converters.py @@ -2,7 +2,6 @@ import datetime import decimal import enum -import types import typing as t from databind.core import ( @@ -167,7 +166,6 @@ def _length_check() -> None: try: return python_type(values) except TypeError: - assert not isinstance(values, types.GeneratorType), (type(values), python_type) # We assume that the native list is an appropriate placeholder for whatever specific Collection type # was chosen in the value's datatype. return values @@ -193,11 +191,13 @@ def convert(self, ctx: Context) -> t.Any: datefmt = ctx.get_setting(DateFormat) or ( self.DEFAULT_DATE_FMT if date_type == datetime.date - else self.DEFAULT_TIME_FMT - if date_type == datetime.time - else self.DEFAULT_DATETIME_FMT - if date_type == datetime.datetime - else None + else ( + self.DEFAULT_TIME_FMT + if date_type == datetime.time + else self.DEFAULT_DATETIME_FMT + if date_type == datetime.datetime + else None + ) ) assert datefmt is not None diff --git a/databind/pyproject.toml b/databind/pyproject.toml index 0f0736dd..981204e4 100644 --- a/databind/pyproject.toml +++ b/databind/pyproject.toml @@ -1,17 +1,17 @@ [tool.poetry] name = "databind" version = "4.4.2" -description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. The `databind` package will install the full suite of databind packages. Compatible with Python 3.7 and newer." +description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. The `databind` package will install the full suite of databind packages. Compatible with Python 3.8 and newer." authors = ["Niklas Rosenstein "] license = "MIT" readme = "README.md" packages = [{ include="databind/_version", from="src" }] [tool.poetry.dependencies] -python = "^3.6.3" +python = "^3.8.0" "databind.core" = "^4.4.2" "databind.json" = "^4.4.2" [build-system] -requires = ["poetry-core==1.0.8"] +requires = ["poetry-core==1.9.0"] build-backend = "poetry.core.masonry.api"