Skip to content

Commit

Permalink
Merge pull request openalea-incubator#31 from pradal/conda
Browse files Browse the repository at this point in the history
Conda
  • Loading branch information
pradal authored May 12, 2022
2 parents abe05ef + 8519516 commit 31523c0
Show file tree
Hide file tree
Showing 13 changed files with 241 additions and 175 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/conda-package-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build_publish_anaconda

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-publish:
name: ${{ matrix.os }}, Python 3.${{ matrix.python-minor-version }} for conda deployment
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ ubuntu-latest]
python-minor-version: [9]
isMaster:
- ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/dev') }}
exclude:
- isMaster: false
os: ubuntu-latest
python-minor-version: 7
- isMaster: false
os: ubuntu-latest
python-minor-version: 8
- isMaster: false
os: macos-latest
python-minor-version: 7
- isMaster: false
os: macos-latest
python-minor-version: 8
- isMaster: false
os: macos-latest
python-minor-version: 9
- isMaster: false
os: windows-latest
python-minor-version: 7
- isMaster: false
os: windows-latest
python-minor-version: 8
- isMaster: false
os: windows-latest
python-minor-version: 9

steps:
- name: Chekout
uses: actions/checkout@v3
- name: Determine publish
uses: haya14busa/action-cond@v1
id: publish
with:
cond: ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }}
if_true: 'true'
if_false: 'false'
- name: Build and Publish
uses: openalea/[email protected]
with:
conda: conda
mamba: true
python: ${{ matrix.python-minor-version }}
numpy: '20.0'
channels: openalea3, conda-forge
token: ${{ secrets.ANACONDA_TOKEN }}
publish: ${{ steps.publish.outputs.value }}
label: main
45 changes: 45 additions & 0 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% set data = load_setup_py_data() %}

package:
name: alinea.adel
version: {{ data.get('version') }}

source:
path: ..

build:
noarch: python
preserve_egg_dir: True
number: 0
script: {{PYTHON}} setup.py install

requirements:
build:
- python {{PY_VER}}
- setuptools
- openalea.deploy
run:
- python >=3.6
- openalea.mtg
- scipy
- rpy2
- alinea.caribu
- alinea.astk

test:
requires:
- pytest
imports:
- alinea.adel
source_files:
- test/**
- test/data/**
commands:
- cd test
- pytest -v --ignore=test_povray.py

about:
home: {{ data.get('url') }}
license: {{ data.get('license') }}
summary: {{ data.get('description') }}

37 changes: 0 additions & 37 deletions setup.cfg

This file was deleted.

33 changes: 13 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-


import os, sys
from setuptools import setup, find_packages
from openalea.deploy.metainfo import read_metainfo
#from openalea.deploy.metainfo import read_metainfo
pj = os.path.join

version = '2.0.0-dev'
name = 'alinea.adel'

# Reads the metainfo file
metadata = read_metainfo('metainfo.ini', verbose=True)
for key,value in metadata.items():
exec("%s = '%s'" % (key, value))
description= '3D plant simulation of graminae crops'
long_description= 'The Adel package characterise 3D plant development for graminae crops.'


# #retrieving packages
# pkg_root_dir = '.'
# pkgs = [ pkg for pkg in find_packages(pkg_root_dir) if namespace not in pkg]
# top_pkgs = [pkg for pkg in pkgs if len(pkg.split('.')) < 2]
# packages = [ namespace + "." + pkg for pkg in pkgs]
# package_dir = dict( [('',pkg_root_dir)] + [(namespace + "." + pkg, pkg_root_dir + "/" + pkg) for pkg in top_pkgs] )
# wralea_entry_points = ['%s = %s'%(pkg,namespace + '.' + pkg) for pkg in top_pkgs]
authors= 'Christian Fournier, Christophe Pradal'
authors_email = 'christian fournier at inrae fr'

url = 'https://github.com/openalea-incubator/adel'
license = 'Cecill-C'

# Main setup
setup(
Expand All @@ -37,27 +33,24 @@
packages= find_packages('src'),
# python packages directory
package_dir= {'': 'src'},
namespace_packages=['alinea'],
#namespace_packages=['alinea'],


# Namespace packages creation by deploy
# Add package platform libraries if any
include_package_data=True,
package_data = {'' : ['*.RData', '*.R', '*.8', '*.h', '*.str','*.txt', '*.l', '*.map', '*.csv', '*.png'],},
share_dirs = {os.path.join(*('alinea', 'adel', 'data')): os.path.join(*('src', 'alinea','adel', 'data')),
os.path.join(*('alinea', 'adel', 'echap_leaf_data')): os.path.join(*('src', 'alinea','adel', 'echap_leaf_data'))},
share_dirs = {pj(*('alinea', 'adel', 'data')): pj(*('src', 'alinea','adel', 'data')),
pj(*('alinea', 'adel', 'echap_leaf_data')): pj(*('src', 'alinea','adel', 'echap_leaf_data'))},

# Add package platform libraries if any
zip_safe = False,


# Scripts
entry_points = { 'wralea': [ 'adel= alinea.adel',] },

# Dependencies (other are listed in doc to avoid setputools/pip/conda possible conflicts in automatic installs)
setup_requires = ['openalea.deploy'],
install_requires = [],
dependency_links = [],
)


Expand Down
44 changes: 22 additions & 22 deletions src/alinea/adel/Tutorials/__wralea__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
10: ('alinea.adel.data', 'phenTCa0N.csv'),
11: ('alinea.adel.wheat.data', 'SRSo.RData'),
12: ('openalea.data structure', 'int'),
13: ('vplants.plantgl.visualization', 'plot3D'),
13: ('openalea.plantgl.visualization', 'plot3D'),
14: ('alinea.adel.wheat.data', 'So99.RData'),
15: ('openalea.python method', 'getattr'),
16: ('openalea.data structure', 'int'),
Expand Down Expand Up @@ -1889,17 +1889,17 @@
8: ('alinea.adel.geometry', 'leaf to mesh'),
9: ('openalea.data structure', 'int'),
10: ('openalea.data structure', 'int'),
11: ('vplants.plantgl.visualization', 'plot3D'),
11: ('openalea.plantgl.visualization', 'plot3D'),
12: ('openalea.data structure', 'int'),
13: ('alinea.adel.data', 'leaves.db'),
14: ('openalea.data structure', 'int'),
15: ('openalea.flow control', 'annotation'),
16: ('openalea.flow control', 'annotation'),
17: ('alinea.adel.geometry', 'leaf element'),
18: ('vplants.plantgl.visualization', 'plot3D'),
19: ('vplants.plantgl.objects', 'Scene'),
20: ('vplants.plantgl.objects', 'Shape'),
21: ('vplants.plantgl.objects', 'Material'),
18: ('openalea.plantgl.visualization', 'plot3D'),
19: ('openalea.plantgl.objects', 'Scene'),
20: ('openalea.plantgl.objects', 'Shape'),
21: ('openalea.plantgl.objects', 'Material'),
22: ('openalea.color', 'color')},
elt_connections={ 31307220: (8, 0, 18, 0),
31307232: (19, 0, 11, 0),
Expand Down Expand Up @@ -2998,7 +2998,7 @@
67: ('alinea.adel.macro', 'calculate_LAI_TC_ViaCaribu'),
68: ('alinea.adel.macro', 'constructPlantGLScene'),
69: ('alinea.adel.macro', 'colors'),
70: ('vplants.plantgl.visualization', 'plot3D'),
70: ('openalea.plantgl.visualization', 'plot3D'),
71: ('alinea.adel.macro', 'getFieldPlotDescription'),
72: ('alinea.adel.macro', 'calculateTCViaPovray')},
elt_connections={ 37677512: (48, 0, 72, 2),
Expand Down Expand Up @@ -3602,8 +3602,8 @@
24: ('openalea.data structure', 'float'),
25: ('openalea.data structure.tuple', 'tuple'),
26: ('openalea.data structure.tuple', 'tuple'),
27: ('vplants.l-py', 'LSystem'),
28: ('vplants.l-py', 'run'),
27: ('openalea.l-py', 'LSystem'),
28: ('openalea.l-py', 'run'),
29: ('openalea.file', 'read'),
30: ('openalea.data structure.tuple', 'tuple'),
32: ('openalea.data structure.string', 'string')},
Expand Down Expand Up @@ -6060,10 +6060,10 @@
doc='',
inputs=[],
outputs=[],
elt_factory={ 2: ('vplants.l-py', 'LSystem'),
elt_factory={ 2: ('openalea.l-py', 'LSystem'),
3: ('openalea.file', 'read'),
4: ('vplants.l-py', 'run'),
5: ('vplants.l-py', 'plot'),
4: ('openalea.l-py', 'run'),
5: ('openalea.l-py', 'plot'),
6: ('alinea.adel.data', 'Adel2.lpy'),
7: ('alinea.adel.stand', 'CanMTGPlanter'),
8: ('openalea.flow control', 'iter'),
Expand Down Expand Up @@ -8895,7 +8895,7 @@
18: ('alinea.caribu', 'Caribu'),
19: ('alinea.adel.io', 'to_plantgl'),
20: ('alinea.adel.povray', 'povray'),
21: ('vplants.plantgl.visualization', 'plot3D'),
21: ('openalea.plantgl.visualization', 'plot3D'),
22: ('alinea.adel.io', 'apply_property'),
23: ('openalea.data structure', 'int'),
24: ('alinea.adel.povray', 'col_item'),
Expand Down Expand Up @@ -12142,7 +12142,7 @@
42: ('alinea.adel.io', 'to_plantgl'),
43: ('openalea.data structure', 'int'),
44: ('alinea.adel.povray', 'povray'),
45: ('vplants.plantgl.visualization', 'plot3D'),
45: ('openalea.plantgl.visualization', 'plot3D'),
46: ('openalea.function operator', 'map'),
48: ('alinea.adel.io', 'apply_property'),
49: ('openalea.data structure', 'int'),
Expand Down Expand Up @@ -14475,7 +14475,7 @@
22: ('alinea.caribu', 'Caribu'),
23: ('alinea.adel.io', 'to_plantgl'),
24: ('alinea.adel.povray', 'povray'),
25: ('vplants.plantgl.visualization', 'plot3D'),
25: ('openalea.plantgl.visualization', 'plot3D'),
26: ('alinea.adel.io', 'apply_property'),
27: ('openalea.data structure', 'int'),
28: ('alinea.adel.povray', 'col_item'),
Expand Down Expand Up @@ -18515,7 +18515,7 @@
41: ('alinea.adel.io', 'to_plantgl'),
42: ('openalea.file', 'filename'),
43: ('alinea.adel.povray', 'povray'),
44: ('vplants.plantgl.visualization', 'plot3D'),
44: ('openalea.plantgl.visualization', 'plot3D'),
45: ('openalea.function operator', 'map'),
46: ('alinea.adel.macro', 'LAIg'),
47: ('alinea.adel.io', 'apply_property'),
Expand All @@ -18524,7 +18524,7 @@
51: ('openalea.file', 'start'),
53: ('alinea.adel.macro', 'genMTG_3out'),
54: ('alinea.adel.macro', 'genFilepath'),
55: ('vplants.plantgl.visualization', 'plot3D'),
55: ('openalea.plantgl.visualization', 'plot3D'),
56: ('openalea.file', 'start'),
57: ('alinea.adel.stand', 'post_processing'),
58: ('alinea.adel.macro', 'genFilepath'),
Expand Down Expand Up @@ -21779,7 +21779,7 @@
41: ('alinea.adel.io', 'to_plantgl'),
42: ('openalea.data structure', 'int'),
43: ('alinea.adel.povray', 'povray'),
44: ('vplants.plantgl.visualization', 'plot3D'),
44: ('openalea.plantgl.visualization', 'plot3D'),
45: ('openalea.function operator', 'map'),
46: ('openalea.flow control', 'annotation'),
47: ('alinea.adel.io', 'apply_property'),
Expand Down Expand Up @@ -23131,7 +23131,7 @@
50: ('alinea.adel.simulation', 'AdelRunOptions'),
51: ('alinea.adel.povray', 'povray'),
52: ('openalea.color', 'color'),
53: ('vplants.plantgl.visualization', 'plot3D'),
53: ('openalea.plantgl.visualization', 'plot3D'),
54: ('openalea.file', 'start'),
55: ('openalea.color', 'color'),
56: ('alinea.adel.io', 'apply_property'),
Expand Down Expand Up @@ -24567,8 +24567,8 @@
15: ('alinea.caribu', 'MtgToCan'),
16: ('alinea.adel.io', 'duplicate mtg'),
17: ('alinea.adel.macro', 'plot'),
18: ('vplants.l-py', 'run'),
19: ('vplants.l-py', 'LSystem')},
18: ('openalea.l-py', 'run'),
19: ('openalea.l-py', 'LSystem')},
elt_connections={ 35910096: (3, 1, 9, 0),
35910120: (3, 0, 8, 0),
35910144: (5, 1, 3, 0),
Expand Down Expand Up @@ -25005,7 +25005,7 @@
42: ('alinea.adel.io', 'to_plantgl'),
43: ('openalea.data structure', 'int'),
44: ('alinea.adel.povray', 'povray'),
45: ('vplants.plantgl.visualization', 'plot3D'),
45: ('openalea.plantgl.visualization', 'plot3D'),
46: ('openalea.function operator', 'map'),
48: ('alinea.adel.io', 'apply_property'),
49: ('openalea.data structure', 'int'),
Expand Down
6 changes: 3 additions & 3 deletions src/alinea/adel/Tutorials/ssdbm/__wralea__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
7: ('openalea.numpy.creation', 'linspace'),
8: ('openalea.function operator', 'reduce'),
11: ('alinea.adel.stand', 'CanMTGPlanter'),
12: ('vplants.plantgl.visualization', 'plot3D'),
12: ('openalea.plantgl.visualization', 'plot3D'),
13: ('alinea.adel.stand', 'agronomic plot'),
17: ('alinea.adel.tutorials.ssdbm.mtg', 'union'),
18: ('alinea.adel.data', 'leaves.db'),
Expand Down Expand Up @@ -792,7 +792,7 @@
7: ('openalea.numpy.creation', 'linspace'),
8: ('openalea.function operator', 'reduce'),
11: ('alinea.adel.stand', 'CanMTGPlanter'),
12: ('vplants.plantgl.visualization', 'plot3D'),
12: ('openalea.plantgl.visualization', 'plot3D'),
13: ('alinea.adel.stand', 'agronomic plot'),
23: ('ssdbm', 'Light Interception')},
elt_connections={ 140522878453448: (23, 1, 12, 0),
Expand Down Expand Up @@ -3175,7 +3175,7 @@
{ 'desc': '', 'interface': None, 'name': 'g'}],
elt_factory={ 2: ('alinea.adel.geometry', 'MTG Interpreter time'),
3: ('alinea.adel.stand', 'CanMTGPlanter'),
4: ('vplants.plantgl.visualization', 'plot3D'),
4: ('openalea.plantgl.visualization', 'plot3D'),
5: ('alinea.adel.tutorials.ssdbm', 'Light Interception'),
6: ('openalea.flow control', 'rendez vous'),
7: ('alinea.adel.data', 'leaves.db'),
Expand Down
Loading

0 comments on commit 31523c0

Please sign in to comment.