Use importlib.metadata instead of importlib_metadata #66
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
| name : Build Windows Conda Installer | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'releases/**' | |
| - 'testing/**' | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| timeout-minutes: 60 | |
| env: | |
| REPO: https://github.com/biolab/orange3.git | |
| BUILD_BRANCH: master | |
| BUILD_COMMIT: "3.39.0" | |
| BUILD_LOCAL: "" | |
| PYTHONFAULTHANDLER: 1 | |
| PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
| PIP_CACHE_DIR: .pip-cache | |
| PIP_PREFER_BINARY: 1 | |
| CONDA_BUILD_VERSION: "3.26.*" | |
| # CONDA_SPEC_FILE: ..\specs\win\conda-spec.txt | |
| # Quasar | |
| QUASAR_VERSION: "1.12.0" | |
| SPECTROSCOPY_VERSION: "0.8.3" | |
| SNOM_VERSION: "0.0.6" | |
| strategy: | |
| fail-fast: False | |
| matrix: | |
| include: | |
| - python-version: "3.12" | |
| micromamba-version: "2.3.3-0" | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| condarc: >- | |
| channels: | |
| - https://quasar.codes/conda/ | |
| - conda-forge | |
| environment-name: build | |
| create-args: conda conda-build boa python=3.11 | |
| init-shell: bash cmd.exe | |
| generate-run-shell: true | |
| - name: Checkout orange3 | |
| shell: bash | |
| run: | | |
| set -e | |
| git clone -q $REPO | |
| cd orange3 | |
| git fetch origin $BUILD_BRANCH | |
| git checkout $BUILD_COMMIT | |
| - name: Prepare conda packages | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| run: | | |
| if [[ $BUILD_LOCAL ]]; then | |
| conda mambabuild --no-test --python $PYTHON_VERSION ./orange3/conda-recipe | |
| VERSION=$(cd orange3; python setup.py --version) | |
| EXTRA_ARGS=(-c file:///C:/users/runneradmin/micromamba/envs/build/conda-bld) | |
| else | |
| VERSION=$BUILD_COMMIT | |
| EXTRA_ARGS=() | |
| fi | |
| if [[ ! $CONDA_SPEC_FILE ]]; then | |
| micromamba create -p ./env --yes \ | |
| ${EXTRA_ARGS[*]} \ | |
| python=$PYTHON_VERSION \ | |
| numpy=2.1.* \ | |
| scipy=1.13.* \ | |
| scikit-learn=1.5.2 \ | |
| pandas=2.2.* \ | |
| pyqtgraph=0.13.* \ | |
| bottleneck=1.4.* \ | |
| pyqt=5.15.* \ | |
| pyqtwebengine=5.15.* \ | |
| Orange3=$VERSION \ | |
| openTSNE=1.0.1 \ | |
| catboost \ | |
| blas=*=openblas \ | |
| mamba \ | |
| quasar=$QUASAR_VERSION \ | |
| orange-spectroscopy=$SPECTROSCOPY_VERSION \ | |
| orange-snom=$SNOM_VERSION \ | |
| opusFC>=1.3.0 \ | |
| h5py | |
| conda list -p ./env --export --explicit --md5 > env-spec.txt | |
| cat env-spec.txt | |
| echo "CONDA_SPEC_FILE=env-spec.txt" >> $GITHUB_ENV | |
| fi | |
| - name: Build installer | |
| env: | |
| PLATTAG: win_amd64 | |
| MICROMAMBA_VERSION: ${{ matrix.micromamba-version }} | |
| run: | | |
| mkdir dist | |
| export PATH="$(cygpath -u 'C:\Program Files (x86)\NSIS'):$PATH" | |
| echo PATH=$PATH | |
| bash -e ./scripts/windows/build-conda-installer.sh \ | |
| --platform $PLATTAG \ | |
| --cache-dir .cache \ | |
| --dist-dir dist \ | |
| --micromamba-version "$MICROMAMBA_VERSION" \ | |
| --env-spec "$CONDA_SPEC_FILE" \ | |
| --online no | |
| INSTALLER=( dist/Quasar-*.exe ) | |
| SHA256=$( sha256sum -b $INSTALLER ) | |
| echo INSTALLER = $INSTALLER | |
| echo SHA256 = $( sha256sum -b $INSTALLER ) | |
| - name: Upload installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orange-win-conda-installer | |
| path: dist/Quasar-*.exe | |
| if-no-files-found: error | |
| test: | |
| name: Test | |
| needs: build | |
| runs-on: windows-2022 | |
| env: | |
| INSTALL_PATH: "D:\\install path" | |
| steps: | |
| - name: Download installer | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: orange-win-conda-installer | |
| - name: Install | |
| shell: cmd | |
| run: | | |
| rem # Install in silent mode. Output has to be piped somewhere so the installer | |
| rem # runs 'attached' to the console. | |
| for %%s in ( Quasar-*.exe ) do ( set "INSTALLER=%%s" ) | |
| echo INSTALLER = %INSTALLER% | |
| %INSTALLER% /S /D=%INSTALL_PATH% > nul | |
| echo ERRORLEVEL = %ERRORLEVEL% | |
| type "%TEMP%\%INSTALLER%-install-log.txt" | |
| - name: Test conda | |
| shell: cmd | |
| run: | | |
| dir "%INSTALL_PATH%"\Scripts | |
| "%INSTALL_PATH%"\Scripts\conda.bat info | |
| "%INSTALL_PATH%"\Scripts\conda.bat --help | |
| "%INSTALL_PATH%"\Scripts\activate.bat | |
| echo CONDA_PREFIX = %CONDA_PREFIX% | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| PYTHON=$(cygpath -u "$INSTALL_PATH"'\\python') | |
| "$PYTHON" --version | |
| "$PYTHON" -m pip --version | |
| "$PYTHON" -m pip list --format=freeze | |
| # Test that orange and all dependencies are installed in a | |
| # consistent state | |
| #$PYTHON -m pip install --no-index --no-cache-dir orange3 | |
| # Run test suite in the installed environment. | |
| export ORANGE_DEPRECATIONS_ERROR=1 | |
| export PYTHONWARNINGS=module | |
| "$PYTHON" -m unittest -v Orange.tests Orange.widgets.tests | |
| # Quasar specific tests | |
| "$PYTHON" -m unittest -v orangecontrib.spectroscopy.tests | |
| "$PYTHON" -m pip install pytest | |
| "$PYTHON" -m pytest -v --pyargs orangecontrib.snom | |
| "$PYTHON" -m quasar --help | |
| "$PYTHON" -c "import opusFC" |