Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change supported python versions to 3.8-3.12 #263

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.10"]
include:
- os: "ubuntu-20.04"
python_version: "3.6"
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.10"]

runs-on: ${{ matrix.os }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ This package [is hosted on PyPI](https://pypi.org/project/marshmallow-dataclass/
pip3 install marshmallow-dataclass
```

You may optionally install the following extras:

- `enum` : enum support for marshmallow versions <3.18 [marshmallow-enum](https://github.com/justanr/marshmallow_enum).
- `union` : for translating python [`Union` types](https://docs.python.org/3/library/typing.html#typing.Union) to union fields.

```shell
pip3 install "marshmallow-dataclass[enum,union]"
pip3 install "marshmallow-dataclass"
```

### marshmallow 2 support
Expand Down
29 changes: 8 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
from setuptools import setup, find_packages

VERSION = "8.6.1"
VERSION = "9.0.0"

CLASSIFIERS = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"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",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
]

EXTRAS_REQUIRE = {
"enum": [
"marshmallow-enum; python_version < '3.7'",
"marshmallow>=3.18.0,<4.0; python_version >= '3.7'",
],
"union": ["typeguard>=2.4.1,<5.0.0"],
"lint": ["pre-commit~=2.17"],
':python_version == "3.6"': ["dataclasses", "types-dataclasses<0.6.4"],
"docs": ["sphinx"],
"tests": [
"pytest>=5.4",
Expand All @@ -34,11 +27,7 @@
],
}
EXTRAS_REQUIRE["dev"] = (
EXTRAS_REQUIRE["enum"]
+ EXTRAS_REQUIRE["union"]
+ EXTRAS_REQUIRE["lint"]
+ EXTRAS_REQUIRE["docs"]
+ EXTRAS_REQUIRE["tests"]
EXTRAS_REQUIRE["lint"] + EXTRAS_REQUIRE["docs"] + EXTRAS_REQUIRE["tests"]
)

setup(
Expand All @@ -56,15 +45,13 @@
keywords=["marshmallow", "dataclass", "serialization"],
classifiers=CLASSIFIERS,
license="MIT",
python_requires=">=3.6",
python_requires=">=3.8",
install_requires=[
"marshmallow>=3.13.0,<4.0",
"typing-inspect>=0.8.0,<1.0",
# Need `Literal`
"typing-extensions>=3.7.2; python_version < '3.8'",
"marshmallow>=3.18.0,",
"typing-inspect~=0.9.0",
"typeguard~=4.0.0",
# Need `dataclass_transform(field_specifiers)`
# NB: typing-extensions>=4.2.0 conflicts with python 3.6
"typing-extensions>=4.2.0; python_version<'3.11' and python_version>='3.7'",
"typing-extensions>=4.2.0; python_version<'3.11'",
],
extras_require=EXTRAS_REQUIRE,
package_data={"marshmallow_dataclass": ["py.typed"]},
Expand Down
4 changes: 0 additions & 4 deletions tests/test_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ class PEP604IntOrStr:
data_in = {"value": 42}
self.assertEqual(schema.dump(schema.load(data_in)), data_in)

@unittest.skipIf(
sys.version_info < (3, 7, 4),
"Requires typeguard >=4.0.0 not available for py<3.7.4",
)
def test_union_with_generics(self):
IntList = NewType("IntList", List[int])

Expand Down
Loading