Skip to content
Snippets Groups Projects
Commit da343ab1 authored by Samuel Burbulla's avatar Samuel Burbulla Committed by Andreas Dedner
Browse files

Make the consistency check a little more relax.

Add relative CMAKE_INSTALL_RPATH.

added CMAKE_BUILD_PATH to the rpath of python modules as well

added missing package include

add CMAKE_INSTALL_RPATH_USE_LINK_PATH to setup.py cmake flags to avoid
issue with missing rpath entries for CMAKE_PREFIX_PATH

Do not add suggestions any more.
parent 3c6d0dee
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@ install(PROGRAMS
duneproject
dunecontrol
dunepackaging.py
duneactivate
dune-git-whitespace-hook
rmgenerated.py
setup-dunepy.py
......
envpath=`dirname "${BASH_SOURCE[0]}"`
source $envpath/activate
_OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
LD_LIBRARY_PATH="$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
save_function() {
local ORIG_FUNC=$(declare -f $1)
local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
eval "$NEWNAME_FUNC"
}
save_function deactivate old_deactivate
deactivate () {
if [ -n "${_OLD_LD_LIBRARY_PATH:-}" ] ; then
LD_LIBRARY_PATH="${_OLD_LD_LIBRARY_PATH:-}"
export LD_LIBRARY_PATH
unset _OLD_LD_LIBRARY_PATH
fi
old_deactivate
unset -f old_deactivate
}
......@@ -94,7 +94,6 @@ def main(argv):
f = open("pyproject.toml", "w")
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja", "requests"]
requires += data.asPythonRequirementString(data.depends)
requires += data.asPythonRequirementString(data.python_suggests)
f.write("[build-system]\n")
f.write("requires = "+requires.__str__()+"\n")
f.write("build-backend = 'setuptools.build_meta'\n")
......
......@@ -32,6 +32,8 @@ def cppType(arg):
t, i = "pybind11::array", ["dune/python/pybind11/numpy.h"]
else:
t, i = "pybind11::array_t<"+dtype+">", ["dune/python/pybind11/numpy.h"]
elif isinstance(arg, str):
t, i = "std::string", ["string"]
elif callable(arg):
t, i = "pybind11::function", ["dune/python/pybind11/pybind11.h"]
elif isinstance(arg,tuple) or isinstance(arg,list):
......
......@@ -2,6 +2,7 @@
from setuptools import find_packages
import sys, os, io, getopt, re, ast
import shlex
import importlib, subprocess
import email.utils
import pkg_resources
......@@ -228,14 +229,6 @@ class Data:
self.depends = [(dep[0], '(<= '+self.version+')') for dep in self.depends]
self.suggests = [(dep[0], '(<= '+self.version+')') for dep in self.suggests]
# add suggestions if they have a pypi entry
self.python_suggests = []
for r in self.suggests:
import requests
response = requests.get("https://pypi.org/pypi/{}/json".format(r[0]))
if response.status_code == 200:
self.python_suggests += [r]
def asPythonRequirementString(self, requirements):
return [(r[0]+str(r[1])).replace("("," ").replace(")","").replace(" ","") for r in requirements]
......@@ -246,6 +239,8 @@ def cmakeFlags():
('BUILD_SHARED_LIBS','TRUE'),
('DUNE_ENABLE_PYTHONBINDINGS','TRUE'),
('DUNE_PYTHON_INSTALL_LOCATION','none'),
('CMAKE_INSTALL_RPATH_USE_LINK_PATH','TRUE'),
('CMAKE_INSTALL_RPATH',"'$ORIGIN/../../../..'"),
('ALLOW_CXXFLAGS_OVERWRITE','ON'),
('CMAKE_DISABLE_FIND_PACKAGE_LATEX','TRUE'),
('CMAKE_DISABLE_FIND_PACKAGE_Doxygen','TRUE'),
......@@ -275,7 +270,6 @@ def metaData(version=None, dependencyCheck=True):
flags = cmakeFlags()
cmake_flags = ['-D' + key + '=' + value + '' for key, value in flags.items() if value]
cmake_flags += [key + '' for key, value in flags.items() if not value]
print("CMAKEFLAGS",cmake_flags)
# check if all dependencies are listed in pyproject.toml
if dependencyCheck:
......@@ -288,16 +282,16 @@ def metaData(version=None, dependencyCheck=True):
modules = [x for x in modules
if x not in ["setuptools", "wheel", "scikit-build", "cmake", "ninja", "requests"]
]
for dep in data.asPythonRequirementString(data.depends):
if dep not in modules:
for dep in data.depends:
if not any([mod.startswith(dep[0]) for mod in modules]):
raise RuntimeError("""
pyproject.toml file does not contain all required dune projects defined in the
dune.module file: """ + dep)
dune.module file: """ + dep[0])
except IOError:
pass
install_requires = data.asPythonRequirementString(data.python_requires + data.depends + data.python_suggests)
install_requires = data.asPythonRequirementString(data.python_requires + data.depends)
with open("README.md", "r") as fh:
long_description = fh.read()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment