diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 85e543abd3b6b370428b0ead5b7347d3b762a552..04ab0d0fd6544b37902e922385ebe26f7cb488e9 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -3,7 +3,6 @@ install(PROGRAMS duneproject dunecontrol dunepackaging.py - duneactivate dune-git-whitespace-hook rmgenerated.py setup-dunepy.py diff --git a/bin/duneactivate b/bin/duneactivate deleted file mode 100644 index 0191c172dfcdd118d0a786f5ce74dac786283d2d..0000000000000000000000000000000000000000 --- a/bin/duneactivate +++ /dev/null @@ -1,25 +0,0 @@ -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 -} diff --git a/bin/dunepackaging.py b/bin/dunepackaging.py index 757a39bc4489dd2ff71194d5651d8dab59ef430f..9cb11fb2619f017bd6031dcbcf434705c945c8da 100755 --- a/bin/dunepackaging.py +++ b/bin/dunepackaging.py @@ -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") diff --git a/python/dune/generator/algorithm.py b/python/dune/generator/algorithm.py index 7907c5d0084c18cdc9c4c0aa386b24bc6a57cf48..fb72634de54e17323770c2d798ffe78ea8b7acda 100644 --- a/python/dune/generator/algorithm.py +++ b/python/dune/generator/algorithm.py @@ -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): diff --git a/python/dune/packagemetadata.py b/python/dune/packagemetadata.py index 21ee691ead49c09ddf3868c96aee91e8b485a6d6..3e639a0771be9a69ffb90749fe15446b0eaadd03 100755 --- a/python/dune/packagemetadata.py +++ b/python/dune/packagemetadata.py @@ -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()