Migrate to pyproject.toml and modernize project configuration, fix some issues #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Test with PyTest | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Create and activate virtualenv | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
source venv/bin/activate | |
pip install setuptools wheel build pytest pytest-xdist | |
python -m build --sdist --wheel | |
pip install dist/*.whl | |
- name: Verify installed packages | |
run: | | |
source venv/bin/activate | |
pip list | |
- name: Import language_tool_python | |
run: | | |
source venv/bin/activate | |
printf "import language_tool_python\n" | python | |
- name: Test with pytest | |
run: | | |
source venv/bin/activate | |
pytest -vx --dist=loadfile -n auto |