Skip to content

Commit

Permalink
Changed supported python versions to 3.8-3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jasle committed May 10, 2024
1 parent 5b33c3b commit 10f490c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ 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[union]"
```

### marshmallow 2 support
Expand Down
26 changes: 8 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
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"],
"union": ["typeguard~=4.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,8 +28,7 @@
],
}
EXTRAS_REQUIRE["dev"] = (
EXTRAS_REQUIRE["enum"]
+ EXTRAS_REQUIRE["union"]
EXTRAS_REQUIRE["union"]
+ EXTRAS_REQUIRE["lint"]
+ EXTRAS_REQUIRE["docs"]
+ EXTRAS_REQUIRE["tests"]
Expand All @@ -56,15 +49,12 @@
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",
# 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

0 comments on commit 10f490c

Please sign in to comment.