Skip to content

Commit 4b076af

Browse files
committed
updated CI and pckging
1 parent b1c9f30 commit 4b076af

File tree

6 files changed

+999
-40
lines changed

6 files changed

+999
-40
lines changed
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
name: build_publish_anaconda
1+
name: OpenAlea CI
22

33
on:
44
push:
55
branches:
6-
- '**'
6+
- main
7+
- master
78
tags:
89
- 'v*'
910
pull_request:
10-
branches:
11-
- '**'
11+
types:
12+
- opened
13+
- synchronize
14+
- reopened
15+
release:
16+
types:
17+
- published
1218

1319
jobs:
1420
build:
15-
uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main
21+
uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main
1622
secrets:
1723
anaconda_token: ${{ secrets.ANACONDA_TOKEN }}
24+
1825
with:
19-
python-minor-version: '[10]'
20-
label: latest
26+
force-channel-priority: conda-forge, openalea3/label/dev, openalea3
27+
operating-system: '["ubuntu-latest", "macos-13", "windows-latest"]' # because of plantgl

.readthedocs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "mambaforge-22.9"
7+
8+
conda:
9+
environment: conda/environment.yml
10+
11+
sphinx:
12+
# Path to your Sphinx configuration file.
13+
configuration: doc/conf.py

conda/environment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: rsml_dev
2+
channels:
3+
- conda-forge
4+
- openalea3
5+
dependencies:
6+
- matplotlib
7+
- pandas
8+
- xlsxwriter
9+
- path
10+
- numpy
11+
- openalea.mtg
12+
# let pip install the rest using pyproject.toml (if you are okay with conda/pip mix)
13+
- pip:
14+
- -e .."[doc, test]"

conda/meta.yaml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
22
{% set name = pyproject.get('project').get('name') %}
3-
#{% set version = GIT_DESCRIBE_TAG | replace("v", "") %}
4-
{% set version = "1.4.0" %}
3+
{% set description = pyproject.get('project').get('description') %}
4+
{% set version = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "0.0.0.dev") %}
5+
{% set license = pyproject.get('project').get('license') %}
6+
{% set home = pyproject.get('project', {}).get('urls', {}).get('Homepage', '') %}
7+
{% set build_deps = pyproject.get("build-system", {}).get("requires", []) %}
8+
{% set deps = pyproject.get('project', {}).get('dependencies', []) %}
9+
{% set conda_deps = pyproject.get('tool', {}).get('conda', {}).get('environment', {}).get('dependencies',[]) %}
10+
{% set test_deps = pyproject.get('project', {}).get('optional-dependencies', {}).get('test',[]) %}
511

612
package:
713
name: {{ name }}
@@ -13,40 +19,46 @@ source:
1319
build:
1420
noarch: python
1521
number: 0
16-
script_env:
17-
- SETUPTOOLS_SCM_PRETEND_VERSION={{version}}
18-
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation -vv
22+
preserve_egg_dir: True
23+
string: py{{ PY_VER }}
24+
script:
25+
- {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation -vv
1926

2027
requirements:
28+
host:
29+
- python
30+
{% for dep in build_deps %}
31+
- {{ dep }}
32+
{% endfor %}
33+
2134
build:
22-
- python {{ pyproject["project"]["requires-python"] }}
23-
{% for dep in pyproject["build-system"]["requires"] %}
24-
- {{ dep.lower() }}
25-
{% endfor %}
35+
- {{ compiler("cxx") }}
2636

2737
run:
28-
- python {{ pyproject["project"]["requires-python"] }}
29-
{% for dep in pyproject["project"]["dependencies"] %}
30-
- {{ dep.lower() }}
31-
{% endfor %}
32-
{% for dep in pyproject["tool"]["conda"]["environment"]["dependencies"] %}
33-
- {{ dep.lower() }}
38+
- python
39+
{% for dep in deps + conda_deps %}
40+
- {{ dep }}
3441
{% endfor %}
3542

43+
3644
test:
3745
requires:
38-
- pytest
46+
{% for dep in test_deps %}
47+
- {{ dep }}
48+
{% endfor %}
49+
3950
imports:
4051
- rsml
52+
4153
source_files:
4254
- test/**
4355
- test/data/**
56+
4457
commands:
4558
- cd test
46-
- pytest -v
59+
- pytest -v
4760

4861
about:
49-
summary: {{ pyproject["project"]["description"] }}
50-
license: {{ pyproject["project"]["license"] }}
51-
home: {{ pyproject["project"]["urls"]["Homepage"] }}
52-
62+
home: {{ home }}
63+
summary: {{ description }}
64+
license: {{ license }}

doc/conf.py

Lines changed: 147 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,151 @@
1-
import os,sys
1+
# -*- coding: utf-8 -*-
2+
import sys
3+
import os
24

3-
# read sphinx conf.py file
4-
from openalea.misc.sphinx_configuration import *
5-
from openalea.misc.sphinx_tools import sphinx_check_version
6-
from openalea.deploy.metainfo import read_metainfo
5+
import pydata_sphinx_theme # Pydata theme: https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html
76

8-
sphinx_check_version() # check that sphinx version is recent
9-
metadata = read_metainfo('../metainfo.ini') # read metainfo from common file with setup.py
10-
for key in ['version','project','release', 'name']:
11-
exec("%s = '%s'" % (key, metadata[key]))
127

13-
# by product that need to be updated:
14-
latex_documents = [('contents', 'main.tex', project + ' documentation', authors, 'manual')]
8+
# Get the project root dir, which is the parent dir of this
9+
cwd = os.getcwd()
10+
project_root = os.path.dirname(cwd)
1511

16-
project = name
12+
# Insert the project root dir as the first element in the PYTHONPATH.
13+
# This lets us ensure that the source package is imported, and that its
14+
# version is used.
15+
sys.path.insert(0, os.path.join(project_root, 'src'))
16+
17+
# -- General configuration ------------------------------------------------
18+
# Add any Sphinx extension module names here, as strings. They can be
19+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
20+
# ones.
21+
extensions = [
22+
'sphinx.ext.autodoc', # support for automatic inclusion of docstring
23+
'sphinx.ext.autosummary', # generates autodoc summaries
24+
'sphinx.ext.doctest', # inclusion and testing of doctest code snippets
25+
'sphinx.ext.intersphinx', # support for linking to other projects
26+
'sphinx.ext.mathjax', # support for math equations
27+
'sphinx.ext.ifconfig', # support for conditional content
28+
'sphinx.ext.viewcode', # support for links to source code
29+
'sphinx.ext.coverage', # includes doc coverage stats in the documentation
30+
'sphinx.ext.todo', # support for todo items
31+
'sphinx.ext.napoleon', # support for numpy and google style docstrings
32+
"sphinx_favicon", # support for favicon
33+
"nbsphinx", # for integrating jupyter notebooks
34+
"myst_parser" # for parsing .md files
35+
]
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
autosummary_generate = True
39+
exclude_patterns = ['_build', '_templates']
40+
# The suffix(es) of source filenames.
41+
# You can specify multiple suffix as a list of string:
42+
source_suffix = {
43+
'.rst': 'restructuredtext',
44+
'.md': 'markdown',
45+
}
46+
# The master toctree document.
47+
master_doc = 'index'
48+
# General information about the project.
49+
project = u'rsml'
50+
copyright = u'Cecill-C INRAE / INRIA / CIRAD'
51+
author = u'Christophe Pradal'
52+
53+
# The version info for the project you're documenting, acts as replacement for
54+
# |version| and |release|, also used in various other places throughout the
55+
# built documents.
56+
#
57+
pkgver={}
58+
with open("../src/rsml/version.py") as fp:
59+
exec(fp.read(), pkgver)
60+
# The short X.Y version.
61+
version = str(pkgver["MAJOR"])+'.'+str(pkgver["MINOR"])
62+
# The full version, including alpha/beta/rc tags.
63+
release = pkgver["__version__"]
64+
65+
# The language for content autogenerated by Sphinx. Refer to documentation
66+
# for a list of supported languages.
67+
#
68+
# This is also used if you do content translation via gettext catalogs.
69+
# Usually you set "language" from the command line for these cases.
70+
language = "en"
71+
# The name of the Pygments (syntax highlighting) style to use.
72+
pygments_style = 'sphinx'
73+
# If true, `todo` and `todoList` produce output, else they produce nothing.
74+
todo_include_todos = False
75+
76+
# -- Options for HTML output ----------------------------------------------
77+
# The theme to use for HTML and HTML Help pages. See the documentation for
78+
# a list of builtin themes.
79+
html_theme = 'pydata_sphinx_theme'
80+
# Theme options are theme-specific and customize the look and feel of a theme
81+
# further. For a list of options available for each theme, see the
82+
# documentation.
83+
html_theme_options = {
84+
"header_links_before_dropdown": 6,
85+
"sidebarwidth": 200,
86+
"sticky_navigation": "false",
87+
"collapse_navigation": "false",
88+
"display_version": "true",
89+
"icon_links": [
90+
{
91+
"name": "GitHub",
92+
"url": "https://github.com/openalea/openalea.rtfd.io",
93+
"icon": "fa-brands fa-github",
94+
},
95+
],
96+
"show_version_warning_banner": True,
97+
"footer_start": ["copyright"],
98+
"footer_center": ["sphinx-version"],
99+
"secondary_sidebar_items": {
100+
"**/*": ["page-toc", "edit-this-page", "sourcelink"],
101+
"examples/no-sidebar": [],
102+
},
103+
}
104+
# Add any paths that contain custom static files (such as style sheets) here,
105+
# relative to this directory. They are copied after the builtin static files,
106+
# so a file named "default.css" will overwrite the builtin "default.css".
107+
html_static_path = ['_static']
108+
html_logo = "_static/openalea_web.svg"
109+
html_favicon = "_static/openalea_web.svg"
110+
# If false, no module index is generated.
111+
html_domain_indices = True
112+
# If false, no index is generated.
113+
html_use_index = True
114+
# If true, the index is split into individual pages for each letter.
115+
html_split_index = False
116+
# If true, links to the reST sources are added to the pages.
117+
html_show_sourcelink = True
118+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
119+
html_show_sphinx = True
120+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
121+
html_show_copyright = True
122+
# Output file base name for HTML help builder.
123+
htmlhelp_basename = 'rsml_documentation'
124+
125+
# -- Options for LaTeX output ---------------------------------------------
126+
latex_elements = {
127+
}
128+
latex_documents = [
129+
(master_doc, 'rsml.tex', u'rsml Documentation',
130+
u'INRAE / inria / CIRAD', 'manual'),
131+
]
132+
133+
# -- Options for manual page output ---------------------------------------
134+
# One entry per manual page. List of tuples
135+
# (source start file, name, description, authors, manual section).
136+
man_pages = [
137+
(master_doc, 'rsml', u'rsml Documentation',
138+
[author], 1)
139+
]
140+
141+
# -- Options for Texinfo output -------------------------------------------
142+
# Grouping the document tree into Texinfo files. List of tuples
143+
# (source start file, target name, title, author,
144+
# dir menu entry, description, category)
145+
texinfo_documents = [
146+
(master_doc, 'rsml', u'rsml Documentation',
147+
author, 'rsml', 'RootSystemML (RSML) is a file format to represent root architectural data.',
148+
'Miscellaneous'),
149+
]
150+
# Example configuration for intersphinx: refer to the Python standard library.
151+
intersphinx_mapping = {'python': ('https://docs.python.org/', None)}

0 commit comments

Comments
 (0)