Skip to content

Commit b3336aa

Browse files
committed
Use python pkgconf to find cysignals in example
1 parent 70276ef commit b3336aa

File tree

6 files changed

+44
-13
lines changed

6 files changed

+44
-13
lines changed

example/meson.build

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,7 @@ project('cysignals_example', 'cython', 'cpp')
22

33
py = import('python').find_installation()
44

5-
inc_cysignals = run_command(
6-
py,
7-
[
8-
'-c',
9-
'''
10-
import cysignals
11-
print(cysignals.__file__.replace('__init__.py', ''))
12-
'''.strip(),
13-
],
14-
check: true,
15-
).stdout().strip()
16-
cysignals = declare_dependency(include_directories: inc_cysignals)
5+
cysignals = dependency('cysignals')
176

187
py.extension_module('cysignals_example',
198
sources: ['cysignals_example.pyx'],

example/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["meson-python", "cython>=0.28"]
2+
requires = ["meson-python", "cython>=0.28", "pkgconf"]
33
build-backend = "mesonpy"
44

55
[project]

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ classifiers = [
3232
urls = { Homepage = "https://github.com/sagemath/cysignals" }
3333
requires-python = ">=3.9,<3.14"
3434

35+
[project.entry-points.pkg_config]
36+
cysignals = 'cysignals'
37+
3538
[tool.pytest.ini_options]
3639
addopts = "--doctest-modules --import-mode importlib"
3740
testpaths = "src tests"
@@ -44,6 +47,7 @@ dev = [
4447
"meson>=1.9.0",
4548
"meson-python>=0.18.0",
4649
"ninja>=1.13.0",
50+
"pkgconf>=2.4.3.post2",
4751
"pytest>=8.4.2",
4852
]
4953

src/cysignals/cysignals.pc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
includedir=${pcfiledir}
2+
3+
Name: cysignals
4+
Description: cysignals library
5+
Version: 1.0.0
6+
Cflags: -I${includedir}

src/cysignals/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ configure_file(output: 'cysignals_config.h', configuration: config, install_dir:
22

33
py.install_sources(
44
'__init__.py',
5+
'cysignals.pc',
56
'cysignals-CSI-helper.py',
67
'memory.pxd',
78
'pysignals.pxd',

uv.lock

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)