Skip to content

Commit

Permalink
feat: Support under specified versions of Python (#13)
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 a7c27cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
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
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
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
5 changes: 3 additions & 2 deletions entrypoint.sh
@@ -1,8 +1,9 @@
#!/bin/sh
set -e
pythonVersion="$INPUT_PYTHON_VERSION"
poetryVersion="$INPUT_POETRY_VERSION"
pyenv install $pythonVersion
pyenv global $pythonVersion
pyenv latest install $pythonVersion
pyenv latest global $pythonVersion
pip install -r /requirements.txt
pip install poetry==$poetryVersion
pyenv rehash
Expand Down

0 comments on commit a7c27cf

Please sign in to comment.