Skip to content

Do not use "font metrics ... -fixed" in monospace detection (#1421) #1

Do not use "font metrics ... -fixed" in monospace detection (#1421)

Do not use "font metrics ... -fixed" in monospace detection (#1421) #1

Workflow file for this run

on:
push:
branches:
- main
- bugfix-release
pull_request:
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- run: pip install wheel
- run: pip install -r requirements.txt -r requirements-dev.txt
- run: |
time mypy --platform linux --python-version 3.8 porcupine docs/extensions.py
time mypy --platform linux --python-version 3.9 porcupine docs/extensions.py
time mypy --platform linux --python-version 3.10 porcupine docs/extensions.py
time mypy --platform win32 --python-version 3.8 porcupine docs/extensions.py
time mypy --platform win32 --python-version 3.9 porcupine docs/extensions.py
time mypy --platform win32 --python-version 3.10 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.8 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.9 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.10 porcupine docs/extensions.py
time mypy --platform darwin --python-version 3.11 porcupine docs/extensions.py
pytest:
timeout-minutes: 10
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install wheel
- run: pip install -r requirements.txt -r requirements-dev.txt
- if: matrix.os == 'ubuntu-latest'
# Make sure that it doesn't crash with Noto Color Emoji installed
run: sudo apt install --no-install-recommends fonts-noto-color-emoji tkdnd
- if: matrix.os == 'windows-latest'
run: |
python scripts/download-tkdnd.py
echo "TCLLIBPATH=lib" >> $env:GITHUB_ENV
- uses: GabrielBB/[email protected]
with:
run: python -m pytest --durations=10
# Separate from other pytests because tkinter doesn't work on macos with actions/setup-python.
# It imports, but gives this error: RuntimeError: tk.h version (8.6) doesn't match libtk.a version (8.5)
pytest-macos:
timeout-minutes: 15
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
# TODO: how to install tkdnd on mac? add instructions to README or make mac app that bundles it
TCLLIBPATH: ./lib
PYTHON: /usr/local/opt/python@${{ matrix.python-version }}/libexec/bin/python
steps:
- uses: actions/checkout@v2
- run: brew install python@${{ matrix.python-version }}
# https://stackoverflow.com/a/66919851
- if: matrix.python-version != '3.8'
run: brew install python-tk@${{ matrix.python-version }}
- run: $PYTHON --version
- run: $PYTHON -m pip install -r requirements.txt -r requirements-dev.txt
- run: $PYTHON scripts/download-tkdnd.py
- run: $PYTHON -m pytest --durations=10
flake8-tkinter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
# TODO: adding these to requirements-dev.txt breaks pip install
- run: pip install flake8==5.0.4 flake8-tkinter==0.5.0
- run: python3 -m flake8 $(git ls-files | grep -E '\.(py|pyw)$')