Skip to content

Commit 9433221

Browse files
authored
Merge pull request #43 from fredboudon/master
Upgrade to new namespace convention. Add py 3.11 and py3.12
2 parents 41c66aa + 2e8889f commit 9433221

File tree

128 files changed

+43335
-46815
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+43335
-46815
lines changed
Lines changed: 13 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,21 @@
1-
name: Building Package using Conda
1+
name: Building Package
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- '**'
7+
tags:
8+
- 'v*'
69
pull_request:
7-
branches: [ master ]
10+
branches:
11+
- '**'
812

913

1014
jobs:
1115
build:
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
#max-parallel: 5
15-
matrix:
16-
os: [ macos-latest, ubuntu-latest]
17-
env:
18-
- CONDA_PY: "37"
19-
CONDA_NPY: "111"
20-
- CONDA_PY: "38"
21-
CONDA_NPY: "116"
22-
- CONDA_PY: "39"
23-
CONDA_NPY: "119"
24-
25-
environment: anaconda_build
26-
27-
steps:
28-
- uses: actions/checkout@v2
29-
30-
- name: Add conda to system path
31-
run: |
32-
# Add conda to system path
33-
# $CONDA is an environment variable pointing to the root of the miniconda directory
34-
echo $CONDA/bin >> $GITHUB_PATH
35-
36-
- name: Setup conda
37-
run: |
38-
# Setup conda
39-
sudo conda config --add channels conda-forge
40-
sudo conda config --add channels openalea3
41-
sudo conda config --set always_yes yes
42-
sudo conda config --set remote_read_timeout_secs 600
43-
sudo conda config --set auto_update_conda False
44-
sudo conda install conda-build anaconda-client
45-
46-
- name: Build
47-
env:
48-
CONDA_PY: ${{ matrix.env.CONDA_PY }}
49-
CONDA_NPY: ${{ matrix.env.CONDA_NPY }}
50-
run: |
51-
# Build
52-
if [[ "$CONDA_PY" = "" ]]; then
53-
echo "CONDA_PY is not defined"
54-
exit -1
55-
fi
56-
if [[ "$CONDA_NPY" = "" ]]; then
57-
echo "CONDA_NPY is not defined"
58-
exit -1
59-
fi
60-
export PYTHON_VERSION=${CONDA_PY:0:1}.${CONDA_PY:1:1}
61-
export NUMPY_VERSION=${CONDA_NPY:0:1}.${CONDA_NPY:1:2}
62-
63-
export BUILD_CMD="sudo conda build . --python=$PYTHON_VERSION"
64-
export BUILD_OUTPUT=`$BUILD_CMD --output`
65-
66-
if [[ "$BUILD_OUTPUT" = "" ]]; then
67-
echo "PACKAGE NAME is not defined"
68-
exit -1
69-
fi
70-
echo "BUILD_OUTPUT=$BUILD_OUTPUT" >> $GITHUB_ENV
71-
72-
$BUILD_CMD
73-
74-
75-
- name: Login
76-
env:
77-
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
78-
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }}
79-
run: |
80-
# Login
81-
if [[ "$ANACONDA_LOGIN" = "" ]]; then
82-
echo "ANACONDA_LOGIN is not defined"
83-
exit -1
84-
fi
85-
SESSION_UID=$(uuidgen)
86-
anaconda login --username $ANACONDA_LOGIN --password $ANACONDA_PASSWORD --hostname $SESSION_UID
87-
88-
- name: Deploy
89-
env:
90-
ANACONDA_OWNER: ${{ secrets.ANACONDA_OWNER }}
91-
BUILD_OUTPUT: ${{ env.BUILD_OUTPUT }}
92-
run: |
93-
# Deploy
94-
if [[ "$ANACONDA_OWNER" = "" ]]; then
95-
echo "ANACONDA_OWNER is not defined"
96-
exit -1
97-
fi
98-
99-
echo "PACKAGE NAME:" $BUILD_OUTPUT
100-
if [[ "$BUILD_OUTPUT" = "" ]]; then
101-
echo "PACKAGE NAME is not defined"
102-
exit -1
103-
fi
104-
anaconda upload --skip-existing $BUILD_OUTPUT -u $ANACONDA_OWNER --no-progress
105-
16+
uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
17+
with:
18+
conda-channels: openalea3, conda-forge
19+
secrets:
20+
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
21+

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ src/openalea/lpy/gui/logindialog.py
1414
src/openalea/lpy/gui/lpymainwindow.py
1515
src/openalea/lpy/gui/lpyprefwidget.py
1616
src/openalea/lpy/gui/py2exe_release.py
17-
#src/openalea/lpy/gui/lpyresources_rc.py
17+
src/openalea/lpy/gui/lpyresources_rc.py
1818
src/openalea/lpy/gui/scalarfloatmetaedit.py
1919
src/openalea/lpy/gui/scalarmetaedit.py
2020

2121
# lpy temp file
22-
*.lpy~
23-
*.py~
22+
*.*~
2423
\#*\#
2524

2625
# C extensions

CMakeLists.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ project(lpy_project CXX)
1111

1212
# --- Build setup
1313

14+
set(CMAKE_INCLUDE_PATH "$ENV{CONDA_PREFIX}/include" ${CMAKE_INCLUDE_PATH})
15+
set(CMAKE_LIBRARY_PATH "$ENV{CONDA_PREFIX}/lib" ${CMAKE_LIBRARY_PATH})
1416
set(CMAKE_SKIP_BUILD_RPATH FALSE)
1517
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
1618
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
@@ -35,6 +37,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
3537

3638
if (MSVC)
3739
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
40+
41+
# To fix compilation error with vc14 and boost
42+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DHAVE_SNPRINTF")
3843
endif()
3944

4045
## When linking, Python libs are required, so I advised I could use: "target_library_link(targetname ${Python3_LIBRARIES})"
@@ -51,25 +56,34 @@ endif()
5156

5257
# --- Python
5358

54-
find_package (Python3 COMPONENTS Interpreter Development REQUIRED)
59+
set(Python3_FIND_VIRTUALENV FIRST)
60+
if (WIN32)
61+
# needed when we run cmake in a conda environment
62+
set(Python3_FIND_REGISTRY LAST)
63+
endif()
64+
65+
find_package (Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
5566
include_directories(${Python3_INCLUDE_DIRS})
5667

5768
# --- Libraries
5869

5970
find_package(Threads REQUIRED)
60-
find_package(Qt5Core CONFIG REQUIRED)
61-
find_package(Qt5Concurrent CONFIG REQUIRED)
71+
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
72+
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Concurrent)
6273
find_package(PlantGL REQUIRED)
6374

6475
set(Boost_NO_SYSTEM_PATHS ON)
6576
set(Boost_USE_MULTITHREAD ON)
6677
set(Boost_USE_STATIC_LIBS OFF)
6778
set(BUILD_SHARED_LIBS ON)
6879

69-
if (USE_CONDA)
80+
81+
set(boost_python python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
82+
find_package(Boost 1.69 COMPONENTS system ${boost_python} REQUIRED)
83+
if (NOT Boost_FOUND)
84+
message("Boost not found, trying again")
7085
set(boost_python python)
71-
else()
72-
set(boost_python python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
86+
find_package(Boost 1.69 COMPONENTS system ${boost_python} REQUIRED)
7387
endif()
7488

7589
find_package(Boost COMPONENTS system ${boost_python} REQUIRED)

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ environment:
66
CONDA_VERSION: 3
77

88
matrix:
9-
- CONDA_PY: 37
109
- CONDA_PY: 38
1110
CONDA_NPY: 116
1211
- CONDA_PY: 39
1312
CONDA_NPY: 119
13+
- CONDA_PY: 310
14+
CONDA_NPY: 121
1415

1516
install:
1617
- git clone https://github.com/OpenAlea/appveyor-ci.git appveyor-ci

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
conda build . -c conda-forge -c fredboudon -c defaults --python=3.7
1+
conda mambabuild . -c conda-forge -c fredboudon --python=3.10 --no-test

conda/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ echo "PYTHON:" ${PYTHON}
5858
#export PYTHONPATH=${PREFIX}/lib/python${PY_VER}/site-packages/
5959
${PYTHON} setup.py install --prefix=${PREFIX}
6060

61-
cp -r share `${PYTHON} -c "import os, openalea.lpy as lpy ; print(os.path.dirname(lpy.__file__))"`/..
61+
#cp -r share `${PYTHON} -c "import os, openalea.lpy as lpy ; print(os.path.dirname(lpy.__file__))"`/..
6262

6363
echo
6464
echo "****** CHECK PYTHON LIB"
@@ -71,6 +71,6 @@ else
7171
export LDD='ldd'
7272
fi
7373

74-
${LDD} `${PYTHON} -c "import openalea.lpy.__lpy_kernel__ as lpy ; print(lpy.__file__)"`
74+
echo `${PYTHON} -c "import openalea.lpy.__lpy_kernel__ as lpy ; print(lpy.__file__)"`
7575

7676
echo "****** END OF BUILD PROCESS"

conda/conda_build_config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cxx_compiler:
2+
- gxx # [linux]
3+
- clangxx # [osx]
4+
- vs2019 # [win]
5+
compiler_version:
6+
- 11 # [osx]
7+
- 11.2.0 # [linux]
8+
cxx_compiler_version:
9+
- 11 # [osx]
10+
- 11.2.0 # [linux]
11+
MACOSX_DEPLOYMENT_TARGET: # [osx]
12+
- '10.12' # [osx]
13+
MACOSX_SDK_VERSION: # [osx and x86_64]
14+
- '10.12' # [osx and x86_64]
15+
pin_run_as_build:
16+
boost: x.x
17+
openalea.plantgl: x.x

conda/meta.yaml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@ about:
1515

1616
build:
1717
preserve_egg_dir: True
18-
number: 0
18+
number: 1
1919
requirements:
20+
host:
21+
- python x.x
22+
- setuptools
23+
- openalea.plantgl >=3.17
24+
- boost
25+
- pyqt
2026
build:
21-
- binutils_impl_linux-64<2.31.0 # [linux]
27+
- binutils_impl_linux-64 # [linux]
2228
- {{ compiler('cxx') }}
23-
- python {{PY_VER}}
24-
- cmake >=3.12.0
29+
- python x.x
30+
- cmake
2531
- pkg-config # [linux]
2632
- make # [unix]
2733
- menuinst # [win]
28-
host:
29-
- python {{PY_VER}}
30-
- setuptools
31-
- openalea.plantgl
32-
# - boost # provided by plantgl
33-
- pyqt
3434
run:
35-
- python {{PY_VER}}
35+
- python x.x
3636
- setuptools
3737
- {{ pin_compatible('openalea.plantgl', max_pin='x.x') }}
38-
- {{ pin_compatible('boost', max_pin='x.x.x') }}
38+
- boost
3939
- pyqt
4040
- ipython
4141
- qtconsole
4242
- jupyter_client # <6
4343
- pyopengl
44-
- pyqglviewer
44+
- pyqglviewer >=1.3
4545
- jsonschema
4646

4747
app:
@@ -52,11 +52,12 @@ app:
5252
test:
5353
requires:
5454
- nose
55+
- pandas
5556
imports:
5657
- openalea.lpy
5758
source_files:
5859
- test/
5960
- share/
6061
commands:
61-
- nosetests -v -I test_predecessor_at_scale.py -I test_ui.py [unix]
62-
- nosetests -v -I test_predecessor_at_scale.py -I test_ui.py -I test_axialtree.py -I test_successor_at_scale.py [win]
62+
- nosetests -v -I test_predecessor_at_scale.py -I test_ui.py -I test_pickle.py [unix]
63+
- nosetests -v -I test_predecessor_at_scale.py -I test_ui.py -I test_axialtree.py -I test_successor_at_scale.py -I test_pickle.py [win]

doc/_images/gallery/tomato.png

685 KB
Loading

0 commit comments

Comments
 (0)