Skip to content

Commit 0317ffb

Browse files
Merge pull request #26 from F2I-Consulting/dev
v0.3.1.0
2 parents ff3cac4 + 8a2f1d8 commit 0317ffb

31 files changed

Lines changed: 1612 additions & 4505 deletions

.github/workflows/github-actions.yml

Lines changed: 176 additions & 68 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Actions to run when releasing
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
9+
GITHUB_REF_NAME: ${{ github.ref_name }}
10+
11+
jobs:
12+
# Remark : https://github.com/orgs/community/discussions/46034
13+
add-checksum:
14+
runs-on: ubuntu-latest
15+
steps:
16+
# It is necessary to checkout the repository for GitHub CLI to know which repository to target
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
- name: ZIP checksum
20+
run: |
21+
gh release download --archive=zip
22+
shasum -a 256 *.zip > fetpapi-${GITHUB_REF_NAME#v}.zip.sha256.txt
23+
gh release upload ${{ github.ref_name }} fetpapi-${GITHUB_REF_NAME#v}.zip.sha256.txt
24+
- name: TAR.GZ checksum
25+
run: |
26+
gh release download --archive=tar.gz
27+
shasum -a 256 *.tar.gz > fetpapi-${GITHUB_REF_NAME#v}.tar.gz.sha256.txt
28+
gh release upload ${{ github.ref_name }} fetpapi-${GITHUB_REF_NAME#v}.tar.gz.sha256.txt
29+

CMakeLists.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if (WIN32)
2-
cmake_minimum_required(VERSION 3.21)
2+
cmake_minimum_required(VERSION 3.27)
33
else ()
44
cmake_minimum_required(VERSION 3.12)
55
endif (WIN32)
@@ -16,7 +16,7 @@ set (FETPAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1616
# version mechanism
1717
set (Fetpapi_VERSION_MAJOR 0)
1818
set (Fetpapi_VERSION_MINOR 3)
19-
set (Fetpapi_VERSION_PATCH 0)
19+
set (Fetpapi_VERSION_PATCH 1)
2020
set (Fetpapi_VERSION_TWEAK 0)
2121

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

28-
set(CMAKE_CXX_STANDARD 11)
28+
if (NOT DEFINED CMAKE_CXX_STANDARD)
29+
set(CMAKE_CXX_STANDARD 17)
30+
endif()
2931
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3032
set(CMAKE_CXX_EXTENSIONS OFF)
3133
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
@@ -51,6 +53,7 @@ target_compile_options(${PROJECT_NAME} PRIVATE
5153
$<$<CXX_COMPILER_ID:MSVC>:/bigobj>
5254
$<$<CXX_COMPILER_ID:MSVC>:/MP>
5355
$<$<CXX_COMPILER_ID:MSVC>:/W4>
56+
$<$<CXX_COMPILER_ID:MSVC>:/utf-8> # Necessary for fmt library which AVRO depends on
5457
$<$<CXX_COMPILER_ID:GNU>:-Wall>
5558
$<$<CXX_COMPILER_ID:GNU>:-Wextra>
5659
$<$<CXX_COMPILER_ID:GNU>:-Wcast-qual>
@@ -108,6 +111,12 @@ endif()
108111
if (WIN32 AND (Boost_VERSION_MAJOR EQUAL 1) AND (Boost_VERSION_MINOR LESS 74) AND (Boost_VERSION_MINOR GREATER 71))
109112
message(WARNING "You may experience min/max issue with this boost version : See https://github.com/boostorg/beast/issues/1980")
110113
endif ()
114+
target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
115+
if (DEFINED Boost_SYSTEM_LIBRARY)
116+
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::system)
117+
else ()
118+
target_link_libraries (${PROJECT_NAME} PRIVATE Boost::boost)
119+
endif()
111120

112121
# avro DEPENDENCY
113122
find_package(AVRO REQUIRED)
@@ -122,23 +131,17 @@ if (WITH_FESAPI)
122131
endif (WITH_JAVA_WRAPPING)
123132
endif (WITH_FESAPI)
124133

125-
target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)
126134
target_link_libraries (${PROJECT_NAME} PRIVATE AVRO::AVRO ${CMAKE_THREAD_LIBS_INIT})
127-
if (DEFINED Boost_SYSTEM_LIBRARY)
128-
target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_SYSTEM_LIBRARY})
129-
endif()
130135
if (WIN32)
131136
target_link_libraries (${PROJECT_NAME} PRIVATE bcrypt.lib)
132137

133138
set_target_properties(${PROJECT_NAME} PROPERTIES
134-
PDB_NAME ${PROJECT_NAME}.${Fetpapi_VERSION}
135-
PDB_NAME_DEBUG ${PROJECT_NAME}${CMAKE_DEBUG_POSTFIX}.${Fetpapi_VERSION}
136139
LINK_FLAGS "/INCREMENTAL:NO /OPT:REF"
137140
RUNTIME_OUTPUT_DIRECTORY ${FETPAPI_BINARY_DIR}
138-
SUFFIX .${Fetpapi_VERSION}.dll
139-
IMPORT_SUFFIX .${Fetpapi_VERSION}.lib
140-
VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}
141-
)
141+
IMPORT_SUFFIX -${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}.lib
142+
DLL_NAME_WITH_SOVERSION TRUE
143+
VERSION ${Fetpapi_VERSION}
144+
SOVERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR})
142145
else (WIN32)
143146
set_target_properties(${PROJECT_NAME} PROPERTIES
144147
VERSION ${Fetpapi_VERSION}
@@ -210,7 +213,7 @@ endif (WITH_FESAPI)
210213

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

213-
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
216+
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${AVRO_INCLUDE_DIR})
214217
if (WITH_ETP_SSL)
215218
target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
216219
endif ()
@@ -339,17 +342,14 @@ if (WITH_PYTHON_WRAPPING)
339342
TARGETS ${PROJECT_NAME}
340343
RUNTIME_DEPENDENCY_SET dep-set
341344
)
342-
cmake_path(GET SSL_EAY_RELEASE PARENT_PATH openSslLibPath)
343-
cmake_path(GET openSslLibPath PARENT_PATH openSslPath)
344-
cmake_path(APPEND openSslPath "bin" OUTPUT_VARIABLE openSslBinPath)
345345
install(
346346
RUNTIME_DEPENDENCY_SET dep-set
347347
PRE_EXCLUDE_REGEXES "api-ms-.*" "ext-ms-.*" "[Ff]esapi[Cc]pp.*\\.dll"
348348
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
349-
DIRECTORIES ${openSslBinPath}
349+
DIRECTORIES ${CMAKE_BINARY_DIR}
350350
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/python/fetpapi/
351351
)
352352
ENDIF (WIN32)
353-
install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/python/setup.py bdist_wheel
353+
install(CODE "execute_process(COMMAND \"${Python3_EXECUTABLE}\" -m build --wheel
354354
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python)")
355355
endif (WITH_PYTHON_WRAPPING)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
- fetpapi (Git clone this repository into this folder "fetpapi". You should then have a path fetpapiEnv/fetpapi/src)
77
- dependencies
88
- The following compilers are known to work (used in CI)
9-
- gcc from version 4.8
9+
- gcc from version 8
1010
- visual studio from version 2019
1111
# Prepare the dependencies
1212
Download (build and install if necessary) third party libraries:
1313
- 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.
1414
- 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.)
1515
- (OPTIONALLY) OpenSSL : version 1.1 is known to work.
16-
- (OPTIONALLY) [FESAPI](https://github.com/F2I-Consulting/fesapi/releases) : All versions from version 2.7.0.0 should be ok.
16+
- (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.
1717

1818
# Configure the build
1919
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 :

cmake/modules/FindFESAPI.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ list(APPEND _FESAPI_SEARCHES _FESAPI_SEARCH_NORMAL)
5353
# The maximum of ranges are defined totally arbitrarily
5454
set(FESAPI_NAMES FesapiCpp)
5555
set(FESAPI_NAMES_DEBUG FesapiCppd)
56-
foreach(minorVer RANGE 7 15)
57-
foreach(patchVer RANGE 0 5)
58-
foreach(tweakVer RANGE 0 5)
59-
list(APPEND FESAPI_NAMES FesapiCpp.2.${minorVer}.${patchVer}.${tweakVer})
60-
list(APPEND FESAPI_NAMES_DEBUG FesapiCppd.2.${minorVer}.${patchVer}.${tweakVer})
61-
endforeach()
62-
endforeach()
56+
foreach(minorVer RANGE 11 99)
57+
list(APPEND FESAPI_NAMES FesapiCpp-2.${minorVer})
58+
list(APPEND FESAPI_NAMES_DEBUG FesapiCppd-2.${minorVer})
6359
endforeach()
6460

6561
# Try each search configuration.

cmake/pyproject.toml.in

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = 'fetpapi'
7+
version = '${Fetpapi_PYTHON_VERSION}'
8+
authors = [
9+
{name = "F2I-CONSULTING"},
10+
]
11+
maintainers = [
12+
{name = "F2I-CONSULTING"},
13+
]
14+
description = "A library for using the Energistics Transfer Protocol"
15+
readme = "README.md"
16+
classifiers=[
17+
'Development Status :: 5 - Production/Stable',
18+
'Intended Audience :: Developers',
19+
'License :: OSI Approved :: Apache Software License',
20+
'Operating System :: Microsoft :: Windows',
21+
'Operating System :: POSIX :: Linux',
22+
'Operating System :: MacOS',
23+
'Natural Language :: English',
24+
'Programming Language :: Python :: 3',
25+
'Programming Language :: Python :: 3.8',
26+
'Programming Language :: Python :: 3.9',
27+
'Programming Language :: Python :: 3.10',
28+
'Programming Language :: Python :: 3.11',
29+
'Programming Language :: Python :: 3.12',
30+
'Topic :: Software Development',
31+
'Topic :: Software Development :: Libraries',
32+
'Topic :: Software Development :: Libraries :: Application Frameworks ',
33+
'Topic :: File Formats',
34+
]
35+
keywords = [
36+
"energistics",
37+
"resqml",
38+
"eml",
39+
"witsml",
40+
"prodml",
41+
"osdu",
42+
"rddms",
43+
]
44+
requires-python = ">=3.8"
45+
dependencies = [
46+
'fesapi==2.12.1',
47+
]
48+
49+
[project.urls]
50+
source = "https://github.com/F2I-Consulting/fetpapi/issues"
51+
releasenotes = "https://github.com/F2I-Consulting/fetpapi/releases"
52+
documentation = "https://www.f2i-consulting.com/fetpapi/doxygen/"
53+
issues = "https://github.com/F2I-Consulting/fetpapi/issues"
54+
55+
[tool.setuptools]
56+
packages=['fetpapi']
57+
package-dir={"fetpapi" = "fetpapi"}
58+
ext-modules = [
59+
{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}}
60+
]
61+
62+
[tool.setuptools.package-data]
63+
fetpapi = ["*.dll", "*.so", "*.so.*"]

cmake/setup_etp.py.in

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)