Skip to content

Commit

Permalink
Simplify CI pipeline (sicpa-dlab#88)
Browse files Browse the repository at this point in the history
* Install poetry using correct Python version

* Explicitly tell pipx to use correct Python version

* Give path instead of version

* Typo

* Update verify.yml

Correct var name

* Re-enable cache

* Revert "Re-enable cache"

This reverts commit 75b785b.

* Remove useless variables

* Remove tox dev dep

Signed-off-by: Sacha Kozma <[email protected]>

* Remove tox leftovers

Signed-off-by: Sacha Kozma <[email protected]>

* Restore flake8 config

Signed-off-by: Sacha Kozma <[email protected]>

---------

Signed-off-by: Sacha Kozma <[email protected]>
  • Loading branch information
yvgny committed Feb 23, 2023
1 parent e5b8eff commit d2f97fa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 120 deletions.
12 changes: 0 additions & 12 deletions tox.ini → .flake8
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
[tox]
isolated_build = true
envlist =
py{311,310,39,38,37}
skip_missing_interpreters = true

[testenv]
whitelist_externals = poetry
commands =
poetry install -v
poetry run pytest

[flake8]
# set the same as 'black' uses
max-line-length = 88
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,21 @@ jobs:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
include:
- {python-version: '3.11', toxenv: py311}
- {python-version: '3.10', toxenv: py310}
- {python-version: '3.9', toxenv: py39}
- {python-version: '3.8', toxenv: py38}
- {python-version: '3.7', toxenv: py37}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
id: setup
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: pipx install poetry --python ${{ steps.setup.outputs.python-path }}

- name: Install dependencies
run: poetry install

- name: Test with pytest
run: poetry run tox -e ${{ matrix.toxenv }}
run: poetry run pytest
8 changes: 1 addition & 7 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,4 @@ To run [pytest](https://docs.pytest.org/en/stable/) in your environment:

```bash
poetry run pytest
```

To run tests in all supported environments (like CI does) using [tox](https://tox.wiki/en/latest/index.html):

```bash
poetry run tox
```
```
93 changes: 3 additions & 90 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ flake8 = "^5.0.4"
black = "^22.10.0"
pytest-mock = "^3.10.0"
mock = "^4.0.3"
tox = "^3.26.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit d2f97fa

Please sign in to comment.