Skip to content

Commit bea519c

Browse files
committed
TST: extend local lib test to verify Windows support
1 parent 900b5cf commit bea519c

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
import sys
3+
4+
5+
_path = os.path.join(os.path.dirname(__file__), '..', '.example.meson-libs')
6+
if os.name == 'nt':
7+
os.add_dll_directory(_path)
8+
elif sys.platform == 'cygwin':
9+
os.environ['PATH'] = os.pathsep.join((os.environ['PATH'], _path))
10+
del _path
11+
12+
13+
from ._example import example_sum # noqa: E402
14+
15+
16+
__all__ = ['example_sum']

tests/packages/link-against-local-lib/meson.build

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ project('link-against-local-lib', 'c', version: '1.0.0')
66

77
subdir('lib')
88

9-
py = import('python').find_installation()
9+
py = import('python').find_installation(pure: false)
10+
11+
py.install_sources(
12+
'__init__.py',
13+
subdir: 'example',
14+
)
1015

1116
py.extension_module(
12-
'example',
17+
'_example',
1318
'examplemod.c',
1419
link_with: example_lib,
1520
link_args: ['-Wl,-rpath,custom-rpath'],
1621
install: true,
22+
subdir: 'example',
1723
)

tests/packages/link-against-local-lib/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
[build-system]
66
build-backend = 'mesonpy'
77
requires = ['meson-python']
8+
9+
[tool.meson-python]
10+
allow-windows-internal-shared-libs = true

tests/test_wheel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def test_contents(package_library, wheel_library):
172172
}
173173

174174

175-
@pytest.mark.skipif(sys.platform not in {'linux', 'darwin', 'sunos5'}, reason='Not supported on this platform')
176175
def test_local_lib(venv, wheel_link_against_local_lib):
177176
venv.pip('install', wheel_link_against_local_lib)
178177
output = venv.python('-c', 'import example; print(example.example_sum(1, 2))')

0 commit comments

Comments
 (0)