Skip to content

Commit 38cb960

Browse files
kulikjaktakluyver
authored andcommitted
add test for find_distributions
1 parent 7f1a2b5 commit 38cb960

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Name: _pkg
2+
Version: 0.0.1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from importlib.metadata import distribution
2+
3+
4+
def get_requires_for_build_sdist(config_settings):
5+
dist = distribution("setuptools") # not present in backend-path
6+
return [dist.version]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
build-backend = 'intree_backend'
3+
backend-path = ['backend']

tests/samples/pkg_intree_metadata/backend/_test_boostrap-0.0.1.dist-info/METADATA renamed to tests/samples/pkg_intree_metadata/backend/_test_bootstrap-0.0.1.dist-info/METADATA

File renamed without changes.

tests/samples/pkg_intree_metadata/backend/_test_boostrap-0.0.1.dist-info/entry_points.txt renamed to tests/samples/pkg_intree_metadata/backend/_test_bootstrap-0.0.1.dist-info/entry_points.txt

File renamed without changes.

tests/test_inplace_hooks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ def test_intree_backend_importlib_metadata_interoperation():
100100
]
101101

102102

103+
def test_distribution_mismatch():
104+
pytest.importorskip("importlib.metadata")
105+
106+
hooks = get_hooks("distribution_mismatch")
107+
assert hooks.get_requires_for_build_sdist({}) != ["0.0.1"]
108+
109+
103110
def install_finder_with_sitecustomize(directory, mapping):
104111
finder = f"""
105112
import sys

0 commit comments

Comments
 (0)