Skip to content

Commit

Permalink
build: clarify that dependencies are build dependencies
Browse files Browse the repository at this point in the history
PR #514
  • Loading branch information
abitrolly committed Sep 28, 2022
1 parent ceb1e06 commit a355f19
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/build/__init__.py
Expand Up @@ -373,7 +373,7 @@ def get_requires_for_build(self, distribution: str, config_settings: Optional[Co
(``sdist`` or ``wheel``)
:param config_settings: Config settings for the build backend
"""
self.log(f'Getting dependencies for {distribution}...')
self.log(f'Getting build dependencies for {distribution}...')
hook_name = f'get_requires_for_build_{distribution}'
get_requires = getattr(self._hook, hook_name)

Expand Down
22 changes: 13 additions & 9 deletions tests/test_main.py
Expand Up @@ -226,12 +226,12 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
[
'* Creating venv isolated environment...',
'* Installing packages in isolated environment... (setuptools >= 42.0.0, wheel >= 0.36.0)',
'* Getting dependencies for sdist...',
'* Getting build dependencies for sdist...',
'* Building sdist...',
'* Building wheel from sdist',
'* Creating venv isolated environment...',
'* Installing packages in isolated environment... (setuptools >= 42.0.0, wheel >= 0.36.0)',
'* Getting dependencies for wheel...',
'* Getting build dependencies for wheel...',
'* Installing packages in isolated environment... (wheel)',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
Expand All @@ -240,10 +240,10 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
(
['--no-isolation'],
[
'* Getting dependencies for sdist...',
'* Getting build dependencies for sdist...',
'* Building sdist...',
'* Building wheel from sdist',
'* Getting dependencies for wheel...',
'* Getting build dependencies for wheel...',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
],
Expand All @@ -253,7 +253,7 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
[
'* Creating venv isolated environment...',
'* Installing packages in isolated environment... (setuptools >= 42.0.0, wheel >= 0.36.0)',
'* Getting dependencies for wheel...',
'* Getting build dependencies for wheel...',
'* Installing packages in isolated environment... (wheel)',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0-py2.py3-none-any.whl',
Expand All @@ -262,21 +262,25 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
(
['--wheel', '--no-isolation'],
[
'* Getting dependencies for wheel...',
'* Getting build dependencies for wheel...',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0-py2.py3-none-any.whl',
],
),
(
['--sdist', '--no-isolation'],
['* Getting dependencies for sdist...', '* Building sdist...', 'Successfully built test_setuptools-1.0.0.tar.gz'],
[
'* Getting build dependencies for sdist...',
'* Building sdist...',
'Successfully built test_setuptools-1.0.0.tar.gz',
],
),
(
['--sdist', '--wheel', '--no-isolation'],
[
'* Getting dependencies for sdist...',
'* Getting build dependencies for sdist...',
'* Building sdist...',
'* Getting dependencies for wheel...',
'* Getting build dependencies for wheel...',
'* Building wheel...',
'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_projectbuilder.py
Expand Up @@ -601,8 +601,8 @@ def test_log(mocker, caplog, package_test_flit):
builder.log('something')

assert [(record.levelname, record.message) for record in caplog.records] == [
('INFO', 'Getting dependencies for sdist...'),
('INFO', 'Getting dependencies for wheel...'),
('INFO', 'Getting build dependencies for sdist...'),
('INFO', 'Getting build dependencies for wheel...'),
('INFO', 'Getting metadata for wheel...'),
('INFO', 'Building sdist...'),
('INFO', 'Building wheel...'),
Expand Down

0 comments on commit a355f19

Please sign in to comment.