-
Notifications
You must be signed in to change notification settings - Fork 11
Conda packaging #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conda packaging #131
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e38a66b
Better conda-packaging
a3cd567
fixing ci parameter name
AurelienBesnier f1fa09e
Removing unused version file
AurelienBesnier f224bde
Update __init__.py
pradal 2cfbf48
Update environment.yml
pradal a0bfb30
Updating conda deps
AurelienBesnier 635d1e2
Merge branch 'conda_packaging' of github.com:openalea/hydroshoot into…
AurelienBesnier d0ff782
Update github action
AurelienBesnier d44d595
Update conda section
AurelienBesnier e214a3a
Update meta.yaml to guidelines
AurelienBesnier 95a1a04
Update dev package name
AurelienBesnier fb656fe
Adding missing build string
AurelienBesnier 67498e0
Update pyproject.toml for version management
AurelienBesnier 743f62a
Update pyproject.toml Framework + fallback_version
AurelienBesnier aa91936
Adding setuptools_scm
AurelienBesnier b138d15
Adding eol
AurelienBesnier 608f2c1
Using openalea.caribu
AurelienBesnier ffe774a
fix errors in environment.yml
pradal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,23 @@ | ||
| name: Building Package | ||
| name: OpenAlea CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| - main | ||
| - master | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
|
|
||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| jobs: | ||
| build: | ||
| 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 }} | ||
| anaconda_token: ${{ secrets.ANACONDA_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,60 @@ | ||
| 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 = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "0.0.0.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',[]) %} | ||
| {% set test_deps = pyproject.get('project', {}).get('optional-dependencies', {}).get('test',[]) %} | ||
|
|
||
| package: | ||
| name: {{ name }} | ||
| version: {{ version }} | ||
|
|
||
| source: | ||
| git_url: ../ | ||
| path: .. | ||
|
|
||
| build: | ||
| noarch: python | ||
| string: py{{ PY_VER }} | ||
| 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 | ||
| - setuptools_scm | ||
| {% for dep in build_deps %} | ||
| - {{ 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: | ||
| - {{ name }} | ||
| requires: | ||
| - pytest | ||
| source_files: | ||
| - test/ | ||
| commands: | ||
| - pytest -v | ||
|
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] | ||
|
|
@@ -11,21 +11,17 @@ 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", | ||
| "Framework :: OpenAlea", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Topic :: Scientific/Engineering", | ||
| ] | ||
|
|
||
|
|
@@ -55,11 +51,31 @@ 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] | ||
| # Format version to ease alignment with conda/meta.yaml tag-based versioning | ||
| fallback_version = "5.2.2.dev0" | ||
| version_scheme = "guess-next-dev" | ||
| local_scheme = "no-local-version" | ||
|
|
||
| [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", | ||
| "openalea.caribu", | ||
| "openalea.astk", | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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