]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
switch to pyproject.toml
authorDavid Lord <davidism@gmail.com>
Fri, 20 Jan 2023 01:27:01 +0000 (17:27 -0800)
committerDavid Lord <davidism@gmail.com>
Fri, 20 Jan 2023 02:17:03 +0000 (18:17 -0800)
.flake8 [new file with mode: 0644]
.github/workflows/tests.yaml
CHANGES.rst
pyproject.toml [new file with mode: 0644]
setup.cfg [deleted file]
setup.py [deleted file]

diff --git a/.flake8 b/.flake8
new file mode 100644 (file)
index 0000000..db529bd
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,25 @@
+[flake8]
+extend-select =
+    # bugbear
+    B
+    # bugbear opinions
+    B9
+    # implicit str concat
+    ISC
+extend-ignore =
+    # slice notation whitespace, invalid
+    E203
+    # line length, handled by bugbear B950
+    E501
+    # bare except, handled by bugbear B001
+    E722
+    # zip with strict=, requires python >= 3.10
+    B905
+    # string formatting opinion, B028 renamed to B907
+    B028
+    B907
+# up to 88 allowed by bugbear B950
+max-line-length = 80
+per-file-ignores =
+    # __init__ exports names
+    src/jinja2/__init__.py: F401
index b757fa015bf48f5ace69d00d1f2636a313d33c73..85e748b640871897ffcf6aae042bc1f2422cd394 100644 (file)
@@ -50,7 +50,7 @@ jobs:
         uses: actions/cache@v3
         with:
           path: ./.mypy_cache
-          key: mypy|${{ matrix.python }}|${{ hashFiles('setup.cfg') }}
+          key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}
         if: matrix.tox == 'typing'
       - run: pip install tox
       - run: tox run -e ${{ matrix.tox }}
index 7ee75a6a7ff789f6893b0ebf70cd55c548fd3224..d539a7373a2012cff87718ef30e9c3b80c5d2ab2 100644 (file)
@@ -5,6 +5,9 @@ Version 3.2.0
 
 Unreleased
 
+-   Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.
+    :pr:`1793`
+
 
 Version 3.1.2
 -------------
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644 (file)
index 0000000..f90576d
--- /dev/null
@@ -0,0 +1,68 @@
+[project]
+name = "Jinja2"
+description = "A very fast and expressive template engine."
+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",
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: BSD License",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python",
+    "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
+    "Topic :: Text Processing :: Markup :: HTML",
+]
+requires-python = ">=3.7"
+dependencies = ["MarkupSafe>=2.0"]
+dynamic = ["version"]
+
+[project.urls]
+Donate = "https://palletsprojects.com/donate"
+Documentation = "https://jinja.palletsprojects.com/"
+Changes = "https://jinja.palletsprojects.com/changes/"
+"Source Code" = "https://github.com/pallets/jinja/"
+"Issue Tracker" = "https://github.com/pallets/jinja/issues/"
+Twitter = "https://twitter.com/PalletsTeam"
+Chat = "https://discord.gg/pallets"
+
+[project.optional-dependencies]
+i18n = ["Babel>=2.7"]
+
+[project.entry-points."babel.extractors"]
+
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools.dynamic]
+version = {attr = "jinja2.__version__"}
+
+[tool.pytest.ini_options]
+testpaths = ["tests"]
+filterwarnings = ["error"]
+
+[tool.coverage.run]
+branch = true
+source = ["jinja2", "tests"]
+
+[tool.coverage.paths]
+source = ["src", "*/site-packages"]
+
+[tool.mypy]
+python_version = "3.7"
+files = ["src/jinja2"]
+show_error_codes = true
+pretty = true
+strict = true
+local_partial_types = true
+warn_unreachable = true
+
+[[tool.mypy.overrides]]
+module = [
+    "jinja2.defaults",
+    "markupsafe",
+]
+no_implicit_reexport = false
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644 (file)
index edfa309..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,111 +0,0 @@
-[metadata]
-name = Jinja2
-version = attr: jinja2.__version__
-url = https://palletsprojects.com/p/jinja/
-project_urls =
-    Donate = https://palletsprojects.com/donate
-    Documentation = https://jinja.palletsprojects.com/
-    Changes = https://jinja.palletsprojects.com/changes/
-    Source Code = https://github.com/pallets/jinja/
-    Issue Tracker = https://github.com/pallets/jinja/issues/
-    Twitter = https://twitter.com/PalletsTeam
-    Chat = https://discord.gg/pallets
-license = BSD-3-Clause
-license_files = LICENSE.rst
-author = Armin Ronacher
-author_email = armin.ronacher@active-4.com
-maintainer = Pallets
-maintainer_email = contact@palletsprojects.com
-description = A very fast and expressive template engine.
-long_description = file: README.rst
-long_description_content_type = text/x-rst
-classifiers =
-    Development Status :: 5 - Production/Stable
-    Environment :: Web Environment
-    Intended Audience :: Developers
-    License :: OSI Approved :: BSD License
-    Operating System :: OS Independent
-    Programming Language :: Python
-    Topic :: Internet :: WWW/HTTP :: Dynamic Content
-    Topic :: Text Processing :: Markup :: HTML
-
-[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]
-babel.extractors =
-    jinja2 = jinja2.ext:babel_extract[i18n]
-
-[tool:pytest]
-testpaths = tests
-filterwarnings =
-    error
-    # Python 3.9 raises a deprecation from internal asyncio code.
-    ignore:The loop argument:DeprecationWarning:asyncio[.]base_events:542
-
-[coverage:run]
-branch = True
-source =
-    jinja2
-    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
-    # line length, handled by bugbear B950
-    E501
-    # bare except, handled by bugbear B001
-    E722
-    # bin op line break, invalid
-    W503
-    # zip with strict=, requires python >= 3.10
-    B905
-# up to 88 allowed by bugbear B950
-max-line-length = 80
-per-file-ignores =
-    # __init__ exports names
-    src/jinja2/__init__.py: F401
-
-[mypy]
-files = src/jinja2
-python_version = 3.7
-show_error_codes = 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-jinja2.defaults]
-no_implicit_reexport = False
-
-[mypy-markupsafe]
-no_implicit_reexport = False
diff --git a/setup.py b/setup.py
deleted file mode 100644 (file)
index 79d0708..0000000
--- a/setup.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from setuptools import setup
-
-# Metadata goes in setup.cfg. These are here for GitHub's dependency graph.
-setup(
-    name="Jinja2",
-    install_requires=["MarkupSafe>=2.0"],
-    extras_require={"i18n": ["Babel>=2.7"]},
-)