Skip to content

Commit

Permalink
Merge pull request #2582 from pypa/feature/2550-build-from-source
Browse files Browse the repository at this point in the history
Rely on backend build path and bootstrap metadata to easily build from source
  • Loading branch information
jaraco committed Feb 28, 2021
2 parents 0c63d16 + ce7632f commit 341972d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ include launcher.c
include msvc-build-launcher.cmd
include pytest.ini
include tox.ini
exclude pyproject.toml # Temporary workaround for #1644.
2 changes: 2 additions & 0 deletions bootstrap.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Name: setuptools-bootstrap
Version: 1.0
14 changes: 14 additions & 0 deletions bootstrap.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[distutils.commands]
egg_info = setuptools.command.egg_info:egg_info

[distutils.setup_keywords]
include_package_data = setuptools.dist:assert_bool
install_requires = setuptools.dist:check_requirements
extras_require = setuptools.dist:check_extras
entry_points = setuptools.dist:check_entry_points

[egg_info.writers]
PKG-INFO = setuptools.command.egg_info:write_pkg_info
dependency_links.txt = setuptools.command.egg_info:overwrite_arg
entry_points.txt = setuptools.command.egg_info:write_entries
requires.txt = setuptools.command.egg_info:write_requirements
1 change: 1 addition & 0 deletions changelog.d/2582.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Simplified build-from-source story by providing bootstrapping metadata in a separate egg-info directory. Build requirements no longer include setuptools itself. Sdist once again includes the pyproject.toml. Project can no longer be installed from source on pip 19.x, but install from source is still supported on pip < 19 and pip >= 20 and install from wheel is still supported with pip >= 9.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[build-system]
requires = [
"setuptools >= 40.8",
"wheel",
]
build-backend = "setuptools.build_meta"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exclude =
testing =
# upstream
pytest >= 3.5, !=3.7.3
pytest-checkdocs >= 1.2.3
pytest-checkdocs >= 2.4
pytest-flake8
pytest-black >= 0.3.7; python_implementation != "PyPy"
pytest-cov
Expand Down
22 changes: 16 additions & 6 deletions setuptools/tests/test_virtualenv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import glob
import os
import sys
import itertools

import pathlib

Expand Down Expand Up @@ -65,20 +66,29 @@ def _get_pip_versions():
# No network, disable most of these tests
network = False

def mark(param, *marks):
if not isinstance(param, type(pytest.param(''))):
param = pytest.param(param)
return param._replace(marks=param.marks + marks)

def skip_network(param):
return param if network else mark(param, pytest.mark.skip(reason="no network"))

network_versions = [
'pip==9.0.3',
'pip==10.0.1',
'pip==18.1',
'pip==19.0.1',
mark('pip==19.3.1', pytest.mark.xfail(reason='pypa/pip#6599')),
'pip==20.0.2',
'https://github.com/pypa/pip/archive/master.zip',
]

versions = [None] + [
pytest.param(v, **({} if network else {'marks': pytest.mark.skip}))
for v in network_versions
]
versions = itertools.chain(
[None],
map(skip_network, network_versions)
)

return versions
return list(versions)


@pytest.mark.parametrize('pip_version', _get_pip_versions())
Expand Down

0 comments on commit 341972d

Please sign in to comment.