Conversation
Codecov Report
@@ Coverage Diff @@
## master #316 +/- ##
=======================================
Coverage 86.80% 86.80%
=======================================
Files 15 15
Lines 879 879
=======================================
Hits 763 763
Misses 116 116 Continue to review full report at Codecov.
|
3a68636 to
03c77b1
Compare
tony
commented
Apr 2, 2022
| {{ env.poetry_virtualenvs_path }} | ||
| key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'poetry' |
Member
Author
There was a problem hiding this comment.
Update (as of actions/setup-python):
When I do this, I've found I had to run poetry env ${{ matrix.python-version }} before poetry install or else it'd use the default python version:
name: tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
curl -O -sSL https://install.python-poetry.org/install-poetry.py
python install-poetry.py -y --version 1.1.12
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
rm install-poetry.py
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
# This is required to do as of @actions/checkout@v3 to prevent default action python (3.8) from being used
poetry env use ${{ matrix.python-version }}
poetry install
- name: Lint with flake8
run: poetry run flake8
- name: Print python versions
run: |
python -V
poetry run python -V
- name: Test with pytest
run: poetry run py.test
Merged
tony
added a commit
that referenced
this pull request
Aug 16, 2022
This was originally added in #316 but retracted due to actions/setup-python#374. In recent versions this python version issue has apparently been fixed.
This was referenced Aug 16, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential bug (as of actions/setup-python v3.1):
Filed a report here: actions/setup-python#374, reproduction: https://github.com/tony/setup-python-poetry-version-example
The workaround for now is to use
poetry env use <python-version>beforepoetry installOriginal message
As of yesterday,
@actions/setup-python@v3supports this via v3.1.0: Release, Tag, actions/setup-python#281See also: python-poetry/poetry#4205