Skip to content

Commit 10c9a28

Browse files
MelchiorSchuhBotellaA
authored andcommitted
feat(OpenGeode): Update to OpenGeode v12 standards.
1 parent ad0506a commit 10c9a28

File tree

12 files changed

+57
-42
lines changed

12 files changed

+57
-42
lines changed

.github/workflows/CD.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,30 @@ jobs:
1010
with:
1111
name: OPENGEODE_MYMODULE
1212
repos: OpenGeode
13-
secrets:
14-
TOKEN: ${{ secrets.TOKEN }}
15-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
13+
secrets: inherit
1614

1715
release-linux-python:
1816
uses: Geode-solutions/actions/.github/workflows/cd-linux-python.yml@master
1917
with:
2018
name: OPENGEODE_MYMODULE
2119
repos: OpenGeode
22-
secrets:
23-
TOKEN: ${{ secrets.TOKEN }}
24-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
25-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
20+
secrets: inherit
2621

2722
release-windows:
2823
uses: Geode-solutions/actions/.github/workflows/cd-windows.yml@master
2924
with:
3025
name: OPENGEODE_MYMODULE
3126
repos: OpenGeode
32-
secrets:
33-
TOKEN: ${{ secrets.TOKEN }}
34-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
27+
secrets: inherit
3528

3629
release-windows-python:
3730
uses: Geode-solutions/actions/.github/workflows/cd-windows-python.yml@master
3831
with:
3932
name: OPENGEODE_MYMODULE
4033
repos: OpenGeode
41-
secrets:
42-
TOKEN: ${{ secrets.TOKEN }}
43-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
44-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
34+
secrets: inherit
4535

4636
notify:
4737
uses: Geode-solutions/actions/.github/workflows/end-cd.yml@master
4838
needs: [release-linux, release-linux-python, release-windows, release-windows-python]
49-
secrets:
50-
TOKEN: ${{ secrets.TOKEN }}
51-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
39+
secrets: inherit

.github/workflows/CI.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,52 @@ name: CI
22

33
on:
44
push:
5-
pull_request:
65
schedule:
76
- cron: 0 0 * * *
87

98
jobs:
109
format:
1110
uses: Geode-solutions/actions/.github/workflows/format.yml@master
12-
secrets:
13-
TOKEN: ${{ secrets.TOKEN }}
11+
secrets: inherit
1412

1513
build-linux:
1614
needs: format
1715
uses: Geode-solutions/actions/.github/workflows/ci-linux.yml@master
1816
with:
1917
repos: OpenGeode
20-
secrets:
21-
TOKEN: ${{ secrets.TOKEN }}
22-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
18+
secrets: inherit
2319

2420
build-linux-python:
2521
needs: format
2622
uses: Geode-solutions/actions/.github/workflows/ci-linux-python.yml@master
2723
with:
2824
name: OPENGEODE_MYMODULE
2925
repos: OpenGeode
30-
secrets:
31-
TOKEN: ${{ secrets.TOKEN }}
32-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26+
secrets: inherit
3327

3428
coverage:
3529
needs: format
3630
uses: Geode-solutions/actions/.github/workflows/coverage.yml@master
3731
with:
3832
repos: OpenGeode
39-
secrets:
40-
TOKEN: ${{ secrets.TOKEN }}
33+
secrets: inherit
4134

4235
build-windows:
4336
needs: format
4437
uses: Geode-solutions/actions/.github/workflows/ci-windows.yml@master
4538
with:
46-
name: OPENGEODE_MYMODULE
4739
repos: OpenGeode
48-
secrets:
49-
TOKEN: ${{ secrets.TOKEN }}
50-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
40+
secrets: inherit
5141

42+
build-windows-python:
43+
needs: format
44+
uses: Geode-solutions/actions/.github/workflows/ci-windows-python.yml@master
45+
with:
46+
name: OPENGEODE_MYMODULE
47+
repos: OpenGeode
48+
secrets: inherit
49+
5250
semantic-release:
5351
needs: [build-linux, build-linux-python, build-windows]
5452
uses: Geode-solutions/actions/.github/workflows/release.yml@master
55-
secrets:
56-
TOKEN: ${{ secrets.TOKEN }}
53+
secrets: inherit

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
cmake_minimum_required(VERSION 3.14)
21+
cmake_minimum_required(VERSION 3.15)
22+
23+
cmake_policy(SET CMP0091 NEW)
2224

2325
# Define the project
2426
project(OpenGeode-MyModule CXX)

bindings/python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
# SOFTWARE.
2020

2121

22-
from .opengeode_mymodule_py_mylib import *
22+
from .mylib import *

bindings/python/mylib.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2019 - 2022 Geode-solutions. All rights reserved.
3+
#
4+
5+
import opengeode
6+
7+
from .opengeode_mymodule_py_mylib import *
8+
MyModuleMyLib.initialize()

bindings/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OpenGeode-core >= 10.0.16, == 10.*
1+
OpenGeode-core >= 12.1.8, == 12.*

bindings/python/src/mylib/mylib.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
PYBIND11_MODULE( opengeode_mymodule_py_mylib, module )
2929
{
3030
module.doc() = "OpenGeode-ModuleTemplate Python binding for mylib";
31+
pybind11::class_< mymodule::MyModuleMyLib >( module, "MyModuleMyLib" )
32+
.def( "initialize", &mymodule::MyModuleMyLib::initialize );
3133
module.def( "hello_world", &mymodule::hello_world );
3234
}

include/mylib/common.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2019 - 2022 Geode-solutions. All rights reserved.
3+
*/
4+
5+
#pragma once
6+
7+
#include <geode/basic/common.h>
8+
#include <geode/basic/library.h>
9+
#include <mylib/opengeode_mymodule_mylib_export.h>
10+
11+
namespace mymodule
12+
{
13+
OPENGEODE_LIBRARY( opengeode_mymodule_mylib_api, MyModuleMyLib );
14+
} // namespace mymodule

include/mylib/hello_world.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#pragma once
2525

26-
#include <mylib/opengeode_mymodule_mylib_export.h>
26+
#include <mylib/common.h>
2727

2828
namespace mymodule
2929
{

src/mylib/common.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
*
2222
*/
2323

24+
#include <mylib/common.h>
25+
2426
#include <geode/basic/common.h>
2527

26-
namespace
28+
namespace mymodule
2729
{
28-
OPENGEODE_LIBRARY_INITIALIZE( myLib )
30+
OPENGEODE_LIBRARY_IMPLEMENTATION( MyModuleMyLib )
2931
{
3032
/* Here the functions to call when initializing the library
3133
* For exemple: registers, ...
3234
*/
35+
geode::OpenGeodeBasic::initialize();
3336
}
34-
} // namespace
37+
} // namespace mymodule

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
cmake_minimum_required(VERSION 3.14)
21+
cmake_minimum_required(VERSION 3.15)
2222

2323
if(NOT TARGET OpenGeode-MyModule::mylib)
2424
project(OpenGeode-MyModule CXX)

tests/mylib/test-hello-world.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ int main()
3030
{
3131
try
3232
{
33+
mymodule::MyModuleMyLib::initialize();
3334
OPENGEODE_EXCEPTION(
3435
mymodule::hello_world(), "[Test] Hello World is not correct" );
3536

0 commit comments

Comments
 (0)