Skip to content

Commit 313441c

Browse files
authored
Merge pull request #247 from precice/python-bindings-v3.3.1
Release v3.3.1
2 parents 6c6f9b6 + 62bb670 commit 313441c

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 3.3.1
6+
7+
* Remove root user option from the usage of the preCICE image in the release workflow https://github.com/precice/python-bindings/commit/0a9ccd449e875f0165bebc968b3a23d6d9094b0d
8+
* Fix release workflow by using the correct image in the container https://github.com/precice/python-bindings/commit/63c594678490718474b33f225b05cc5f19f8b569
9+
* Run the upload package creation workflow on the latest preCICE release image https://github.com/precice/python-bindings/commit/9c3ad2e832ac1c1e5c03a189788eead00f97744b
10+
511
## 3.3.0
612

713
* Renaming and using a newer workflow for publishing according to the trusted publishing in PyPI https://github.com/precice/python-bindings/pull/241

setup.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pathlib
21
from setuptools import setup
32
from Cython.Distutils.extension import Extension
43
from Cython.Build import cythonize
@@ -9,32 +8,35 @@
98
MOCKED_ENV = "PYPRECICE_MOCKED"
109

1110

12-
def get_extensions():
11+
def find_precice():
1312
if not pkgconfig.exists("libprecice"):
14-
raise Exception(
15-
"\n".join(
16-
[
17-
"pkg-config was unable to find libprecice.",
18-
"Please make sure that preCICE was installed correctly and pkg-config is able to find it.",
19-
"You may need to set PKG_CONFIG_PATH to include the location of the libprecice.pc file.",
20-
'Use "pkg-config --modversion libprecice" for debugging.',
21-
]
22-
)
13+
print(
14+
"pkg-config was unable to find libprecice.\n"
15+
"Please make sure that preCICE was installed correctly and pkg-config is able to find it.\n"
16+
"You may need to set PKG_CONFIG_PATH to include the location of the libprecice.pc file.\n"
17+
'Use "pkg-config --modversion libprecice" for debugging.'
2318
)
19+
return [], ["-lprecice"]
20+
21+
version = pkgconfig.modversion("libprecice")
22+
print(f"Found preCICE version {version}")
23+
return pkgconfig.cflags("libprecice").split(), pkgconfig.libs("libprecice").split()
2424

25-
print("Found preCICE version " + pkgconfig.modversion("libprecice"))
25+
26+
def get_extensions():
27+
cflags, ldflags = find_precice()
2628

2729
compile_args = ["-std=c++17"]
2830
link_args = []
2931
include_dirs = [numpy.get_include()]
3032
bindings_sources = ["cyprecice/cyprecice.pyx"]
31-
compile_args += pkgconfig.cflags("libprecice").split()
33+
compile_args += cflags
3234

3335
if os.environ.get(MOCKED_ENV) is not None:
3436
print(f"Building mocked pyprecice as {MOCKED_ENV} is set")
3537
bindings_sources.append("test/Participant.cpp")
3638
else:
37-
link_args += pkgconfig.libs("libprecice").split()
39+
link_args += ldflags
3840

3941
return [
4042
Extension(

0 commit comments

Comments
 (0)