Repository: ipython/traitlets
Pull request #720 (2022-05-04 01:12:22)

Use flit build backend
Simplifies the build config


Patch:
diff --git a/setup.cfg b/.flake8
similarity index 94%
rename from setup.cfg
rename to .flake8
index a3f8b82..1a52ab8 100644
--- a/setup.cfg
+++ b/.flake8
@@ -1,6 +1,3 @@
-[metadata]
-license_file = COPYING.md
-
 [flake8]
 ignore = E501, W503, E402
 builtins = c, get_config
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 718505f..1b52a30 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -80,11 +80,6 @@ repos:
     rev: v8.14.0
     hooks:
       - id: eslint
-
-  - repo: https://github.com/mgedmin/check-manifest
-    rev: "0.48"
-    hooks:
-      - id: check-manifest
         stages: [manual]
 
   - repo: https://github.com/sirosen/check-jsonschema
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 7ac808b..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,32 +0,0 @@
-include CONTRIBUTING.md
-include COPYING.md
-include README.md
-include CHANGES.txt
-include MANIFEST.in
-include pyproject.toml
-include pytest.ini
-include traitlets/py.typed
-
-exclude .pre-commit-config.yaml
-exclude .git-blame-ignore-revs
-exclude readthedocs.yml
-exclude .mailmap
-
-# Documentation
-graft docs
-exclude docs/\#*
-
-# Examples
-graft examples
-
-# docs subdirs we want to skip
-prune docs/build
-prune docs/gh-pages
-prune docs/dist
-
-# Patterns to exclude from any directory
-global-exclude *~
-global-exclude *.pyc
-global-exclude *.pyo
-global-exclude .git
-global-exclude .ipynb_checkpoints
diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
index 295f13b..47c57a1 100644
--- a/docs/source/changelog.rst
+++ b/docs/source/changelog.rst
@@ -143,7 +143,7 @@ Major changes are:
  - remove ``six`` as a dependency
  - remove ``funcsig`` as a dependency.
  - no longer exposes the following functions / types:
- 
+
    - ClassTypes
    - DefaultHandler
    - EventHandler
@@ -158,7 +158,7 @@ Major changes are:
    - is_trait
    - isidentifier
    - repr_type
- 
+
 
 
 Here is a list of most Pull requests that went into 5.0 and a short description.
diff --git a/pyproject.toml b/pyproject.toml
index bf87a46..dd0b53b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,30 @@
 [build-system]
-requires = ["setuptools>=40.8.0", "wheel"]
-build-backend = "setuptools.build_meta"
+requires = ["flit_core >=3.2,<4"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "traitlets"
+authors = [{name = "IPython Development Team", email = "ipython-dev@python.org"}]
+license = {file = "COPYING.md"}
+readme = "README.md"
+keywords = ["Interactive", "Interpreter", "Shell", "Web"]
+classifiers = [
+    "Intended Audience :: Developers",
+    "Intended Audience :: System Administrators",
+    "Intended Audience :: Science/Research",
+    "License :: OSI Approved :: BSD License",
+    "Programming Language :: Python",
+    "Programming Language :: Python :: 3",
+]
+urls = {Homepage = "https://github.com/ipython/traitlets"}
+requires-python = ">=3.7"
+dynamic = ["description", "version"]
+
+[project.optional-dependencies]
+test = ["pytest", "pre-commit"]
+
+[tool.flit.sdist]
+include = ['examples/']
 
 [tool.mypy]
 check_untyped_defs = true
@@ -18,3 +42,35 @@ warn_unused_configs = true
 warn_redundant_casts = true
 warn_return_any = true
 warn_unused_ignores = true
+
+[tool.pytest.ini_options]
+addopts = "--durations=10 -ra --showlocals --doctest-modules --color yes"
+testpaths = [
+    "traitlets",
+    "examples",
+]
+filterwarnings = [
+    "ignore",
+    "ignore:Passing unrecognized arguments",
+    "ignore:Keyword .* is deprecated",
+    "ignore:Supporting extra quotes around",
+    "ignore:DeprecatedApp._config_changed is deprecated in traitlets",
+    "ignore:A parent of DeprecatedApp._config_changed has adopted",
+    "ignore:KeyValueConfigLoader is deprecated since Traitlets",
+    "ignore:Traits should be given as instances",
+    "ignore:Explicit using of Undefined as",
+    "ignore:on_trait_change is deprecated",
+    "ignore:.*use @observe and @unobserve instead",
+    "ignore:.*for no default is deprecated in traitlets",
+    "ignore:.*use @validate decorator instead",
+    "ignore:.*has adopted the new \\(traitlets 4.1\\) @observe\\(change\\) API",
+    "ignore:.*will be removed in Jinja 3.1.:DeprecationWarning",
+    "ignore: the imp module is deprecated in favour of importlib",
+    "ignore:IPython.core.inputsplitter is deprecated since IPython 7 in favor of `IPython.core.inputtransformer2`:DeprecationWarning",
+    "ignore:pyee.EventEmitter is deprecated and will be removed in a future major version", # you should instead use either pyee.AsyncIOEventEmitter, pyee.TwistedEventEmitter, pyee.ExecutorEventEmitter, pyee.TrioEventEmitter, or pyee.BaseEventEmitter.:DeprecationWarning
+    "ignore:Your element with mimetype.*",
+]
+markers = [
+    "network: marks tests which require network connection (nbconvert)",
+    "integration_tests: notebook mark (notebook)",
+]
diff --git a/setup.py b/setup.py
deleted file mode 100644
index ac033e6..0000000
--- a/setup.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) IPython Development Team.
-# Distributed under the terms of the Modified BSD License.
-
-import os
-from glob import glob
-
-from setuptools import setup  # type:ignore[import]
-
-# the name of the project
-name = "traitlets"
-
-pjoin = os.path.join
-here = os.path.abspath(os.path.dirname(__file__))
-pkg_root = pjoin(here, name)
-
-packages = []
-for d, _, _ in os.walk(pjoin(here, name)):
-    if os.path.exists(pjoin(d, "__init__.py")):
-        packages.append(d[len(here) + 1 :].replace(os.path.sep, "."))
-
-version_ns = {}  # type:ignore
-with open(pjoin(here, name, "_version.py")) as f:
-    exec(f.read(), {}, version_ns)
-
-
-with open(os.path.join(here, "README.md")) as f:
-    long_description = f.read()
-
-setup_args = dict(
-    name=name,
-    version=version_ns["__version__"],
-    scripts=glob(pjoin("scripts", "*")),
-    packages=packages,
-    include_package_data=True,
-    description="Traitlets Python configuration system",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    author="IPython Development Team",
-    author_email="ipython-dev@python.org",
-    url="https://github.com/ipython/traitlets",
-    project_urls={
-        "Documentation": "https://traitlets.readthedocs.io/",
-        "Funding": "https://numfocus.org/",
-        "Source": "https://github.com/ipython/traitlets",
-        "Tracker": "https://github.com/ipython/traitlets/issues",
-    },
-    license="BSD",
-    platforms="Linux, Mac OS X, Windows",
-    keywords=["Interactive", "Interpreter", "Shell", "Web"],
-    python_requires=">=3.7",
-    classifiers=[
-        "Intended Audience :: Developers",
-        "Intended Audience :: System Administrators",
-        "Intended Audience :: Science/Research",
-        "License :: OSI Approved :: BSD License",
-        "Programming Language :: Python",
-        "Programming Language :: Python :: 3",
-    ],
-    extras_require={
-        "test": ["pytest", "pre-commit"],
-    },
-)
-
-if __name__ == "__main__":
-    setup(**setup_args)
diff --git a/traitlets/__init__.py b/traitlets/__init__.py
index 359bd88..a3ea9f0 100644
--- a/traitlets/__init__.py
+++ b/traitlets/__init__.py
@@ -1,3 +1,4 @@
+"""Traitlets Python configuration system"""
 from warnings import warn
 
 from . import traitlets


Test patch:
diff --git a/pytest.ini b/pytest.ini
deleted file mode 100644
index 4ad1fe0..0000000
--- a/pytest.ini
+++ /dev/null
@@ -1,29 +0,0 @@
-[pytest]
-addopts = --durations=10 -ra --showlocals --doctest-modules --color yes
-testpaths =
-    traitlets
-    examples
-
-filterwarnings=
-   ignore
-   ignore:Passing unrecognized arguments
-   ignore:Keyword .* is deprecated
-   ignore:Supporting extra quotes around
-   ignore:DeprecatedApp._config_changed is deprecated in traitlets
-   ignore:A parent of DeprecatedApp._config_changed has adopted
-   ignore:KeyValueConfigLoader is deprecated since Traitlets
-   ignore:Traits should be given as instances
-   ignore:Explicit using of Undefined as
-   ignore:on_trait_change is deprecated
-   ignore:.*use @observe and @unobserve instead
-   ignore:.*for no default is deprecated in traitlets
-   ignore:.*use @validate decorator instead
-   ignore:.*has adopted the new \(traitlets 4.1\) @observe\(change\) API
-   ignore:.*will be removed in Jinja 3.1.:DeprecationWarning
-   ignore: the imp module is deprecated in favour of importlib
-   ignore:IPython.core.inputsplitter is deprecated since IPython 7 in favor of `IPython.core.inputtransformer2`:DeprecationWarning
-   ignore:pyee.EventEmitter is deprecated and will be removed in a future major version; you should instead use either pyee.AsyncIOEventEmitter, pyee.TwistedEventEmitter, pyee.ExecutorEventEmitter, pyee.TrioEventEmitter, or pyee.BaseEventEmitter.:DeprecationWarning
-   ignore:Your element with mimetype.*
-markers =
-    network: marks tests which require network connection (nbconvert)
-    integration_tests: notebook mark (notebook)