Skip to content

Commit

Permalink
Update tooling (#179)
Browse files Browse the repository at this point in the history
* Use asdf and direnv to install Python and Poetry

* Use tox <4

Newer tox requires a newer importlib-metadata than what Poetry accepts.

* Add Python 3.11 to CI
  • Loading branch information
jodal committed Dec 26, 2022
1 parent 44b9f77 commit e6a1a96
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
layout_poetry() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use `poetry new` or `poetry init` to create one first.'
exit 2
fi

# create venv if it doesn't exist
poetry run true

export VIRTUAL_ENV=$(poetry env info --path)
export POETRY_ACTIVE=1
PATH_add "$VIRTUAL_ENV/bin"
}
layout poetry
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ jobs:
- name: "Test: Python 3.10"
python: "3.10"
tox: py310
- name: "Test: Python 3.11"
python: "3.11"
tox: py311
coverage: true
- name: "Lint: flake8"
python: "3.10"
python: "3.11"
tox: flake8
- name: "Lint: mypy"
python: "3.10"
python: "3.11"
tox: mypy
- name: "Docs"
python: "3.10"
python: "3.11"
tox: docs

name: ${{ matrix.name }}
Expand All @@ -50,7 +53,7 @@ jobs:
key: ${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-${{ hashFiles('pyproject.toml', 'tox.ini') }} }}
restore-keys: |
${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-
- run: python -m pip install poetry==1.3.1 tox==4.0.17
- run: python -m pip install poetry==1.3.1 tox==3.28.0
- run: python -m tox -e ${{ matrix.tox }}
if: ${{ ! matrix.coverage }}
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- run: python -m pip install poetry==1.3.1 tox==4.0.17
python-version: "3.11"
- run: python -m pip install poetry==1.3.1 tox==3.28.0
- run: tox --skip-missing-interpreters true
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
poetry 1.3.1
python 3.11.1 3.10.9 3.9.16 3.8.16 3.7.16
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pytest-mock = "^3.6.1"
tox = "^3.23.1"

[tool.black]
target-version = ["py37", "py38", "py39"]
target-version = ["py37", "py38", "py39", "py310", "py311"]

[tool.isort]
profile = "black"
Expand Down

0 comments on commit e6a1a96

Please sign in to comment.