diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0020da1a..a0e8897ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -287,6 +287,18 @@ jobs: if ( ls ${ORION_PREFIX}/orion-dashboard/build/static/js/main.*.js ); then true; else false; fi echo Check if frontend script can find dashboard build python -c "from orion.core.cli.frontend import get_dashboard_build_path; get_dashboard_build_path();" + + echo Check if frontend script can find dashboard build on sys.prefix/local + mkdir -p ${ORION_PREFIX}/local/ + mv ${ORION_PREFIX}/orion-dashboard ${ORION_PREFIX}/local/orion-dashboard + if ( [ -d "${ORION_PREFIX}/orion-dashboard" ] ); then false; else true; fi + if ( [ -d "${ORION_PREFIX}/local/orion-dashboard" ] ); then true; else false; fi + python -c "from orion.core.cli.frontend import get_dashboard_build_path; get_dashboard_build_path();" + echo Move build back to initial installation + mv ${ORION_PREFIX}/local/orion-dashboard ${ORION_PREFIX}/orion-dashboard + if ( [ -d "${ORION_PREFIX}/orion-dashboard" ] ); then true; else false; fi + if ( [ -d "${ORION_PREFIX}/local/orion-dashboard" ] ); then false; else true; fi + echo Clean-up pip uninstall -y orion echo Check if dashboard build is correctly removed diff --git a/conda/ci_build.sh b/conda/ci_build.sh index f286d75ea..7b9e2e978 100755 --- a/conda/ci_build.sh +++ b/conda/ci_build.sh @@ -11,14 +11,15 @@ conda config --set channel_priority strict pip uninstall -y setuptools conda install -c anaconda setuptools +conda install conda-build conda update -q conda conda info -a conda install conda-build anaconda-client -conda build conda --python 3.7 -conda build conda --python 3.8 -conda build conda --python 3.9 +conda-build conda --python 3.7 +conda-build conda --python 3.8 +conda-build conda --python 3.9 # Conda 3.10 does not work because of a bug inside conda itself # conda build conda --python 3.10 diff --git a/src/orion/core/cli/frontend.py b/src/orion/core/cli/frontend.py index accf35df4..1fedf5415 100644 --- a/src/orion/core/cli/frontend.py +++ b/src/orion/core/cli/frontend.py @@ -29,12 +29,25 @@ def get_dashboard_build_path(): https://docs.python.org/3/distutils/setupscript.html#installing-additional-files Otherwise, dashboard build should be in dashboard folder near src in orion repository. + + NB (2023/02/20): It seems that, depending on installation, additional files may + be installed in `/local` instead of just ``. + More info: + https://stackoverflow.com/questions/14211575/any-python-function-to-get-data-files-root-directory#comment99087548_14211600 """ current_file_path = __file__ if current_file_path.startswith(sys.prefix): dashboard_build_path = os.path.join(sys.prefix, "orion-dashboard", "build") + if not os.path.isdir(dashboard_build_path): + dashboard_build_path = os.path.join( + sys.prefix, "local", "orion-dashboard", "build" + ) elif current_file_path.startswith(site.USER_BASE): dashboard_build_path = os.path.join(site.USER_BASE, "orion-dashboard", "build") + if not os.path.isdir(dashboard_build_path): + dashboard_build_path = os.path.join( + site.USER_BASE, "local", "orion-dashboard", "build" + ) else: dashboard_build_path = os.path.abspath( os.path.join(