diff --git a/pyproject.toml b/pyproject.toml index 4112bd1..743a800 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,88 @@ +[build-system] +requires = ["setuptools >= 61.0"] + +[project] +name = "marshmallow_dataclass" +version = "8.5.14" +description = "Python library to convert dataclasses into marshmallow schemas." +readme = "README.md" +keywords = ["marshmallow", "dataclass", "serialization"] +license = { text = "MIT" } +requires-python = ">=3.6" + +authors = [ + { name = "Ophir LOJKINE", email = "pere.jobs@gmail.com" }, +] + +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", + "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries", +] + +dependencies = [ + "marshmallow>=3.13.0,<4.0", + 'dataclasses; python_version == "3.6"', + 'types-dataclasses<0.6.4; python_version == "3.6"', + "typing-inspect>=0.8.0,<1.0", + # Need `Literal` + "typing-extensions>=3.7.2; python_version < '3.8'", + # 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'", +] + +[project.urls] +Homepage = "https://github.com/lovasoa/marshmallow_dataclass" + +[project.optional-dependencies] +enum = [ + "marshmallow-enum; python_version < '3.7'", + "marshmallow>=3.18.0,<4.0; python_version >= '3.7'", +] +union = ["typeguard>=2.4.1,<4.0.0"] +lint = ["pre-commit~=2.17"] +docs = ["sphinx"] +tests = [ + "pytest>=5.4", + # re: pypy: typed-ast (a dependency of mypy) fails to install on pypy + # https://github.com/python/typed_ast/issues/111 + "pytest-mypy-plugins>=1.2.0; implementation_name != 'pypy'", +] +dev = [ + "marshmallow_dataclass[enum]", + "marshmallow_dataclass[union]", + "marshmallow_dataclass[lint]", + "marshmallow_dataclass[docs]", + "marshmallow_dataclass[tests]", +] + +[tool.setuptools.package-data] +marshmallow_dataclass = ["py.typed"] + +[tool.setuptools.packages.find] +namespaces = false +include = [ + "marshmallow_dataclass", + "marshmallow_dataclass.*", +] + [tool.black] line-length = 88 target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py310'] +[tool.mypy] +ignore_missing_imports = true + [tool.pytest.ini_options] filterwarnings = [ "error:::marshmallow_dataclass|test", diff --git a/setup.cfg b/setup.cfg index 1216d89..1d9262e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,6 @@ [flake8] +# TODO: move to pyproject.toml after https://github.com/PyCQA/flake8/issues/234 ignore = E203, E266, E501, W503 max-line-length = 100 max-complexity = 18 select = B,C,E,F,W,T4,B9 - -[mypy] -ignore_missing_imports = true diff --git a/setup.py b/setup.py deleted file mode 100644 index e23478a..0000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -from setuptools import setup, find_packages - -VERSION = "8.5.14" - -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", - "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,<4.0.0"], - "lint": ["pre-commit~=2.17"], - ':python_version == "3.6"': ["dataclasses", "types-dataclasses<0.6.4"], - "docs": ["sphinx"], - "tests": [ - "pytest>=5.4", - # re: pypy: typed-ast (a dependency of mypy) fails to install on pypy - # https://github.com/python/typed_ast/issues/111 - "pytest-mypy-plugins>=1.2.0; implementation_name != 'pypy'", - ], -} -EXTRAS_REQUIRE["dev"] = ( - EXTRAS_REQUIRE["enum"] - + EXTRAS_REQUIRE["union"] - + EXTRAS_REQUIRE["lint"] - + EXTRAS_REQUIRE["docs"] - + EXTRAS_REQUIRE["tests"] -) - -setup( - name="marshmallow_dataclass", - version=VERSION, - description="Python library to convert dataclasses into marshmallow schemas.", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - packages=find_packages( - include=["marshmallow_dataclass", "marshmallow_dataclass.*"] - ), - author="Ophir LOJKINE", - author_email="pere.jobs@gmail.com", - url="https://github.com/lovasoa/marshmallow_dataclass", - keywords=["marshmallow", "dataclass", "serialization"], - classifiers=CLASSIFIERS, - license="MIT", - python_requires=">=3.6", - 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'", - # 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'", - ], - extras_require=EXTRAS_REQUIRE, - package_data={"marshmallow_dataclass": ["py.typed"]}, -)