diff --git a/README.md b/README.md index 3dacb87..2265e1d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ In details, this action: 1. Check if `meta.yml` exists in a directory provided in input 2. Sets-up a basic conda environment with a python version specified in input (python 3 only). You can also specify a list of conda channels you migh need during the building process 3. Installs necessary packages for building and publishing (namely `conda-build` and `anaconda-client`) -4. Compiles the package with `conda build` using the `meta.yml` file rules. If your package uses the `numpy` library as a dependency, please be aware that library versions are tied to python version (so far, existing options are `python3.7`:`numpy1.11`, `python3.8`:`numpy1.16`, `python3.9`:`numpy1.19`) +4. Compiles the package with `conda build` using the `meta.yml` file rules. If your package uses the `numpy` library as a dependency, please be aware that library versions are tied to python version at build time if expressed explicitely in the `meta.yml` file (so far, existing options are `python3.7`:`numpy1.11`, `python3.8`:`numpy1.16`, `python3.9`:`numpy1.19`). Otherwise, `numpy` minor version used at build time can be expressed explicitely in input (cf. bellow). 5. Uploads the package on anaconda.org with `anaconda upload` using a token to access your repository or the one of your organization (cf. procedure [here](#anaconda_token)) The only mandatory input is the anaconda token to access your anaconda repository. @@ -83,6 +83,7 @@ jobs: conda: conda mamba: true python: ${{ matrix.python-minor-version }} + numpy: '20.0' channels: openalea3, conda-forge token: ${{ secrets.ANACONDA_TOKEN }} publish: ${{ steps.publish.outputs.value }} @@ -121,6 +122,7 @@ The following inputs are available for this action: |------|-------------|----------|---------------| |`conda`| Directory with conda recipe (i.e. `meta.yml` file)| No | `.`| |`python`| Python3 minor version used for building | No | `9` | +|`numpy`| Numpy minor version used for building | No | `''` (fixed by python version)| |`mamba`| Use mamba to setup miniconda and install in a faster way or not. Uses the latest available version. | No | `false`| |`token` | Anaconda access Token (cf. use process described [above](#anaconda_token))| Yes | | |`channels`| Optional Extra anaconda channels to use. Coma-separated syntax | No | `conda-forge`| diff --git a/action.yml b/action.yml index a53496b..394f801 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,10 @@ inputs: description: 'Python3 minor version used for building. Default `9`.' required: false default: '9' + numpy: + description: 'Numpy minor version used for building. Default is fixed by Python version.' + required: false + default: '' token: description: 'Anaconda access Token (required)' required: true @@ -70,17 +74,22 @@ runs: working-directory: ./${{ inputs.conda }} run: | echo "::group::Conda packages building" - echo "Associate numpy version to python version provided" - export PYTHON_VERSION="3.${{ inputs.python }}" - if [[ ${PYTHON_VERSION} = "3.7" ]]; then - export NUMPY_VERSION="1.11" - elif [[ ${PYTHON_VERSION} = "3.8" ]]; then - export NUMPY_VERSION="1.16" - elif [[ ${PYTHON_VERSION} = "3.9" ]]; then - export NUMPY_VERSION="1.19" + if [[ ${{ inputs.numpy }} = '' ]]; then + echo "Associate numpy version to python version provided" + export PYTHON_VERSION="3.${{ inputs.python }}" + if [[ ${PYTHON_VERSION} = "3.7" ]]; then + export NUMPY_VERSION="1.11" + elif [[ ${PYTHON_VERSION} = "3.8" ]]; then + export NUMPY_VERSION="1.16" + elif [[ ${PYTHON_VERSION} = "3.9" ]]; then + export NUMPY_VERSION="1.19" + else + echo "Unable to build the package with this version of python (yet). Please choose a subversion of Python3: 7, 8 or 9" + exit 1 + fi else - echo "Unable to build the package with this version of python (yet). Please choose a subversion of Python3: 7, 8 or 9" - exit 1 + export NUMPY_VERSION="1.${{ inputs.numpy }}" + echo "Numpy version provided is ${NUMPY_VERSION}" fi out_dir=`mktemp -d conda-build-dir.XXXXXX` echo "Running 'conda build' with python ${PYTHON_VERSION} and numpy ${NUMPY_VERSION}"