From 68c42bf2f7313b1f71fbbe00778b0ff4f04803cb Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Tue, 16 Jan 2024 16:02:26 -0500 Subject: [PATCH] Migrate to pyproject.toml; remove __version__ --- .flake8 | 4 ++++ MANIFEST.in | 5 ----- pyproject.toml | 52 +++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 16 -------------- setup.py | 57 -------------------------------------------------- 5 files changed, 56 insertions(+), 78 deletions(-) create mode 100644 .flake8 delete mode 100644 MANIFEST.in delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..8db9c4f --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 90 +max-complexity = 18 +extend-ignore = E203, E266, E501, E731, B903 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c904a6a..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include *.rst LICENSE -recursive-include docs * -recursive-exclude docs *.pyc -recursive-exclude docs *.pyo -prune docs/_build diff --git a/pyproject.toml b/pyproject.toml index 4c6215c..6310c42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,55 @@ +[project] +name = "flask-marshmallow" +version = "1.0.0" +description = "Flask + marshmallow for beautiful APIs" +readme = "README.rst" +license = { file = "LICENSE" } +maintainers = [{ name = "Steven Loria", email = "sloria1@gmail.com" }] +classifiers = [ + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "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", +] +requires-python = ">=3.8" +dependencies = ["Flask", "marshmallow>=3.0.0", "packaging>=17.0"] + +[project.urls] +Issues = "https://github.com/marshmallow-code/flask-marshmallow/issues" +Funding = "https://opencollective.com/marshmallow" + +[project.optional-dependencies] +docs = [ + "marshmallow-sqlalchemy>=0.19.0", + "Sphinx==7.2.6", + "sphinx-issues==3.0.1", +] +tests = ["flask-marshmallow[sqlalchemy]", "pytest"] +dev = ["flask-marshmallow[tests]", "tox", "pre-commit~=3.5"] +sqlalchemy = ["flask-sqlalchemy>=3.0.0", "marshmallow-sqlalchemy>=0.29.0"] + +[build-system] +requires = ["flit_core<4"] +build-backend = "flit_core.buildapi" + +[tool.flit.sdist] +include = ["docs/", "tests/", "CHANGELOG.rst", "CONTRIBUTING.rst", "tox.ini"] +exclude = ["docs/_build/"] + [tool.black] line-length = 88 target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] + +[tool.pytest.ini_options] +filterwarnings = [ + "error", + "ignore:The Query\\.get\\(\\) method is considered legacy:sqlalchemy.exc.LegacyAPIWarning", + "ignore:distutils Version classes are deprecated\\. Use packaging.version instead\\.:DeprecationWarning:marshmallow", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1d9ccbf..0000000 --- a/setup.cfg +++ /dev/null @@ -1,16 +0,0 @@ -[metadata] -license_files = LICENSE - -[flake8] -max-line-length = 90 -max-complexity = 18 -extend-ignore = E203, E266, E501, E731, B903 - -[tool:pytest] -filterwarnings = - # warnings are errors - error - # marshmallow-sqlalchemy triggers this on sqlalchemy 2.0 - ignore:The Query\.get\(\) method is considered legacy:sqlalchemy.exc.LegacyAPIWarning - # marshmallow triggers this when we test on marshmallow version 3.0 - ignore:distutils Version classes are deprecated\. Use packaging.version instead\.:DeprecationWarning:marshmallow diff --git a/setup.py b/setup.py deleted file mode 100644 index 89228c1..0000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -from setuptools import find_packages, setup - -EXTRAS_REQUIRE = { - "sqlalchemy": [ - "flask-sqlalchemy>=3.0.0", - "marshmallow-sqlalchemy>=0.29.0", - ], - "docs": ["marshmallow-sqlalchemy>=0.19.0", "Sphinx==7.2.6", "sphinx-issues==3.0.1"], -} -EXTRAS_REQUIRE["tests"] = EXTRAS_REQUIRE["sqlalchemy"] + ["pytest"] -EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + ["tox", "pre-commit~=3.5"] - -REQUIRES = ["Flask", "marshmallow>=3.0.0", "packaging>=17.0"] - - -def read(fname): - with open(fname) as fp: - content = fp.read() - return content - - -setup( - name="flask-marshmallow", - version="1.0.0", - description="Flask + marshmallow for beautiful APIs", - long_description=read("README.rst"), - author="Steven Loria", - author_email="sloria1@gmail.com", - url="https://github.com/marshmallow-code/flask-marshmallow", - packages=find_packages("src"), - package_dir={"": "src"}, - include_package_data=True, - install_requires=REQUIRES, - extras_require=EXTRAS_REQUIRE, - license="MIT", - zip_safe=False, - keywords="flask-marshmallow", - python_requires=">=3.8", - classifiers=[ - "Environment :: Web Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "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", - ], - test_suite="tests", - project_urls={ - "Issues": "https://github.com/marshmallow-code/flask-marshmallow/issues", - "Funding": "https://opencollective.com/marshmallow", - }, -)