Merge pull request #3491 from akva2/backport_PR_3490

Backport #3490: changed: build python wheels using skbuild
This commit is contained in:
Arne Morten Kvarving 2023-04-27 13:31:01 +02:00 committed by GitHub
commit 0f25bb7386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 5 deletions

5
python/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
project(install_python_binding)
cmake_minimum_required(VERSION 3.15)
install(CODE "message(\"Dummy install\")")

View File

@ -25,7 +25,7 @@ do
rm -rf $tag
fi
mkdir $tag && pushd $tag
cmake3 -DPYTHON_EXECUTABLE=${python_versions[$tag]} -DBOOST_INCLUDEDIR=/usr/include/boost169 -DBOOST_LIBRARYDIR=/usr/lib64/boost169 -DWITH_NATIVE=0 \
cmake -DPYTHON_EXECUTABLE=${python_versions[$tag]} -DBOOST_INCLUDEDIR=/usr/include/boost169 -DBOOST_LIBRARYDIR=/usr/lib64/boost169 -DWITH_NATIVE=0 \
-DOPM_ENABLE_PYTHON=ON -DOPM_PYTHON_PACKAGE_VERSION_TAG=${VERSION_TAG} ..
# make step is necessary until the generated ParserKeywords/*.hpp are generated in the Python step

7
python/pyproject.toml Normal file
View File

@ -0,0 +1,7 @@
[build-system]
requires= [
"setuptools>=42",
"scikit-build>=0.13",
"cmake>=3.15",
"ninja"
]

View File

@ -8,11 +8,11 @@
yum-config-manager --add-repo \
https://www.opm-project.org/package/opm.repo
yum install -y cmake3 ccache boost169-devel boost169-static tbb-devel
yum install -y ccache boost169-devel boost169-static tbb-devel
yum install -y blas-devel suitesparse-devel dune-common-devel
for python_bin in ${python_versions[*]}
do
${python_bin} -m pip install pip --upgrade
${python_bin} -m pip install wheel setuptools twine pytest-runner auditwheel
${python_bin} -m pip install wheel setuptools twine pytest-runner auditwheel scikit-build cmake
done

View File

@ -1,4 +1,4 @@
from setuptools import setup
from skbuild import setup
import os
@ -32,7 +32,6 @@ setup(
package_data={'opm' : ['$<TARGET_FILE_NAME:opmcommon_python>']},
include_package_data=True,
license='Open Source',
zip_safe=False,
test_suite='tests',
setup_requires=["pytest-runner", 'setuptools_scm'],
python_requires='>=3.6',