Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added protocol plugins - continuation of #958 #959

Merged
merged 92 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
e43afcd
Updated installation of Python packages
jesper-friis Sep 3, 2024
755fa86
Merge branch 'master' into python-package
jesper-friis Sep 3, 2024
7524f2f
Generalised cmake statements by using generator expression
jesper-friis Sep 4, 2024
fc73705
Merge branch 'master' into python-package
jesper-friis Sep 4, 2024
ce3d247
Merge branch 'master' into python-package
jesper-friis Sep 5, 2024
56f2d3a
Added two more tests
jesper-friis Sep 5, 2024
574dcfa
Merge branch 'master' into python-package
jesper-friis Sep 6, 2024
26a0ca2
Merge branch 'master' of github.com:SINTEF/dlite
jesper-friis Sep 8, 2024
ad17645
Made urlencode accessible from Python
jesper-friis Sep 12, 2024
52e77fc
Windows doesn't cope with automatic allocated variables
jesper-friis Sep 12, 2024
13d69b4
Try to force utf-8 encoding on Windows
jesper-friis Sep 12, 2024
b8226bc
Ignore test of non-ascii characters on windows
jesper-friis Sep 12, 2024
1796706
Improve testing of uriencode()/uridecode()
jesper-friis Sep 12, 2024
8f0db75
Fixed some issues the Options class
jesper-friis Sep 12, 2024
1721dba
Merge branch 'master' into python-package
jesper-friis Sep 27, 2024
d95889d
Initial work on Python protocol plugins
jesper-friis Oct 1, 2024
432c47b
Added sftp save() and delete() methods
jesper-friis Oct 1, 2024
f3a05eb
Updated C implementation of protocol paths
jesper-friis Oct 4, 2024
3ee4ba6
work in progress...
jesper-friis Oct 4, 2024
badde98
Finalised implementation of protocols
jesper-friis Oct 5, 2024
d088ee3
Merge branch 'master' into protocols
jesper-friis Oct 5, 2024
beadf2c
Merge branch 'master' into protocols
jesper-friis Oct 5, 2024
cc96d2d
Added test for Instance.load()
jesper-friis Oct 5, 2024
4af05e5
Merge branch 'protocols' of github.com:SINTEF/dlite into protocols
jesper-friis Oct 5, 2024
83c38a3
Call load plugins at first thing when instantiating a dlite.Protocol
jesper-friis Oct 5, 2024
ecee45e
Added to tips and tricks
jesper-friis Oct 5, 2024
544678f
Merge branch 'python-package' into protocols2
jesper-friis Oct 5, 2024
a5960de
Updated plugin paths and and fixed tests accordingly
jesper-friis Oct 6, 2024
01ad947
Merge branch 'python-package' into protocols2
jesper-friis Oct 6, 2024
816e80b
Updated installation paths
jesper-friis Oct 6, 2024
39da3fa
Fixed some issues showing up in the tests
jesper-friis Oct 6, 2024
f54e5ef
Ensure that location always is a string, since urlparse on Windows do…
jesper-friis Oct 6, 2024
b24c10c
Commented out test assertment that fails on windows...
jesper-friis Oct 6, 2024
753e527
Added documentation
jesper-friis Oct 6, 2024
b946f05
Merge branch 'master' of github.com:SINTEF/dlite
jesper-friis Oct 6, 2024
6615095
Merge branch 'master' into option_encode
jesper-friis Oct 6, 2024
1248a18
Fixed segfault in Python interface to urlencode() and added
jesper-friis Oct 7, 2024
74f0220
Merge branch 'master' into protocols2
jesper-friis Oct 8, 2024
82c01a0
Merge branch 'master' into option_encode
jesper-friis Oct 8, 2024
a1f15bb
- Updated dlite.options module
jesper-friis Oct 8, 2024
1b098e5
Merge branch 'option_encode' of github.com:SINTEF/dlite into option_e…
jesper-friis Oct 8, 2024
7fc3d44
Corrected two build warnings
jesper-friis Oct 8, 2024
360fd3d
Update doc/user_guide/protocol_plugins.md
jesper-friis Oct 8, 2024
410c695
Update doc/user_guide/protocol_plugins.md
jesper-friis Oct 8, 2024
b7149c6
Added test_options.py
jesper-friis Oct 8, 2024
8667d01
Merge branch 'option_encode' of github.com:SINTEF/dlite into option_e…
jesper-friis Oct 8, 2024
ec3c337
Configure directory tools/ after storages/
jesper-friis Oct 8, 2024
5680a7f
Updated documentation of Instance.from_url()
jesper-friis Oct 8, 2024
6a32aff
Merge branch 'option_encode' into protocols2
jesper-friis Oct 8, 2024
a819283
Update bindings/python/options.py
jesper-friis Oct 9, 2024
8f9e42e
Update bindings/python/options.py
jesper-friis Oct 9, 2024
2909cba
Update bindings/python/options.py
jesper-friis Oct 9, 2024
f19f255
Added more tests and included protocols to Instance.from_url(url) and…
jesper-friis Oct 9, 2024
d4de41e
Updated docstrings based on suggestions from Francesca.
jesper-friis Oct 9, 2024
19ff693
Merge branch 'option_encode' into protocols2
jesper-friis Oct 9, 2024
49be8e5
Ignore tests that fails on Windows due to strange path handling...
jesper-friis Oct 10, 2024
161cac7
Added missing import in test_storage.py
jesper-friis Oct 10, 2024
bb58fa8
Avoid that a windows path is interpreted as an URL
jesper-friis Oct 10, 2024
745314e
Merge branch 'protocols2' of github.com:SINTEF/dlite into protocols2
jesper-friis Oct 10, 2024
e875ebf
Fixed missing backslash
jesper-friis Oct 10, 2024
128a205
Merge branch 'master' into protocols2
jesper-friis Oct 11, 2024
692ad1b
Added comments about non-tested plugins
jesper-friis Oct 11, 2024
9b0c266
Updated installation paths
jesper-friis Oct 11, 2024
9550193
Merge branch 'protocols2' of github.com:SINTEF/dlite into protocols2
jesper-friis Oct 11, 2024
787425a
Commented out unneeded execute_process() in cmake
jesper-friis Oct 11, 2024
a414ebc
Cleaning up and simplifying CMakeLists.txt
jesper-friis Oct 11, 2024
82f491b
Added static library to extra_link_libraries
jesper-friis Oct 11, 2024
4e434e2
Updated comment
jesper-friis Oct 11, 2024
6195321
Add compiler flag -lrt if needed
jesper-friis Oct 11, 2024
d68b9cd
Added Python LDFLAGS
jesper-friis Oct 11, 2024
722fbc3
Added more verbose printing
jesper-friis Oct 11, 2024
7ad62e2
Adding -lrt to extra_link_libraries
jesper-friis Oct 11, 2024
48f4fb0
Reverted additional static linker flags
jesper-friis Oct 11, 2024
74474b1
Improved installation
jesper-friis Oct 12, 2024
f0ef0d1
Updated protocol search path
jesper-friis Oct 12, 2024
414deff
Try to correct python install dirs on Windows
jesper-friis Oct 12, 2024
10510bf
Handle the case that Python site directory equals its prefix
jesper-friis Oct 12, 2024
0f2ac4e
Try to fix MSVS errors and warnings
jesper-friis Oct 13, 2024
2a77eea
Reduce MSVS warnings
jesper-friis Oct 13, 2024
8c25386
Added test_plugin.py
jesper-friis Oct 13, 2024
fe90dd6
yet a test to satisfy windows
jesper-friis Oct 13, 2024
0678dfa
Fixed logical error
jesper-friis Oct 13, 2024
c9f6fe9
Test to add a deliberate path with backslashes
jesper-friis Oct 13, 2024
44a8a64
Try to fix empty library on Windows and non-escaped backslashes in dl…
jesper-friis Oct 13, 2024
f3b4c24
Fix cmake syntax
jesper-friis Oct 13, 2024
02af247
Unset extra_link_libraries if it is empty
jesper-friis Oct 13, 2024
02ec567
Fix warnings on MSVC
jesper-friis Oct 13, 2024
ed1e5dc
Never append anything empty to extra_link_libraries
jesper-friis Oct 13, 2024
aa0b3ec
Get rid of warnings on int comparision tests
jesper-friis Oct 13, 2024
55144ad
Unset extra_link_flags on MSVC
jesper-friis Oct 13, 2024
297e3c8
More MSVC fixes
jesper-friis Oct 13, 2024
08d672b
Update doc/user_guide/storage_plugins.md
jesper-friis Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/docker/gen_dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Arguments:
# SYSTEM: system type. Ex: manylinux, musllinux
# SYSTEM_TYPE: Ex: 2010, 2014, _2_24, 2_28 (manylinux), _1_1, _1_2 (musllinux)
# SYSTEM_TYPE: Ex: 2010, 2014, _2_24, _2_28 (manylinux), _1_1, _1_2 (musllinux)
# ARCH: Ex: x86_64, i686
set -eu

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
name: CI tests

# This CI builds DLite and runs (almost) all tests.
#
# The following plugins are not tested here, since they depends on an external service:
#
# Protocol plugins:
# - sftp
#
# Storage plugins:
# - postgresql
# - mongodb
# - redis
#
# Please remember to update respective plugin docstring if this list changes.
#

on: [push]

jobs:
Expand Down
134 changes: 104 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ if(MSVC)
# Do not complain about strdup() and similar POSIX functions to be
# deprecated in MSVC
add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE")

# Do not complain about standard library functions
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
endif()

# Uncomment the lines below to compile with AddressSanitizer
Expand All @@ -127,13 +130,6 @@ endif()

# Install paths
# -------------
# DLite install paths (CMAKE_INSTALL_PREFIX) is prepended to these
set(DLITE_TEMPLATE_DIRS "share/dlite/templates")
set(DLITE_STORAGE_PLUGIN_DIRS "share/dlite/storage-plugins")
set(DLITE_MAPPING_PLUGIN_DIRS "share/dlite/mapping-plugins")
set(DLITE_PYTHON_MAPPING_PLUGIN_DIRS "share/dlite/python-mapping-plugins")
set(DLITE_PYTHON_STORAGE_PLUGIN_DIRS "share/dlite/python-storage-plugins")
set(DLITE_STORAGES "share/dlite/storages")

# Install path for CMake files
if(WIN32 AND NOT CYGWIN)
Expand All @@ -159,6 +155,7 @@ include(GNUInstallDirs)

# Installation paths
set(DLITE_ROOT ${CMAKE_INSTALL_PREFIX})
set(DLITE_BUILD_ROOT ${dlite_BINARY_DIR})
set(DLITE_INCLUDE_DIRS include/dlite)
set(DLITE_LIBRARY_DIR lib)
set(DLITE_RUNTIME_DIR bin)
Expand All @@ -168,6 +165,7 @@ include(MakePlatformPaths)
make_platform_paths(
PATHS
DLITE_ROOT
DLITE_BUILD_ROOT
DLITE_INCLUDE_DIRS
DLITE_LIBRARY_DIR
DLITE_RUNTIME_DIR
Expand Down Expand Up @@ -231,7 +229,7 @@ if(WITH_PYTHON)
set(Python3_USE_STATIC_LIBS TRUE)
endif()

#
# Find Python version
if(DEFINED ENV{VIRTUAL_ENV})
message(STATUS "Detected virtual environment $ENV{VIRTUAL_ENV}")

Expand Down Expand Up @@ -267,27 +265,83 @@ if(WITH_PYTHON)
endif()
unset(CMAKE_CROSSCOMPILING_EMULATOR)

# Find Python installation directory (relative to CMAKE_INSTALL_PREFIX)
if(NOT Python3_PKGDIR)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])"
OUTPUT_VARIABLE Python3_PKGDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()

execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.prefix)"
OUTPUT_VARIABLE Python3_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
)

file(RELATIVE_PATH Python3_SITE ${Python3_prefix} ${Python3_PKGDIR})
if(Python3_SITE)
set(Python3_PREFIX "${Python3_SITE}/dlite/")
else()
set(Python3_PREFIX "dlite/")
endif()

# Add linker flags for linking against Python
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('PY_LDFLAGS'))"
OUTPUT_VARIABLE Python3_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(Python3_LDFLAGS)
list(APPEND extra_link_libraries ${Python3_LDFLAGS})
endif()

# Find python-config
find_program(
Python3_config
NAMES ${Python3_EXECUTABLE}-config python3-config python-config
HINTS ${Python3_prefix}/bin
)

# Link libraries when compiling against static Python (e.g. manylinux)
if(WITH_STATIC_PYTHON)
execute_process(
COMMAND ${Python3_EXECUTABLE}-config --ldflags
COMMAND ${Python3_config} --ldflags --embed
OUTPUT_VARIABLE Python3_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# TODO: find a more portable way to add the "-Xlinker -export-dynamic" options.
# They are needed to ensure that the linker include all symbols in
# the static Python library.
# Linker flags "-Xlinker -export-dynamic" are needed to ensure that
# the linker include all symbols in the static Python library.
include(CheckLinkerFlag)
check_linker_flag(C "-Xlinker -export-dynamic" HAVE_linker_dynexport)
if(HAVE_linker_dynexport)
list(APPEND Python3_LDFLAGS "-Xlinker" "-export-dynamic")
endif()

set(Python3_STATIC_LIBS
${Python3_LDFLAGS}
-Xlinker -export-dynamic
${Python3_LIBRARY}
)

list(APPEND extra_link_libraries ${Python3_STATIC_LIBS})
if(Python3_STATIC_LIBS)
list(APPEND extra_link_libraries ${Python3_STATIC_LIBS})
endif()
endif()

# Link libraries when compiling against static Python (e.g. cibuildwheel)
# if(DEFINED ENV{Python3_LIBRARY})
# set(Python3_STATIC_LIBS $ENV{Python3_LIBRARY})
# list(APPEND extra_link_libraries $ENV{Python3_LIBRARY})
# endif()
# message(STATUS "ENV{Python3_LIBRARY}: $ENV{Python3_LIBRARY}")


message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Python3_prefix = ${Python3_prefix}")
message(STATUS "Python3_PKGDIR = ${Python3_PKGDIR}")
message(STATUS "Python3_SITE = ${Python3_SITE}")
message(STATUS "Python3_PREFIX = ${Python3_PREFIX}")
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
message(STATUS "Python3_EXECUTABLE = ${Python3_EXECUTABLE}")
message(STATUS "Python3_INCLUDE_DIRS = ${Python3_INCLUDE_DIRS}")
Expand Down Expand Up @@ -324,9 +378,6 @@ else()
set(Python3_LIBRARIES "")
endif()

message(STATUS "extra_link_libraries = ${extra_link_libraries}")


#
# Fortran
# =======
Expand All @@ -341,6 +392,22 @@ if(WITH_FORTRAN)
enable_fortran_compiler_flag_if_supported("-Werror")
endif()

# Unset extra_link_libraries if it is empty
message(STATUS "extra_link_libraries = ${extra_link_libraries}")
if(extra_link_libraries MATCHES "^[ \t\n\r;]*$")
unset(extra_link_libraries)
endif()


# DLite install paths (CMAKE_INSTALL_PREFIX) is prepended to these
set(DLITE_TEMPLATE_DIRS "${Python3_PREFIX}share/dlite/templates")
set(DLITE_STORAGE_PLUGIN_DIRS "${Python3_PREFIX}share/dlite/storage-plugins")
set(DLITE_MAPPING_PLUGIN_DIRS "${Python3_PREFIX}share/dlite/mapping-plugins")
set(DLITE_PYTHON_MAPPING_PLUGIN_DIRS "${Python3_PREFIX}share/dlite/python-mapping-plugins")
set(DLITE_PYTHON_STORAGE_PLUGIN_DIRS "${Python3_PREFIX}share/dlite/python-storage-plugins")
set(DLITE_PYTHON_PROTOCOL_PLUGIN_DIRS "${Python3_PREFIX}share/dlite/python-protocol-plugins")
set(DLITE_STORAGES "${Python3_PREFIX}share/dlite/storages")



# Variables to include in dliteConfig.cmake
Expand All @@ -364,7 +431,8 @@ if(WITH_PYTHON)
Python3_LIBRARIES
DLITE_PYTHON_STORAGE_PLUGIN_DIRS
DLITE_PYTHON_MAPPING_PLUGIN_DIRS
)
DLITE_PYTHON_PROTOCOL_PLUGIN_DIRS
)
endif()


Expand Down Expand Up @@ -611,10 +679,13 @@ list(REMOVE_DUPLICATES dlite_LD_LIBRARY_PATH)
set(dlite_PYTHONPATH
${dlite_BINARY_DIR}/bindings/python
$ENV{PYTHONPATH}
)
)
if(dlite_PYTHONPATH)
list(REMOVE_DUPLICATES dlite_PYTHONPATH)
endif()
if(NOT dlite_PYTHONPATH MATCHES "\\\\")
string(REPLACE "\\" "\\\\" dlite_PYTHONPATH ${dlite_PYTHONPATH})
endif()

# DLITE_STORAGE_PLUGIN_DIRS - search path for DLite storage plugins
set(dlite_STORAGE_PLUGINS "")
Expand All @@ -628,35 +699,35 @@ endif()
if(WITH_PYTHON)
build_append(dlite_STORAGE_PLUGINS ${dlite_BINARY_DIR}/storages/python)
endif()
list(REMOVE_DUPLICATES dlite_STORAGE_PLUGINS)

# DLITE_MAPPING_PLUGIN_DIRS - search path for DLite mapping plugins
set(dlite_MAPPING_PLUGINS "")
list(REMOVE_DUPLICATES dlite_MAPPING_PLUGINS)

# DLITE_PYTHON_STORAGE_PLUGIN_DIRS - search path for Python storage plugins
set(dlite_PYTHON_STORAGE_PLUGINS
${dlite_SOURCE_DIR}/storages/python/python-storage-plugins
)
list(REMOVE_DUPLICATES dlite_PYTHON_STORAGE_PLUGINS)
)

# DLITE_PYTHON_MAPPING_PLUGIN_DIRS - search path for Python mapping plugins
set(dlite_PYTHON_MAPPING_PLUGINS
${dlite_SOURCE_DIR}/bindings/python/python-mapping-plugins
)
list(REMOVE_DUPLICATES dlite_PYTHON_MAPPING_PLUGINS)
)

# DLITE_PYTHON_PROTOCOL_PLUGIN_DIRS - search path for Python protocol plugins
set(dlite_PYTHON_PROTOCOL_PLUGINS
${dlite_SOURCE_DIR}/bindings/python/python-protocol-plugins
)

# DLITE_TEMPLATE_DIRS - search path for DLite templates
set(dlite_TEMPLATES
${dlite_SOURCE_DIR}/tools/templates
)
list(REMOVE_DUPLICATES dlite_TEMPLATES)
)

# DLITE_STORAGES - DLite storages (inc. metadata)
set(dlite_STORAGES
${dlite_SOURCE_DIR}/examples/storages/*.json
)
list(REMOVE_DUPLICATES dlite_STORAGES)
)


#if(UNIX)
# string(REPLACE ";" ":" dlite_PATH "${dlite_PATH}")
Expand All @@ -666,6 +737,7 @@ list(REMOVE_DUPLICATES dlite_STORAGES)
# string(REPLACE ";" ":" dlite_MAPPING_PLUGINS "${dlite_MAPPING_PLUGINS}")
# string(REPLACE ";" ":" dlite_PYTHON_STORAGE_PLUGINS "${dlite_PYTHON_STORAGE_PLUGINS}")
# string(REPLACE ";" ":" dlite_PYTHON_MAPPING_PLUGINS "${dlite_PYTHON_MAPPING_PLUGINS}")
# string(REPLACE ";" ":" dlite_PYTHON_PROTOCOL_PLUGINS "${dlite_PYTHON_PROTOCOL_PLUGINS}")
# string(REPLACE ";" ":" dlite_TEMPLATES "${dlite_TEMPLATES}")
#endif()

Expand All @@ -675,6 +747,7 @@ make_platform_paths(
dlite_PYTHONPATH
dlite_PYTHON_STORAGE_PLUGINS
dlite_PYTHON_MAPPING_PLUGINS
dlite_PYTHON_PROTOCOL_PLUGINS
dlite_TEMPLATES
dlite_STORAGES
MULTI_CONFIG_PATHS
Expand Down Expand Up @@ -727,6 +800,7 @@ set(test_env
"export DLITE_MAPPING_PLUGIN_DIRS=${dlite_MAPPING_PLUGINS}"
"export DLITE_PYTHON_STORAGE_PLUGIN_DIRS=${dlite_PYTHON_STORAGE_PLUGINS}"
"export DLITE_PYTHON_MAPPING_PLUGIN_DIRS=${dlite_PYTHON_MAPPING_PLUGINS}"
"export DLITE_PYTHON_PROTOCOL_PLUGIN_DIRS=${dlite_PYTHON_PROTOCOL_PLUGINS}"
"export DLITE_TEMPLATE_DIRS=${dlite_TEMPLATES}"
"export DLITE_STORAGES='${dlite_STORAGES}'"
""
Expand Down
28 changes: 19 additions & 9 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(py_sources
options.py
utils.py
mappings.py
protocol.py
datamodel.py
rdf.py
dataset.py
Expand Down Expand Up @@ -143,11 +144,11 @@ add_custom_target(python_package ALL DEPENDS ${abs_targets} ${package_targets})
add_custom_command(
OUTPUT
${abs_targets}
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${abs_sources}
${pkgdir}
DEPENDS
${pkgdir}
${abs_sources}
dlite-plugins-json
)
Expand Down Expand Up @@ -186,6 +187,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}/share/dlite/mapping-plugins
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}/share/dlite/python-storage-plugins
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}/share/dlite/python-mapping-plugins
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}/share/dlite/python-protocol-plugins
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}/share/dlite/storages
COMMAND ${CMAKE_COMMAND} -E make_directory ${pkgdir}/share/dlite/bin
COMMAND ${CMAKE_COMMAND} -E copy_if_different
Expand All @@ -210,6 +212,11 @@ add_custom_command(
-DDEST_DIR=${pkgdir}/share/dlite/python-mapping-plugins
-DPATTERN="*.py"
-P ${dlite_SOURCE_DIR}/cmake/CopyDirectory.cmake
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${dlite_SOURCE_DIR}/bindings/python/python-protocol-plugins
-DDEST_DIR=${pkgdir}/share/dlite/python-protocol-plugins
-DPATTERN="*.py"
-P ${dlite_SOURCE_DIR}/cmake/CopyDirectory.cmake
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${dlite_SOURCE_DIR}/storages/python/python-storage-plugins
-DDEST_DIR=${pkgdir}/share/dlite/storages
Expand Down Expand Up @@ -240,21 +247,24 @@ else()
set(pyext_ext ".pyd")
endif()

execute_process(COMMAND
${RUNNER} ${Python3_EXECUTABLE} -c "import site, pathlib; print(pathlib.Path(site.getusersitepackages()).relative_to(site.getuserbase()).as_posix())"
OUTPUT_VARIABLE Python3_MODULE_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dlite
DESTINATION ${Python3_MODULE_PATH}
DESTINATION "${Python3_SITE}"
USE_SOURCE_PERMISSIONS
PATTERN ".gitignore" EXCLUDE
PATTERN "*~" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python-mapping-plugins
DESTINATION share/dlite
DESTINATION ${Python3_PREFIX}share/dlite
USE_SOURCE_PERMISSIONS
PATTERN ".gitignore" EXCLUDE
PATTERN "*~" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python-protocol-plugins
DESTINATION ${Python3_PREFIX}share/dlite
USE_SOURCE_PERMISSIONS
PATTERN ".gitignore" EXCLUDE
PATTERN "*~" EXCLUDE
)
Expand Down
Loading