From 896202b02466beaa7e762b3275376e13ab76b7d0 Mon Sep 17 00:00:00 2001 From: "Stephen J. Fuhry" Date: Tue, 2 Apr 2024 15:03:57 +0000 Subject: [PATCH] run python 3.12 in the build, formatting tweaks --- .github/workflows/build.yml | 29 +++++++++++++++-------------- marshmallow_jsonschema/__init__.py | 6 +++--- marshmallow_jsonschema/base.py | 6 +++--- pyproject.toml | 2 +- setup.py | 4 ++-- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f0ed76..2bad979 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,4 @@ +--- name: Test Coverage on: ["push", "pull_request"] @@ -12,18 +13,18 @@ jobs: # # Please bump to the latest unreleased candidate # when you come across this and have a moment to spare! - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@master - - name: set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -U tox tox-gh-actions - pip install -r requirements-tox.txt -r requirements-test.txt - - name: Run tox - run: | - tox -e py + - uses: actions/checkout@master + - name: set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U tox tox-gh-actions + pip install -r requirements-tox.txt -r requirements-test.txt + - name: Run tox + run: | + tox -e py diff --git a/marshmallow_jsonschema/__init__.py b/marshmallow_jsonschema/__init__.py index 3e60b2a..fa254c7 100644 --- a/marshmallow_jsonschema/__init__.py +++ b/marshmallow_jsonschema/__init__.py @@ -1,9 +1,9 @@ -from pkg_resources import get_distribution +from importlib.metadata import version -__version__ = get_distribution("marshmallow-jsonschema").version +__version__ = version("marshmallow-jsonschema") __license__ = "MIT" from .base import JSONSchema from .exceptions import UnsupportedValueError -__all__ = ("JSONSchema", "UnsupportedValueError") +__all__ = ("JSONSchema", "UnsupportedValueError", "__version__", "__license__") diff --git a/marshmallow_jsonschema/base.py b/marshmallow_jsonschema/base.py index 2db5a3d..928303b 100644 --- a/marshmallow_jsonschema/base.py +++ b/marshmallow_jsonschema/base.py @@ -166,9 +166,9 @@ def get_properties(self, obj) -> typing.Dict[str, typing.Dict[str, typing.Any]]: for field_name, field in fields_items_sequence: schema = self._get_schema_for_field(obj, field) - properties[ - field.metadata.get("name") or field.data_key or field.name - ] = schema + properties[field.metadata.get("name") or field.data_key or field.name] = ( + schema + ) return properties diff --git a/pyproject.toml b/pyproject.toml index 461e58a..960b197 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [tool.black] -target-version = ['py39', 'py310'] +target-version = ['py39', 'py310', 'py311', 'py312'] diff --git a/setup.py b/setup.py index 4974e20..60d52df 100644 --- a/setup.py +++ b/setup.py @@ -60,11 +60,11 @@ def read(fname): "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], test_suite="tests", )