switch to pyproject.toml

This commit is contained in:
David Lord 2023-01-18 09:50:41 -08:00
parent 9da947a279
commit 6d6d986fc5
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
6 changed files with 123 additions and 141 deletions

26
.flake8 Normal file
View File

@ -0,0 +1,26 @@
[flake8]
# B = bugbear
# E = pycodestyle errors
# F = flake8 pyflakes
# W = pycodestyle warnings
# B9 = bugbear opinions
# ISC = implicit str concat
select = B, E, F, W, B9, ISC
ignore =
# slice notation whitespace, invalid
E203
# import at top, too many circular import fixes
E402
# line length, handled by bugbear B950
E501
# bare except, handled by bugbear B001
E722
# bin op line break, invalid
W503
# requires Python 3.10
B905
# up to 88 allowed by bugbear B950
max-line-length = 80
per-file-ignores =
# __init__ exports names
src/flask/__init__.py: F401

View File

@ -52,7 +52,7 @@ jobs:
uses: actions/cache@v3.2.2 uses: actions/cache@v3.2.2
with: with:
path: ./.mypy_cache path: ./.mypy_cache
key: mypy|${{ matrix.python }}|${{ hashFiles('setup.cfg') }} key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}
if: matrix.tox == 'typing' if: matrix.tox == 'typing'
- run: pip install tox - run: pip install tox
- run: tox run -e ${{ matrix.tox }} - run: tox run -e ${{ matrix.tox }}

View File

@ -3,6 +3,8 @@ Version 2.3.0
Unreleased Unreleased
- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
:pr:`4947`
- Ensure subdomains are applied with nested blueprints. :issue:`4834` - Ensure subdomains are applied with nested blueprints. :issue:`4834`

94
pyproject.toml Normal file
View File

@ -0,0 +1,94 @@
[project]
name = "Flask"
description = "A simple framework for building complex web applications."
readme = "README.rst"
license = {text = "BSD-3-Clause"}
maintainers = [{name = "Pallets", email = "contact@palletsprojects.com"}]
authors = [{name = "Armin Ronacher", email = "armin.ronacher@active-4.com"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Flask",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: WSGI",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
requires-python = ">=3.7"
dependencies = [
"Werkzeug>=2.2.2",
"Jinja2>=3.0",
"itsdangerous>=2.0",
"click>=8.0",
"importlib-metadata>=3.6.0; python_version < '3.10'",
]
dynamic = ["version"]
[project.urls]
Donate = "https://palletsprojects.com/donate"
Documentation = "https://flask.palletsprojects.com/"
Changes = "https://flask.palletsprojects.com/changes/"
"Source Code" = "https://github.com/pallets/flask/"
"Issue Tracker" = "https://github.com/pallets/flask/issues/"
Twitter = "https://twitter.com/PalletsTeam"
Chat = "https://discord.gg/pallets"
[project.optional-dependencies]
async = ["asgiref>=3.2"]
dotenv = ["python-dotenv"]
[project.scripts]
flask = "flask.cli:main"
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools.dynamic]
version = {attr = "flask.__version__"}
[tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = ["error"]
[tool.coverage.run]
branch = true
source = ["flask", "tests"]
[tool.coverage.paths]
source = ["src", "*/site-packages"]
[tool.mypy]
python_version = "3.7"
files = ["src/flask"]
show_error_codes = true
pretty = true
#strict = true
allow_redefinition = true
disallow_subclassing_any = true
#disallow_untyped_calls = true
#disallow_untyped_defs = true
#disallow_incomplete_defs = true
no_implicit_optional = true
local_partial_types = true
#no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
#warn_return_any = true
#warn_unreachable = true
[[tool.mypy.overrides]]
module = [
"asgiref.*",
"blinker.*",
"dotenv.*",
"cryptography.*",
"importlib_metadata",
]
ignore_missing_imports = true

123
setup.cfg
View File

@ -1,123 +0,0 @@
[metadata]
name = Flask
version = attr: flask.__version__
url = https://palletsprojects.com/p/flask
project_urls =
Donate = https://palletsprojects.com/donate
Documentation = https://flask.palletsprojects.com/
Changes = https://flask.palletsprojects.com/changes/
Source Code = https://github.com/pallets/flask/
Issue Tracker = https://github.com/pallets/flask/issues/
Twitter = https://twitter.com/PalletsTeam
Chat = https://discord.gg/pallets
license = BSD-3-Clause
author = Armin Ronacher
author_email = armin.ronacher@active-4.com
maintainer = Pallets
maintainer_email = contact@palletsprojects.com
description = A simple framework for building complex web applications.
long_description = file: README.rst
long_description_content_type = text/x-rst
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Framework :: Flask
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Internet :: WWW/HTTP :: WSGI
Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Topic :: Software Development :: Libraries :: Application Frameworks
[options]
packages = find:
package_dir = = src
include_package_data = True
python_requires = >= 3.7
# Dependencies are in setup.py for GitHub's dependency graph.
[options.packages.find]
where = src
[options.entry_points]
console_scripts =
flask = flask.cli:main
[tool:pytest]
testpaths = tests
filterwarnings =
error
[coverage:run]
branch = True
source =
flask
tests
[coverage:paths]
source =
src
*/site-packages
[flake8]
# B = bugbear
# E = pycodestyle errors
# F = flake8 pyflakes
# W = pycodestyle warnings
# B9 = bugbear opinions
# ISC = implicit str concat
select = B, E, F, W, B9, ISC
ignore =
# slice notation whitespace, invalid
E203
# import at top, too many circular import fixes
E402
# line length, handled by bugbear B950
E501
# bare except, handled by bugbear B001
E722
# bin op line break, invalid
W503
# requires Python 3.10
B905
# up to 88 allowed by bugbear B950
max-line-length = 80
per-file-ignores =
# __init__ exports names
src/flask/__init__.py: F401
[mypy]
files = src/flask, tests/typing
python_version = 3.7
show_error_codes = True
allow_redefinition = True
disallow_subclassing_any = True
# disallow_untyped_calls = True
# disallow_untyped_defs = True
# disallow_incomplete_defs = True
no_implicit_optional = True
local_partial_types = True
# no_implicit_reexport = True
strict_equality = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unused_ignores = True
# warn_return_any = True
# warn_unreachable = True
[mypy-asgiref.*]
ignore_missing_imports = True
[mypy-blinker.*]
ignore_missing_imports = True
[mypy-dotenv.*]
ignore_missing_imports = True
[mypy-cryptography.*]
ignore_missing_imports = True
[mypy-importlib_metadata]
ignore_missing_imports = True

View File

@ -1,17 +0,0 @@
from setuptools import setup
# Metadata goes in setup.cfg. These are here for GitHub's dependency graph.
setup(
name="Flask",
install_requires=[
"Werkzeug >= 2.2.2",
"Jinja2 >= 3.0",
"itsdangerous >= 2.0",
"click >= 8.0",
"importlib-metadata >= 3.6.0; python_version < '3.10'",
],
extras_require={
"async": ["asgiref >= 3.2"],
"dotenv": ["python-dotenv"],
},
)