Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ build:
noarch: python
preserve_egg_dir: True
number: 0
string: py{{ PY_VER }}
script: {{PYTHON}} -m pip install . -vv
script: {{PYTHON}} -m pip install --no-deps --no-build-isolation . -vv

requirements:
build:
Expand All @@ -37,7 +36,7 @@ requirements:

test:
requires:
{% for dep in deps + conda_deps + test_deps %}
{% for dep in test_deps %}
- {{ dep }}
{% endfor %}
imports:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ dynamic = ["readme","version"]
dependencies = [
"numpy",
"scipy",
"matplotlib-base",
"pandas",
"rpy2"
]

[project.optional-dependencies]
Expand All @@ -60,7 +60,7 @@ dependencies = [
"openalea.plantgl",
"openalea.caribu",
"openalea.astk",
"rpy2"
"matplotlib-base"
]
[tool.setuptools.dynamic]
readme = {file = ["README.md"]}
Expand Down
1 change: 1 addition & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Needed to make conftest.py visible
14 changes: 14 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pytest

try:
# test if R's stats package loads correctly
import rpy2.robjects as ro
ro.r("na.omit") # will error on broken R
R_OK = True
except Exception:
R_OK = False

pytest_r_skip = pytest.mark.skipif(
not R_OK,
reason="Skipping R/rpy2 tests on this platform due to broken R/rpy2 installation"
)
4 changes: 2 additions & 2 deletions test/test_AdelWheat.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from openalea.adel.astk_interface import AdelWheat
from openalea.astk.Weather import sample_weather
from .conftest import pytest_r_skip




@pytest_r_skip
def test_adelwheat():
seq, weather = sample_weather()
seq = seq.tz_localize(tz='Europe/Paris')
Expand Down
3 changes: 3 additions & 0 deletions test/test_Adel_Maxwell_plante11.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from openalea.adel.AdelR import devCsv, setAdel, RunAdel, genGeoLeaf, genGeoAxe, \
csvAsDict

from .conftest import pytest_r_skip


@pytest_r_skip
def test_organ_length():
dir = str(pathlib.Path(__file__).parent.resolve() / "data" / "test_Adel_Maxwell_plante11/Maxwell_")
sufix = "_plante11.csv"
Expand Down
3 changes: 2 additions & 1 deletion test/test_adelwheat_dynamic.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Test use cases of adel/fspm wheat coupling"""

from openalea.adel.adelwheat_dynamic import AdelWheatDyn
from .conftest import pytest_r_skip


@pytest_r_skip
def test_add_metamer():
# create a plant with 3 metamers
adel = AdelWheatDyn(seed=1234)
Expand Down
2 changes: 2 additions & 0 deletions test/test_astk_interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from openalea.adel.astk_interface import AdelWheat
from .conftest import pytest_r_skip

pytestmark = pytest_r_skip

def test_static():
nplants = 1
Expand Down
3 changes: 3 additions & 0 deletions test/test_data_samples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from openalea.adel.data_samples import *
from .conftest import pytest_r_skip


@pytest_r_skip
def test_leaf_db():
db = leaves_db()
sr = srdb()
Expand All @@ -12,6 +14,7 @@ def test_leaf_db():
assert leaves is not None


@pytest_r_skip
def test_devT():
dev = devT()
assert dev is not None
Expand Down
Loading