Skip to content

Commit

Permalink
feat: Support under specified versions of Python
Browse files Browse the repository at this point in the history
This change allows you to under specify a version of Python, such as
dropping the patch version number, and the action will still work. This
works even if you drop the minor version number and the patch version
number.

We're using the https://github.com/momo-lab/xxenv-latest plugin to find
the latest version of Python based on whatever version you gave it.

Fixes #12
  • Loading branch information
abatilo committed Dec 18, 2019
1 parent 22c5f8e commit ca9b566
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
ci:
strategy:
matrix:
python_version: [3.5.9, 3.7.0, 3.8.0]
python_version: [3.5, 3.6, 3.7, 3.8]
poetry_version: [0.12.17]
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ RUN apt-get update \
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT && \
rm -rfv $PYENV_ROOT/.git

# Install xxenv-latest, for inferring latest version of python
RUN git clone https://github.com/momo-lab/xxenv-latest.git $PYENV_ROOT/plugins/xxenv-latest

COPY requirements.txt entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
python_version:
description: 'The version of python to install'
required: true
default: '3.8.0'
default: '3.8'
poetry_version:
description: 'The version of poetry to install'
required: true
Expand Down
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh
set -e
pythonVersion="$INPUT_PYTHON_VERSION"
poetryVersion="$INPUT_POETRY_VERSION"
pyenv install $pythonVersion
pyenv latest install $pythonVersion
pyenv global $pythonVersion
pip install -r /requirements.txt
pip install poetry==$poetryVersion
Expand Down

0 comments on commit ca9b566

Please sign in to comment.