Skip to content

Commit

Permalink
mesonpy: the patchelf dependency is Posix only
Browse files Browse the repository at this point in the history
Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Mar 23, 2022
1 parent 922d090 commit 2cee9eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def get_requires_for_build_wheel(
) -> List[str]:
dependencies = [_depstr.wheel, _depstr.ninja]
with _project(config_settings) as project:
if not project.is_pure:
if not project.is_pure and os.name == 'posix':
dependencies.append(_depstr.patchelf_wrapper)
if project.pep621:
dependencies.append(_depstr.pep621)
Expand Down
12 changes: 10 additions & 2 deletions tests/test_pep517.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# SPDX-License-Identifier: EUPL-1.2

import os

import pytest

import mesonpy

from .conftest import cd_package


if os.name == 'posix':
VENDORING_DEPS = {mesonpy._depstr.patchelf_wrapper}
else:
VENDORING_DEPS = set()


@pytest.mark.parametrize(
('package', 'expected'),
[
Expand All @@ -24,8 +32,8 @@ def test_get_requires_for_build_sdist(package, expected):
[
('pure', set()), # pure and no PEP 621
('full-metadata', {mesonpy._depstr.pep621}), # pure and PEP 621
('library', {mesonpy._depstr.patchelf_wrapper}), # not pure and not PEP 621
('library-pep621', {mesonpy._depstr.patchelf_wrapper, mesonpy._depstr.pep621}), # not pure and PEP 621
('library', VENDORING_DEPS), # not pure and not PEP 621
('library-pep621', {mesonpy._depstr.pep621, *VENDORING_DEPS}), # not pure and PEP 621
]
)
def test_get_requires_for_build_wheel(package, expected):
Expand Down

0 comments on commit 2cee9eb

Please sign in to comment.