Skip to content

Commit 1d1a759

Browse files
dnicolodirgommers
authored andcommitted
MAINT: pass limited_api to the wheel builder contruscor
Remove one more instance of the wheel builder accessing the project.
1 parent dc5300c commit 1d1a759

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

mesonpy/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,14 @@ def __init__(
283283
source_dir: pathlib.Path,
284284
build_dir: pathlib.Path,
285285
manifest: Dict[str, List[Tuple[pathlib.Path, str]]],
286+
limited_api: bool,
286287
) -> None:
287288
self._project = project
288289
self._metadata = metadata
289290
self._source_dir = source_dir
290291
self._build_dir = build_dir
291292
self._manifest = manifest
293+
self._limited_api = limited_api
292294

293295
@property
294296
def _has_internal_libs(self) -> bool:
@@ -385,7 +387,7 @@ def entrypoints_txt(self) -> bytes:
385387

386388
@cached_property
387389
def _stable_abi(self) -> Optional[str]:
388-
if self._project._limited_api:
390+
if self._limited_api:
389391
# Verify stabe ABI compatibility: examine files installed
390392
# in {platlib} that look like extension modules, and raise
391393
# an exception if any of them has a Python version
@@ -758,6 +760,7 @@ def _wheel_builder(self) -> _WheelBuilder:
758760
self._source_dir,
759761
self._build_dir,
760762
self._manifest,
763+
self._limited_api,
761764
)
762765

763766
@property

tests/test_tags.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ def test_python_host_platform(monkeypatch):
6565
def wheel_builder_test_factory(monkeypatch, content, pure=True, limited_api=False):
6666
files = defaultdict(list)
6767
files.update({key: [(pathlib.Path(x), os.path.join('build', x)) for x in value] for key, value in content.items()})
68-
class Project:
69-
_limited_api = limited_api
70-
return mesonpy._WheelBuilder(Project(), None, pathlib.Path(), pathlib.Path(), files)
68+
return mesonpy._WheelBuilder(None, None, pathlib.Path(), pathlib.Path(), files, limited_api)
7169

7270

7371
def test_tag_empty_wheel(monkeypatch):

0 commit comments

Comments
 (0)