Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Poetry installation #1252

Merged
merged 2 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install and configure Poetry
uses: snok/install-poetry@v1.1.1
uses: snok/install-poetry@v1.1.6
with:
version: 1.1.4
virtualenvs-create: false
version: 1.1.6
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unintentionally possibly a little confusing. Just to clarify - the version parameter here specifies the Poetry version, while the @1.1.6 specifies the action version. They just happen to be the same.

virtualenvs-in-project: true
- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Format check with black
run: make format-check
run: |
source $VENV
make format-check
Comment on lines +26 to +33
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into some problems with the old setup, so switched from installing dependencies directly inside the runner environment, to installing dependencies to a venv and activating the venv in consequent steps.

Just for context, instead of source $VENV, we could have used source .venv/bin/activate, but since there's a windows combination in the matrix you would need to introduce conditional steps; on Windows you'd want ~source .venv/scripts/activate.

The $VENV environment variable is set inside the install-poetry action so upstream workflows don't need to worry about which OS you're on 🙂

- name: Typecheck with mypy
run: make typecheck
run: |
source $VENV
make typecheck
- name: Test with pytest
run: |
pip install .
python -m pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing
source $VENV
pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing
- name: Upload code coverage
uses: codecov/codecov-action@v1.0.10
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include = ["rich/py.typed"]
[tool.poetry.dependencies]
python = "^3.6"
typing-extensions = {version = "^3.7.4", python = "<3.8"}
dataclasses = {version=">=0.7,<0.9", python = "~3.6"}
dataclasses = {version=">=0.7,<0.9", python = "~3.6"}
pygments = "^2.6.0"
commonmark = "^0.9.0"
colorama = "^0.4.0"
Expand Down