diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3e6bde6d5..381b43de7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,16 @@ Changelog +++++++++ +Unreleased +========== + +- Change build backend from ``setuptools`` to ``flit`` + (`PR #470`_, Fixes `#394`_) + +.. _PR #470: https://github.com/pypa/build/pull/470 +.. _#394: https://github.com/pypa/build/issues/394 + + 0.9.0 (2022-10-27) ================== diff --git a/pyproject.toml b/pyproject.toml index a4f7f4d74..86f801e32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,79 @@ [build-system] -requires = ["setuptools >=42.0"] -build-backend = "setuptools.build_meta" +requires = ["flit-core >= 3.4"] +build-backend = "flit_core.buildapi" + +[project] +name = "build" +version = "0.9.0" +description = "A simple, correct PEP 517 build frontend" +readme = "README.md" +requires-python = ">= 3.6" +license.file = "LICENSE" +authors = [ + { name = "Filipe Laíns", email = "lains@riseup.net" }, + { name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }, + { name = "layday", email = "layday@protonmail.com" }, + { name = "Henry Schreiner", email = "henryschreineriii@gmail.com" }, +] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "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", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +urls.homepage = "https://github.com/pypa/build" +urls.changelog = "https://pypa-build.readthedocs.io/en/stable/changelog.html" + +dependencies = [ + "packaging >= 19.0", + "pep517 >= 0.9.1", + # not actually a runtime dependency, only supplied as there is not "recommended dependency" support + 'colorama; os_name == "nt"', + 'importlib-metadata >= 0.22; python_version < "3.8"', + # toml can be used instead -- in case it makes bootstrapping easier + 'tomli >= 1.0.0; python_version < "3.11"', +] + +[project.optional-dependencies] +docs = [ + "furo >= 2021.08.31", + "sphinx ~= 4.0", + "sphinx-argparse-cli >= 1.5", + "sphinx-autodoc-typehints >= 1.10", +] +test = [ + "filelock >= 3", + "pytest >= 6.2.4", + "pytest-cov >= 2.12", + "pytest-mock >= 2", + "pytest-rerunfailures >= 9.1", + "pytest-xdist >= 1.34", + "toml >= 0.10.0", + "wheel >= 0.36.0", + 'setuptools >= 42.0.0; python_version < "3.10"', + 'setuptools >= 56.0.0; python_version >= "3.10"', +] +typing = [ + "importlib-metadata >= 4.6.4", + "mypy == 0.942", + "typing-extensions >= 3.7.4.3", +] +virtualenv = [ + "virtualenv >= 20.0.35", +] + +[project.scripts] +pyproject-build = "build.__main__:entrypoint" + +[project.entry-points."pipx.run"] +build = "build.__main__:entrypoint" [tool.coverage.run] source = [ @@ -49,7 +122,6 @@ strict = true show_error_codes = true enable_error_code = ["ignore-without-code", "truthy-bool", "redundant-expr"] - [[tool.mypy.overrides]] module = [ "colorama", # Optional dependency diff --git a/setup.py b/setup.py deleted file mode 100644 index b024da80e..000000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -from setuptools import setup - - -setup() diff --git a/tests/test_integration.py b/tests/test_integration.py index bc2f4fffc..5da35ad34 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -93,8 +93,8 @@ def _ignore_folder(base, filenames): ) @pytest.mark.isolated def test_build(monkeypatch, project, args, call, tmp_path): - if project == 'flit' and '--no-isolation' in args: - pytest.xfail("can't build flit without isolation due to missing dependencies") + if project in {'build', 'flit'} and '--no-isolation' in args: + pytest.xfail(f"can't build {project} without isolation due to missing dependencies") if project == 'Solaar' and IS_WINDOWS and IS_PYPY3: pytest.xfail('Solaar fails building wheels via sdists on Windows on PyPy 3') diff --git a/tests/test_self_packaging.py b/tests/test_self_packaging.py index abe09f85b..617e75a4d 100644 --- a/tests/test_self_packaging.py +++ b/tests/test_self_packaging.py @@ -18,17 +18,6 @@ 'PKG-INFO', 'README.md', 'pyproject.toml', - 'setup.cfg', - 'setup.py', - 'src', - 'src/build', - 'src/build.egg-info', - 'src/build.egg-info/PKG-INFO', - 'src/build.egg-info/SOURCES.txt', - 'src/build.egg-info/dependency_links.txt', - 'src/build.egg-info/entry_points.txt', - 'src/build.egg-info/requires.txt', - 'src/build.egg-info/top_level.txt', 'src/build/__init__.py', 'src/build/__main__.py', 'src/build/env.py', @@ -47,7 +36,6 @@ 'dist-info/RECORD', 'dist-info/WHEEL', 'dist-info/entry_points.txt', - 'dist-info/top_level.txt', } @@ -70,7 +58,7 @@ def test_build_sdist(monkeypatch, tmpdir): (sdist,) = tmpdir.visit('*.tar.gz') with tarfile.open(str(sdist), 'r:gz') as tar: - simpler = {n.split('/', 1)[-1] for n in tar.getnames()[1:]} + simpler = {n.split('/', 1)[-1] for n in tar.getnames()} assert simpler == sdist_files