remove setup-python from setup_env action
This commit is contained in:
parent
62fd2ba154
commit
9303a233bc
|
@ -1,4 +1,4 @@
|
|||
name: "Set up python and conda environment"
|
||||
name: "Set up conda environment"
|
||||
description:
|
||||
"This action creates a conda environment containing a given python version
|
||||
and set of requirements. It caches the environment and restores it from
|
||||
|
@ -7,17 +7,11 @@ description:
|
|||
requirements, and the number of the week in the year, so that the cache
|
||||
refreshes weekly."
|
||||
inputs:
|
||||
setup-python:
|
||||
description: "Whether to run the setup-python action"
|
||||
required: false
|
||||
default: 'true'
|
||||
python:
|
||||
description: "Path to python executable to use"
|
||||
description:
|
||||
"Path to python executable to use to run convert-requirements-to-conda-yml.py"
|
||||
required: false
|
||||
default: 'python'
|
||||
python-version:
|
||||
description: "Python version to install"
|
||||
required: true
|
||||
requirements-files:
|
||||
description:
|
||||
"List of requirements files to install from. May be separated by spaces
|
||||
|
@ -33,15 +27,6 @@ inputs:
|
|||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# set up python that's used below to run convert-requirements-to-conda-yml.py
|
||||
# after the environment is updated, 'python' will point to the
|
||||
# conda-managed python and this python won't be used again
|
||||
- name: Set up python
|
||||
uses: actions/setup-python@v4
|
||||
if: ${{ inputs.setup-python == 'true' }}
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
|
||||
# save week number to use in next step
|
||||
# save CONDA_PREFIX to GITHUB_ENV so it's accessible outside of shell commands
|
||||
- name: Set environment variables
|
||||
|
@ -54,7 +39,6 @@ runs:
|
|||
shell: bash
|
||||
run: |
|
||||
# make sure each package is separated by a newline
|
||||
echo "python=${{ inputs.python-version }}" > extra_requirements.txt
|
||||
echo "${{ inputs.requirements }}" | xargs | tr " " "\n" >> extra_requirements.txt
|
||||
|
||||
- name: Combine all requirements into environment YML
|
||||
|
|
|
@ -148,9 +148,8 @@ jobs:
|
|||
if: matrix.os != 'ubuntu-latest'
|
||||
uses: ./.github/actions/setup_env
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
requirements-files: requirements.txt requirements-dev.txt constraints_tests.txt
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }}
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} python=${{ matrix.python-version }}
|
||||
|
||||
- name: Set up python environment (Ubuntu)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
@ -158,10 +157,12 @@ jobs:
|
|||
env:
|
||||
HOME: ${{ matrix.setup-conda-home }}
|
||||
with:
|
||||
setup-python: false
|
||||
python: /opt/python/cp39-cp39/bin/python
|
||||
requirements-files: requirements.txt requirements-dev.txt constraints_tests.txt
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} sqlite<3.49.1 # https://github.com/natcap/invest/issues/1797
|
||||
requirements: |
|
||||
${{ env.CONDA_DEFAULT_DEPENDENCIES }}
|
||||
python=${{ matrix.python-version }}
|
||||
sqlite<3.49.1 # https://github.com/natcap/invest/issues/1797
|
||||
|
||||
- name: shell init (Ubuntu)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
@ -256,9 +257,8 @@ jobs:
|
|||
|
||||
- uses: ./.github/actions/setup_env
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
requirements-files: requirements.txt
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} twine
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} python=${{ matrix.python-version }} twine
|
||||
|
||||
- name: Build source distribution
|
||||
run: |
|
||||
|
@ -321,9 +321,11 @@ jobs:
|
|||
|
||||
- uses: ./.github/actions/setup_env
|
||||
with:
|
||||
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
|
||||
requirements-files: requirements.txt
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} pytest
|
||||
requirements: |
|
||||
${{ env.CONDA_DEFAULT_DEPENDENCIES }}
|
||||
python=${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
|
||||
pytest
|
||||
|
||||
- name: Make install
|
||||
run: make install
|
||||
|
@ -353,9 +355,10 @@ jobs:
|
|||
- name: Set up python environment
|
||||
uses: ./.github/actions/setup_env
|
||||
with:
|
||||
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
|
||||
requirements-files: requirements.txt requirements-dev.txt
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }}
|
||||
requirements: |
|
||||
${{ env.CONDA_DEFAULT_DEPENDENCIES }}
|
||||
python=${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
|
||||
|
||||
- name: Make install
|
||||
run: make install
|
||||
|
@ -410,13 +413,15 @@ jobs:
|
|||
- name: Set up conda environment
|
||||
uses: ./.github/actions/setup_env
|
||||
with:
|
||||
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
|
||||
requirements-files: |
|
||||
requirements.txt
|
||||
requirements-dev.txt
|
||||
requirements-docs.txt
|
||||
constraints_tests.txt
|
||||
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} pandoc
|
||||
requirements: |
|
||||
${{ env.CONDA_DEFAULT_DEPENDENCIES }}
|
||||
python=${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
|
||||
pandoc
|
||||
|
||||
- name: Make install
|
||||
run: make install
|
||||
|
|
Loading…
Reference in New Issue