Skip to content

Conversation

@AurelienBesnier
Copy link
Contributor

Just an update of the conda packaging with the new versioning system

@AurelienBesnier AurelienBesnier linked an issue May 20, 2025 that may be closed by this pull request
@pradal pradal requested review from RamiALBASHA and pradal May 20, 2025 15:27
pradal added 2 commits May 20, 2025 16:34
add blank line at the end of the file
Add blank line
conda/meta.yaml Outdated
{% 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
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

conda/meta.yaml Outdated
- pandas
- jsonschema
- pvlib-python
- openalea.mtg
Copy link
Contributor

Choose a reason for hiding this comment

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

need to move this to pyproject.toml

conda/meta.yaml Outdated
- pvlib-python
- openalea.mtg
- openalea.plantgl
- alinea.caribu
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace alinea.caribu and alinea.astk by one new version.
But perhaps in another PR

Copy link
Contributor

@pradal pradal left a comment

Choose a reason for hiding this comment

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

You also may change the pyproject.toml for management of the version.
See the documentation (https://openalea.rtfd.io)

@pradal
Copy link
Contributor

pradal commented Sep 4, 2025

in pyproject.toml

[tool.setuptools_scm]
# Format version to ease alignment with conda/meta.yaml tag-based versioning
fallback_version = "0.0.0.dev0"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"

@RamiALBASHA
Copy link
Collaborator

RamiALBASHA commented Sep 4, 2025

Thanks for the updates.
There are still two failed jobs :

thanks again

@AurelienBesnier
Copy link
Contributor Author

Thanks for the updates. There are still two failed jobs :

* cannot find alinea.caribu dependecy : https://github.com/openalea/hydroshoot/actions/runs/17382250925/job/49575905207?pr=131#step:3:1342

* compatibility issue https://github.com/openalea/hydroshoot/actions/runs/17382250925/job/49575905240?pr=131#step:3:3759

thanks again

No problems ! For the alinea.caribu problem it should solve itself once caribu is available for osx-arm64
For the compatibility issue, we are working on it in openalea/plantgl#80

Copy link
Contributor

@pradal pradal left a comment

Choose a reason for hiding this comment

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

Few comments but they are quite general and not specific to hydroshoot

uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main
secrets:
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
Copy link
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

- setuptools
host:
- python
{% for dep in build_deps %}
Copy link
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

"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
Copy link
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"

pyproject.toml Outdated
# enable dynamic version based on git tags
[tool.setuptools_scm]
# Format version to ease alignment with conda/meta.yaml tag-based versioning
fallback_version = "0.0.0.dev0"
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps the latest version 5.2.2? Rather than 0.0.0

@christian34
Copy link
Contributor

The bug on windows is just because alinea.caribu is too old : the caribu PR should be accecpted first (one maclatest is okay !)

@pradal
Copy link
Contributor

pradal commented Sep 17, 2025

We need to move on for the release.
Can you review and merge this PR?
Or give us the green light, and we will maintain it.

@pradal
Copy link
Contributor

pradal commented Oct 23, 2025

@RamiALBASHA : a gentle reminder.
If you have some difficulty on merging it, we can discuss

Copy link
Collaborator

@RamiALBASHA RamiALBASHA left a comment

Choose a reason for hiding this comment

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

Thanks for this improvement @pradal , @AurelienBesnier.
I have some questions:

  • Is it possible to make an editable installation using pip? I installed the package using mamba as indicated in the README and the installation ran without any error. HydroShoot was then installed as a dependency in my mamba env.
    However, performing pip install -e . fails:
      ERROR: Could not find a version that satisfies the requirement setuptools (from versions: none)
      ERROR: No matching distribution found for setuptools

How can we now develop the package without an editable installation?

  • how dependencies are handleded? the optional dependencies are not installed with mamba, which is logic. However, if I cannot perform a manual installation (pip install .), how can I then use pyproject.toml? (same pblm as above)
  • Is the version now hard-coded in pyproject.toml? Just to verify, since I'm not familiar yet with setuptools_scm

@pradal
Copy link
Contributor

pradal commented Oct 23, 2025

Hi Rami!

  1. Editable version: Yes. This is how all the docs are built. We install all the deps and then we run pip install -e .
    This is working very well for pure Python pkgs. And we are working on it for compiled models (like caribu or plantgl)

But we do that on a mamba environment where the deps have been installed.
If it is not clear, I will update the doc

  1. If you are a developper, you install the deps with mamba. And your package with pip in this mamba env
  2. No. The version is infered from the tag. All the release pipeline is driven by the tags

@RamiALBASHA
Copy link
Collaborator

RamiALBASHA commented Oct 23, 2025

  1. Editable version: Yes. This is how all the docs are built. We install all the deps and then we run pip install -e .
    This is working very well for pure Python pkgs. And we are working on it for compiled models (like caribu or plantgl)
  2. If you are a developper, you install the deps with mamba. And your package with pip in this mamba env

@pradal So should I extract the deps from pyproject.toml and put them into some requirements.txt and make dependencies dynamic now in pyproject.toml?

If it is not clear, I will update the doc

thanks, yes

  1. No. The version is infered from the tag. All the release pipeline is driven by the tags

The workflow obliges now to release a new tag each time the devs want to bump the version? (just to understand)

@pradal
Copy link
Contributor

pradal commented Oct 23, 2025

We add an environment.yaml in conda (see https://github.com/openalea/hydroroot/blob/main/conda/environment.yml)

So you can build the env with

mamba env -f conda/environment.yaml

@RamiALBASHA
Copy link
Collaborator

@pradal
I have tried mamba env create -f conda/environment.yml -n MyEnv and got:

PackagesNotFoundError: The following packages are not available from current channels:

  - openalea.caribu

Current channels:

  - https://conda.anaconda.org/conda-forge
  - https://conda.anaconda.org/openalea3

Should we merge this PR now and open an issue for editable installation, or wait until the compiled libraries are handled?

@pradal
Copy link
Contributor

pradal commented Oct 23, 2025

Yes. Sure.

You need to add

-c openalea3/label/dev -c openalea/label/rc -c openalea3 -c conda-forge

@RamiALBASHA
Copy link
Collaborator

@pradal
mamba env create doesn't accept -c flags for channels directly in the command line.
I added the channels to environment.yml as:

channels:
  - conda-forge
  - openalea3
  - openalea3/label/dev
  - openalea/label/rc

but hit a new problem:

package openalea.caribu-8.1.4.dev-py3.13 requires python >=3.13,<3.14.0a0, but none of the providers can be installd

@pradal
Copy link
Contributor

pradal commented Oct 23, 2025

Sure
I recommend you to add the same channels but with another priority:

channels:
  - openalea3/label/dev
  - openalea/label/rc
  - openalea3
  - conda-forge

A package is first uploaded to dev when the branch is merge in the master or main branch .
Then when a tag is added, the pkg move to rc.
And when the package is released, it will move to openlea3

Otherelse, this is stange that there are conflicts.

@pradal
Copy link
Contributor

pradal commented Nov 5, 2025

Hi @RamiALBASHA
I fix the error in conda/environment.yml

Just by running

mamba env -f conda/environment.yml

Everything is installed and work. I suucced to run some examples.

@RamiALBASHA RamiALBASHA merged commit 609f5df into master Dec 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conda Packaging (meta.yaml)

5 participants