Skip to content

Commit

Permalink
infra: switch to flit
Browse files Browse the repository at this point in the history
  • Loading branch information
layday committed Oct 28, 2022
1 parent 7b002bb commit 449235d
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 22 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
==================

Expand Down
78 changes: 75 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
14 changes: 1 addition & 13 deletions tests/test_self_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -47,7 +36,6 @@
'dist-info/RECORD',
'dist-info/WHEEL',
'dist-info/entry_points.txt',
'dist-info/top_level.txt',
}


Expand All @@ -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

Expand Down

0 comments on commit 449235d

Please sign in to comment.