From ac5d460b8322d3e8d64354921582676f42bacdad Mon Sep 17 00:00:00 2001 From: Christophe Pradal Date: Mon, 7 Jul 2025 14:06:44 +0200 Subject: [PATCH 1/3] Create openalea_ci.yml Update CI to new system --- .github/workflows/openalea_ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/openalea_ci.yml diff --git a/.github/workflows/openalea_ci.yml b/.github/workflows/openalea_ci.yml new file mode 100644 index 0000000..ed7d257 --- /dev/null +++ b/.github/workflows/openalea_ci.yml @@ -0,0 +1,23 @@ +name: OpenAlea CI + +on: + push: + branches: + - main + - master + tags: + - 'v*' + pull_request: + types: + - opened + - synchronize + - reopened + release: + types: + - published + +jobs: + build: + uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main + secrets: + anaconda_token: ${{ secrets.ANACONDA_TOKEN }} From 3921aaa3774cd2353a15d234ea141f99dcde908b Mon Sep 17 00:00:00 2001 From: pradal Date: Mon, 7 Jul 2025 14:10:00 +0200 Subject: [PATCH 2/3] Remove old system --- .github/workflows/conda-package-build.yml | 24 ----------------------- 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/conda-package-build.yml diff --git a/.github/workflows/conda-package-build.yml b/.github/workflows/conda-package-build.yml deleted file mode 100644 index e75f2ac..0000000 --- a/.github/workflows/conda-package-build.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: build_publish_anaconda - -on: - push: - branches: - - '**' - tags: - - 'v*' - pull_request: - branches: - - '**' - - -jobs: - build: - uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@label - with: - operating-system: '["ubuntu-latest"]' - build-options: "" - label: latest - python-minor-version: '[10]' - secrets: - anaconda_token: ${{ secrets.ANACONDA_TOKEN }} - From 4f9483c58dcc3629be2887e2ff1486833c1f700b Mon Sep 17 00:00:00 2001 From: pradal Date: Mon, 7 Jul 2025 14:18:47 +0200 Subject: [PATCH 3/3] Update packaging with latest CI --- conda/meta.yaml | 54 +++++++++++++++++++++++++++++-------------------- pyproject.toml | 9 +++++++-- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 817fd40..756358d 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,46 +1,56 @@ {% 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 = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "2.4.4.dev") %} +{% 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', {}).get('environment', {}).get('dependencies',[]) %} + package: - name: {{ pyproject["project"]["name"] }} - version: {{ GIT_DESCRIBE_TAG | replace("v", "") }} + name: {{ name }} + version: {{ version }} source: path: .. build: noarch: python - number: 0 - script: {{PYTHON}} -m pip install . -vv + string: py{{ PY_VER }} + preserve_egg_dir: True + # pip install options mainly ensure that dependencies are handled by conda (and not pip) + # --no-deps ensure pip will not install deps not declared in meta.yaml (but declared in pyproject.toml) + # --no-build-isolation ensure pip will not replace build deps declared in meta.yaml (and declared in pyproject.toml) + # --ignore-installed ensure that compiled files (accidentally present in sources or uncleaned locally) will be overwritten + script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation -vv requirements: - build: - - python {{ pyproject["project"]["requires-python"] }} - {% for dep in pyproject["build-system"]["requires"] %} - - {{ dep.lower() }} - {% endfor %} + host: + - python + {% for dep in build_deps %} + - {{ dep }} + {% endfor %} run: - - python {{ pyproject["project"]["requires-python"] }} - {% for dep in pyproject["project"]["dependencies"] %} - - {{ dep.lower() }} - {% endfor %} - {% for dep in pyproject["tool"]["conda"]["environment"]["dependencies"] %} - - {{ dep.lower() }} + - python + {% for dep in deps + conda_deps %} + - {{ dep }} {% endfor %} test: requires: - pytest + - setuptools imports: - openalea.core source_files: - - test/** - - test/data/** + - test/test_*.py commands: - - cd test - - pytest -v test_*.py + - pytest -v about: - summary: {{ pyproject["project"]["description"] }} - license: {{ pyproject["project"]["license"] }} - home: {{ pyproject["project"]["urls"]["Homepage"] }} + home: {{ home }} + license: {{ license }} + summary: {{ description }} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 64e88da..15dbc72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,9 @@ where = ["src"] # enable dynamic versioning based on git tags [tool.setuptools_scm] # can be empty if no extra settings are needed, presence enables setuptools-scm +fallback_version = "2.4.4.dev0" +version_scheme = "guess-next-dev" +local_scheme = "no-local-version" [project] name = "openalea.core" @@ -61,10 +64,12 @@ dependencies = [ [project.optional-dependencies] test = ["pytest"] doc = [ - "sphinx-favicon", - "sphinx-rtd-theme", "pydata-sphinx-theme", "myst-parser", + "sphinx-favicon", + "ipykernel", + "sphinx-copybutton", + "ipython_genutils", "nbsphinx", ]