Skip to content
Closed
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
24 changes: 0 additions & 24 deletions .github/workflows/conda-package-build.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/openalea_ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}
54 changes: 32 additions & 22 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
]

Expand Down
Loading