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

fix: Use pipx to run tox in CI template #1482

Merged
merged 1 commit into from
Mar 6, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,43 @@ on: [push]

jobs:
linting:

runs-on: ubuntu-latest
strategy:
matrix:
# Only lint using the primary version used for dev
python-version: [3.9]

python-version: ["3.9"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry==1.2.*
- name: Install dependencies
- name: Install pipx and Poetry
run: |
poetry install
pip install pipx poetry
- name: Run lint command from tox.ini
run: |
poetry run tox -e lint
pipx run tox -e lint

pytest:

runs-on: ubuntu-latest
env:
GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: {{ '${{ matrix.python-version }}' }}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry==1.2.*
pip install poetry
- name: Install dependencies
run: |
poetry install
- name: Test with pytest
run: |
poetry run pytest --capture=no
poetry run pytest
6 changes: 2 additions & 4 deletions cookiecutter/tap-template/{{cookiecutter.tap_id}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy

[tox]
envlist = py38
; envlist = py37, py38, py39
envlist = py39
isolated_build = true

[testenv]
allowlist_externals = poetry

commands =
poetry install -v
poetry run pytest
Expand All @@ -19,7 +17,7 @@ commands =
[testenv:pytest]
# Run the python tests.
# To execute, run `tox -e pytest`
envlist = py37, py38, py39
envlist = py37, py38, py39, py310, py311
commands =
poetry install -v
poetry run pytest
Expand Down