Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 2 additions & 0 deletions .github/workflows/conda-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ on:
jobs:
build:
uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
with:
operating-system: "['ubuntu-latest']"
secrets:
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add end of line

9 changes: 3 additions & 6 deletions conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ dependencies:
- openalea.plantgl
- alinea.caribu
- alinea.astk
- numpy
- scipy
- sympy
- pandas
- jsonschema
- pvlib-python
- pip
- pip:
- ..[test,doc]
66 changes: 44 additions & 22 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,57 @@
package:
name: hydroshoot
version: "5.2.2"
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
{% set name = pyproject.get('project').get('name') %}
{% set description = pyproject.get('project').get('description') %}
{% set version = GIT_DESCRIBE_TAG | replace("v", "") %}
{% set license = pyproject.get('project').get('license') %}
{% set home = pyproject.get('project', {}).get('urls', {}).get('Homepage', '') %}
{% set build_deps = pyproject.get("build-system", {}).get("requires", []) %}
{% set deps = pyproject.get('project', {}).get('dependencies', []) %}
{% set conda_deps = pyproject.get('tool', {}).get('conda-environment', {}).get('dependencies',[]) %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here conda-dependencies are note set.
Perhaps adding them to pyproject.yaml


package:
name: {{ name }}
version: {{ version }}

source:
git_url: ../
path: ..

build:
noarch: python
number: 0
preserve_egg_dir: True
script: {{PYTHON}} -m pip install .
script:
- {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation -vv

requirements:
build:
- python {{PY_VER}}
- setuptools
host:
- python
{% for dep in build_deps %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need setuptools_scm
but other build_deps are not host, isn't it?
If so we need to change the doc and all the packages

- {{ dep }}
{% endfor %}

run:
- python
- numpy
- scipy
- sympy
- pandas
- jsonschema
- pvlib-python
- openalea.mtg
- openalea.plantgl
- alinea.caribu
- alinea.astk
{% for dep in deps + conda_deps %}
- {{ dep }}
{% endfor %}


test:
imports:
- hydroshoot
requires:
- pytest
source_files:
- test/
commands:
- pytest

about:
summary: "HydroShoot is an FSPM model to simulate gas-exchange on vine"
license: "cecill-c"
license_file: LICENSE
home: {{ home }}
summary: {{ description }}
license: {{ license }}

extra:
recipe-maintainers:
- artzet-s
- pradal
- fournier
27 changes: 21 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -11,17 +11,16 @@ authors = [
{ name = "Eric Lebon"},
]
description = "A functional-structural plant model (FSPM) to simulate gas and energy exchange of grapevine"
license = {file = "LICENSE"}
requires-python = ">=3.8"
license = "CECILL-C"
license-files = ["LICEN[CS]E*"]
requires-python = ">=3.9"
classifiers = [
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: CeCILL-C License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also add "Framework :: OpenAlea"

"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -55,11 +54,27 @@ Discussions = "https://github.com/openalea/hydroshoot/discussions"
Changelog = "https://github.com/openalea/hydroshoot/releases"

[tool.setuptools.dynamic]
version = {attr = "hydroshoot.version.__version__"}
readme = {file = ["README.rst"]}

# enable dynamic version based on git tags
[tool.setuptools_scm]

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"hydroshoot_data" = ["*"]

# not used yet by pip, but by meta.yaml
[tool.conda-environment]
channels = [
"openalea3",
"conda-forge",
]
# deps not available in pip with conda name
dependencies = [
"openalea.mtg",
"openalea.plantgl",
"alinea.caribu",
"openalea.astk",
]
12 changes: 6 additions & 6 deletions src/hydroshoot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {# pkglts, base
from importlib.metadata import version, PackageNotFoundError

from . import version

__version__ = version.__version__

# #}
try:
__version__ = version("hydroshoot")
except PackageNotFoundError:
# package is not installed
pass
2 changes: 1 addition & 1 deletion src/hydroshoot/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from math import pi

import alinea.astk.icosphere as ico
import openalea.astk.icosphere as ico
import openalea.plantgl.all as pgl
from alinea.caribu.CaribuScene import CaribuScene
from alinea.caribu.sky_tools import turtle
Expand Down
2 changes: 1 addition & 1 deletion src/hydroshoot/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
TODO: plug to the standard interface of Caribu module.
"""

import alinea.astk.icosphere as ico
import openalea.astk.icosphere as ico
from alinea.caribu.CaribuScene import CaribuScene
from alinea.caribu.sky_tools import turtle, Gensun, GetLightsSun
from alinea.caribu.sky_tools.spitters_horaire import RdRsH
Expand Down
9 changes: 0 additions & 9 deletions src/hydroshoot/version.py

This file was deleted.

Loading