Skip to content

Commit

Permalink
Merge pull request #26 from F2I-Consulting/dev
Browse files Browse the repository at this point in the history
v0.3.1.0
  • Loading branch information
philippeVerney authored Jan 16, 2025
2 parents ff3cac4 + 8a2f1d8 commit 0317ffb
Show file tree
Hide file tree
Showing 31 changed files with 1,612 additions and 4,505 deletions.
244 changes: 176 additions & 68 deletions .github/workflows/github-actions.yml

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions .github/workflows/release.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Actions to run when releasing

on:
release:
types: [published]

env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_REF_NAME: ${{ github.ref_name }}

jobs:
# Remark : https://github.com/orgs/community/discussions/46034
add-checksum:
runs-on: ubuntu-latest
steps:
# It is necessary to checkout the repository for GitHub CLI to know which repository to target
- name: Checkout repository
uses: actions/checkout@v4
- name: ZIP checksum
run: |
gh release download --archive=zip
shasum -a 256 *.zip > fetpapi-${GITHUB_REF_NAME#v}.zip.sha256.txt
gh release upload ${{ github.ref_name }} fetpapi-${GITHUB_REF_NAME#v}.zip.sha256.txt
- name: TAR.GZ checksum
run: |
gh release download --archive=tar.gz
shasum -a 256 *.tar.gz > fetpapi-${GITHUB_REF_NAME#v}.tar.gz.sha256.txt
gh release upload ${{ github.ref_name }} fetpapi-${GITHUB_REF_NAME#v}.tar.gz.sha256.txt
38 changes: 19 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if (WIN32)
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.27)
else ()
cmake_minimum_required(VERSION 3.12)
endif (WIN32)
Expand All @@ -16,7 +16,7 @@ set (FETPAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# version mechanism
set (Fetpapi_VERSION_MAJOR 0)
set (Fetpapi_VERSION_MINOR 3)
set (Fetpapi_VERSION_PATCH 0)
set (Fetpapi_VERSION_PATCH 1)
set (Fetpapi_VERSION_TWEAK 0)

set (Fetpapi_VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}.${Fetpapi_VERSION_PATCH}.${Fetpapi_VERSION_TWEAK})
Expand All @@ -25,7 +25,9 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install CACHE PATH "${PROJECT_NAME} install prefix" FORCE)
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(CMAKE_CXX_STANDARD 11)
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
Expand All @@ -51,6 +53,7 @@ target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/bigobj>
$<$<CXX_COMPILER_ID:MSVC>:/MP>
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<CXX_COMPILER_ID:MSVC>:/utf-8> # Necessary for fmt library which AVRO depends on
$<$<CXX_COMPILER_ID:GNU>:-Wall>
$<$<CXX_COMPILER_ID:GNU>:-Wextra>
$<$<CXX_COMPILER_ID:GNU>:-Wcast-qual>
Expand Down Expand Up @@ -108,6 +111,12 @@ endif()
if (WIN32 AND (Boost_VERSION_MAJOR EQUAL 1) AND (Boost_VERSION_MINOR LESS 74) AND (Boost_VERSION_MINOR GREATER 71))
message(WARNING "You may experience min/max issue with this boost version : See https://github.com/boostorg/beast/issues/1980")
endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
if (DEFINED Boost_SYSTEM_LIBRARY)
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::system)
else ()
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::boost)
endif()

# avro DEPENDENCY
find_package(AVRO REQUIRED)
Expand All @@ -122,23 +131,17 @@ if (WITH_FESAPI)
endif (WITH_JAVA_WRAPPING)
endif (WITH_FESAPI)

target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
target_link_libraries (${PROJECT_NAME} PRIVATE AVRO::AVRO ${CMAKE_THREAD_LIBS_INIT})
if (DEFINED Boost_SYSTEM_LIBRARY)
target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_SYSTEM_LIBRARY})
endif()
if (WIN32)
target_link_libraries (${PROJECT_NAME} PRIVATE bcrypt.lib)

set_target_properties(${PROJECT_NAME} PROPERTIES
PDB_NAME ${PROJECT_NAME}.${Fetpapi_VERSION}
PDB_NAME_DEBUG ${PROJECT_NAME}${CMAKE_DEBUG_POSTFIX}.${Fetpapi_VERSION}
LINK_FLAGS "/INCREMENTAL:NO /OPT:REF"
RUNTIME_OUTPUT_DIRECTORY ${FETPAPI_BINARY_DIR}
SUFFIX .${Fetpapi_VERSION}.dll
IMPORT_SUFFIX .${Fetpapi_VERSION}.lib
VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}
)
IMPORT_SUFFIX -${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}.lib
DLL_NAME_WITH_SOVERSION TRUE
VERSION ${Fetpapi_VERSION}
SOVERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR})
else (WIN32)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${Fetpapi_VERSION}
Expand Down Expand Up @@ -210,7 +213,7 @@ endif (WITH_FESAPI)

target_sources(${PROJECT_NAME} PRIVATE ${ALL_SOURCES_AND_HEADERS})

target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR})
if (WITH_ETP_SSL)
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
endif ()
Expand Down Expand Up @@ -339,17 +342,14 @@ if (WITH_PYTHON_WRAPPING)
TARGETS ${PROJECT_NAME}
RUNTIME_DEPENDENCY_SET dep-set
)
cmake_path(GET SSL_EAY_RELEASE PARENT_PATH openSslLibPath)
cmake_path(GET openSslLibPath PARENT_PATH openSslPath)
cmake_path(APPEND openSslPath "bin" OUTPUT_VARIABLE openSslBinPath)
install(
RUNTIME_DEPENDENCY_SET dep-set
PRE_EXCLUDE_REGEXES "api-ms-.*" "ext-ms-.*" "[Ff]esapi[Cc]pp.*\\.dll"
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
DIRECTORIES ${openSslBinPath}
DIRECTORIES ${CMAKE_BINARY_DIR}
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/python/fetpapi/
)
ENDIF (WIN32)
install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/python/setup.py bdist_wheel
install(CODE "execute_process(COMMAND \"${Python3_EXECUTABLE}\" -m build --wheel
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python)")
endif (WITH_PYTHON_WRAPPING)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
- fetpapi (Git clone this repository into this folder "fetpapi". You should then have a path fetpapiEnv/fetpapi/src)
- dependencies
- The following compilers are known to work (used in CI)
- gcc from version 4.8
- gcc from version 8
- visual studio from version 2019
# Prepare the dependencies
Download (build and install if necessary) third party libraries:
- BOOST : All versions from version 1.66 should be ok but you may experience some [min/max build issues](https://github.com/boostorg/beast/issues/1980) using version 1.72 or 1.73.
- AVRO : https://avro.apache.org/releases.html#Download (starting from version 1.9.0 [except 1.11.1](https://issues.apache.org/jira/browse/AVRO-3601), build it with the above boost library.)
- (OPTIONALLY) OpenSSL : version 1.1 is known to work.
- (OPTIONALLY) [FESAPI](https://github.com/F2I-Consulting/fesapi/releases) : All versions from version 2.7.0.0 should be ok.
- (OPTIONALLY) [FESAPI](https://github.com/F2I-Consulting/fesapi/releases) : All versions from version 2.7.0.0 should be ok but a minimal version of 2.11.0.0 is recommended to automatically recognize FESAPI CMake Variables using CMake find Module and build silently the EtpClient example.

# Configure the build
FETPAPI uses cmake as its build tool. A 3.12 version or later of cmake is required https://cmake.org/download/. We also recommend using cmake-gui (already included in the bin folder of the binary releases of cmake) which provides a graphical user interface on top of cmake. If you want to use cmake in command line, you would find example in [Github Actions file](./.github/workflows/github-actions.yml). Follow the below instructions :
Expand Down
10 changes: 3 additions & 7 deletions cmake/modules/FindFESAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@ list(APPEND _FESAPI_SEARCHES _FESAPI_SEARCH_NORMAL)
# The maximum of ranges are defined totally arbitrarily
set(FESAPI_NAMES FesapiCpp)
set(FESAPI_NAMES_DEBUG FesapiCppd)
foreach(minorVer RANGE 7 15)
foreach(patchVer RANGE 0 5)
foreach(tweakVer RANGE 0 5)
list(APPEND FESAPI_NAMES FesapiCpp.2.${minorVer}.${patchVer}.${tweakVer})
list(APPEND FESAPI_NAMES_DEBUG FesapiCppd.2.${minorVer}.${patchVer}.${tweakVer})
endforeach()
endforeach()
foreach(minorVer RANGE 11 99)
list(APPEND FESAPI_NAMES FesapiCpp-2.${minorVer})
list(APPEND FESAPI_NAMES_DEBUG FesapiCppd-2.${minorVer})
endforeach()

# Try each search configuration.
Expand Down
63 changes: 63 additions & 0 deletions cmake/pyproject.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = 'fetpapi'
version = '${Fetpapi_PYTHON_VERSION}'
authors = [
{name = "F2I-CONSULTING"},
]
maintainers = [
{name = "F2I-CONSULTING"},
]
description = "A library for using the Energistics Transfer Protocol"
readme = "README.md"
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Application Frameworks ',
'Topic :: File Formats',
]
keywords = [
"energistics",
"resqml",
"eml",
"witsml",
"prodml",
"osdu",
"rddms",
]
requires-python = ">=3.8"
dependencies = [
'fesapi==2.12.1',
]

[project.urls]
source = "https://github.com/F2I-Consulting/fetpapi/issues"
releasenotes = "https://github.com/F2I-Consulting/fetpapi/releases"
documentation = "https://www.f2i-consulting.com/fetpapi/doxygen/"
issues = "https://github.com/F2I-Consulting/fetpapi/issues"

[tool.setuptools]
packages=['fetpapi']
package-dir={"fetpapi" = "fetpapi"}
ext-modules = [
{name='fetpapi._fetpapi', sources=['swigGeneratedPythonWrapper.cpp'], include-dirs=['${Boost_INCLUDE_DIR}','${AVRO_INCLUDE_DIR}'${FESAPI_INCLUDE_DIR_FOR_SETUP_PY}], library-dirs=['${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}'${AVRO_LIBRARY_DIR_RELEASE}${Boost_LIBRARY_DIR_RELEASE}${FESAPI_LIBRARY_DIR_RELEASE}], libraries=['${ASSEMBLY_NAME}'${AVRO_LIBRARY_RELEASE_WLE}${Boost_LIBRARY_RELEASE_WLE}${FESAPI_LIBRARY_RELEASE_WLE}], ${EXTRA_COMPILE_ARGS}}
]

[tool.setuptools.package-data]
fetpapi = ["*.dll", "*.so", "*.so.*"]
63 changes: 0 additions & 63 deletions cmake/setup_etp.py.in

This file was deleted.

Loading

0 comments on commit 0317ffb

Please sign in to comment.