From 7780a7b695e854c983eb8859a370fa1d7bcb60ab Mon Sep 17 00:00:00 2001 From: pradal Date: Mon, 12 Feb 2024 23:44:38 +0100 Subject: [PATCH 1/3] Launch the web application with the command strawberry --- .appveyor.yml | 52 ---------------------- metainfo.ini | 18 -------- setup.py | 9 +++- src/openalea/strawberry/application/run.py | 22 +++++++++ 4 files changed, 29 insertions(+), 72 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 metainfo.ini create mode 100644 src/openalea/strawberry/application/run.py diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 9d3e65f..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,52 +0,0 @@ -platform: - - x64 - -environment: - CONDA_RECIPE: conda - CONDA_VERSION: 3 - - matrix: - - CONDA_PY: 37 - CONDA_NPY: 111 - - CONDA_PY: 38 - CONDA_NPY: 116 - - CONDA_PY: 39 - CONDA_NPY: 119 - - -install: - - git clone https://github.com/OpenAlea/appveyor-ci.git - - cd appveyor-ci - - call install.bat - - conda config --prepend channels conda-forge - - conda config --prepend channels openalea3 - -before_build: - - call before_build.bat - -build_script: - - call build_script.bat - -after_build: - - call after_build.bat - -deploy: - provider: Script - -before_deploy: - - call before_deploy.bat - -deploy_script: - - call deploy_script.bat - -after_deploy: - - call after_deploy.bat - -on_success: - - call on_success.bat - -on_failure: - - call on_failure.bat - -on_finish: - - call on_finish.bat \ No newline at end of file diff --git a/metainfo.ini b/metainfo.ini deleted file mode 100644 index d801a91..0000000 --- a/metainfo.ini +++ /dev/null @@ -1,18 +0,0 @@ - -[metainfo] -version = 1.0.0 -release = 1.0 -; must be in [openalea, vplants, alinea] -project = openalea -; the filename of the egg -name = OpenAlea.Strawberry -; default namespace -namespace = openalea -; package is going to be used by Sphinx to create the title -package = OpenAlea.Strawberry -description= Strawberry package for . -long_description= The Strawberry package is a typical package example to help developper to create their own package, compatible with OpenAlea standards. -authors= XXX -authors_email = XXX@XXX -url = http://openalea.gforge.inria.fr -license = Cecill-C diff --git a/setup.py b/setup.py index b9dbdae..5c23524 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_namespace_packages name = 'OpenAlea.Strawberry' -version = '1.1.1' +version = '1.2.0' description = "Strawberry is a package for architecture analysis and 2D/3D reconstruction." long_description = open('README.md').read() @@ -57,5 +57,10 @@ package_data={'': ['*.csv', '*.mtg', '*.R*', '*.ipynb']}, # Declare scripts and wralea as entry_points (extensions) of your package - entry_points={'wralea': ['strawberry = openalea.strawberry_wralea']}, + entry_points={ + 'wralea': ['strawberry = openalea.strawberry_wralea'], + 'console_script': [ + 'strawberry = openalea.strawberry.application.run:main' # Define a console script to run your Voilà app + ] + }, ) diff --git a/src/openalea/strawberry/application/run.py b/src/openalea/strawberry/application/run.py new file mode 100644 index 0000000..6cbbb5c --- /dev/null +++ b/src/openalea/strawberry/application/run.py @@ -0,0 +1,22 @@ +from voila.app import Voila +from voila.configuration import VoilaConfiguration + +def main(): + config = VoilaConfiguration() + + + + config.template = 'vuetify-default' + config.enable_nbextensions = True + config.file_whitelist = [r".*\.(png|jpg|gif|svg|mp4|avi|ogg|html|py|js)"] + + app = Voila() + app.voila_configuration = config + app.notebook_path="Strawberry Application.ipynb" + app.setup_template_dirs() + # Launch your Voilà app here + + app.start() + +if __name__ == "__main__": + main() From f93f519b21d200a6cf53b98babc07d856f4a7f32 Mon Sep 17 00:00:00 2001 From: pradal Date: Mon, 12 Feb 2024 23:46:09 +0100 Subject: [PATCH 2/3] Update version --- conda/meta.yaml | 1 - doc/environment.yml | 2 +- doc/requirements.txt | 19 ------------------- doc/source/conf.py | 2 +- 4 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 doc/requirements.txt diff --git a/conda/meta.yaml b/conda/meta.yaml index 4cf1c8f..a41b4a4 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -8,7 +8,6 @@ source: path: .. build: - noarch: python preserve_egg_dir: True number: 0 script: {{PYTHON}} setup.py install diff --git a/doc/environment.yml b/doc/environment.yml index 66e477c..0ea7983 100755 --- a/doc/environment.yml +++ b/doc/environment.yml @@ -8,4 +8,4 @@ dependencies: - sphinx_rtd_theme - openalea.strawberry - nbsphinx - - nbsphinx-link \ No newline at end of file + - nbsphinx-link diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 0b5e76a..0000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ - -python=3.8 -pandas -k3d -jupyter -voila -voila-vuetify -nodejs -cufflinks-py -ipyvuetify -qgrid -plotly -pyvis -matplotlib - -openalea.deploy -openalea.mtg -openalea.plantgl -openalea.lpy diff --git a/doc/source/conf.py b/doc/source/conf.py index a181b5f..4cbc3cf 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,7 +22,7 @@ author = 'Marc Labadie, Christophe Pradal, Gaetan Heidsieck' # The full version, including alpha/beta/rc tags -release = '1.1.1' +release = '1.2.0' # -- General configuration --------------------------------------------------- From 7b4a55c68421e3ed4bea93531553482a24861319 Mon Sep 17 00:00:00 2001 From: pradal Date: Tue, 13 Feb 2024 00:07:09 +0100 Subject: [PATCH 3/3] Fix the notebook path of the app --- setup.py | 2 +- src/openalea/strawberry/application/run.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5c23524..b3248c2 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ # Declare scripts and wralea as entry_points (extensions) of your package entry_points={ 'wralea': ['strawberry = openalea.strawberry_wralea'], - 'console_script': [ + 'console_scripts': [ 'strawberry = openalea.strawberry.application.run:main' # Define a console script to run your Voilà app ] }, diff --git a/src/openalea/strawberry/application/run.py b/src/openalea/strawberry/application/run.py index 6cbbb5c..d9626a6 100644 --- a/src/openalea/strawberry/application/run.py +++ b/src/openalea/strawberry/application/run.py @@ -1,3 +1,4 @@ +from pathlib import Path from voila.app import Voila from voila.configuration import VoilaConfiguration @@ -12,7 +13,10 @@ def main(): app = Voila() app.voila_configuration = config - app.notebook_path="Strawberry Application.ipynb" + + nb_file = Path(__file__)/'..'/r"Strawberry Application.ipynb" + nb_file = str(nb_file.resolve()) + app.notebook_path=nb_file app.setup_template_dirs() # Launch your Voilà app here