Add 3.12 to CI (#3863)

Adds Python 3.12 to CI.
Because `tree-sitter`/`tree-sitter-languages` can't be installed on 3.12 yet, we need to run slightly different commands when installing dependencies/running tests on 3.12.

See for more context: https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476
This commit is contained in:
Rodrigo Girão Serrão
2023-12-14 10:42:18 +00:00
committed by GitHub
parent 4a12076bf2
commit e1b94e4b66
4 changed files with 15 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
@@ -32,9 +32,18 @@ jobs:
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction --extras syntax
if: ${{ matrix.python-version != '3.12' }}
- name: Install dependencies for 3.12 # https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476
run: poetry install --no-interaction
if: ${{ matrix.python-version == '3.12' }}
- name: Test with pytest
run: |
poetry run pytest tests -v --cov=./src/textual --cov-report=xml:./coverage.xml --cov-report term-missing
if: ${{ matrix.python-version != '3.12' }}
- name: Test with pytest for 3.12 # https://github.com/Textualize/textual/issues/3491#issuecomment-1854156476
run: |
poetry run pytest tests -v --cov=./src/textual --cov-report=xml:./coverage.xml --cov-report term-missing -m 'not syntax'
if: ${{ matrix.python-version == '3.12' }}
- name: Upload snapshot report
if: always()
uses: actions/upload-artifact@v3