perf: use type
instead of isinstance
#27
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
name: Test | |
on: | |
push: | |
paths: | |
- keywin/** | |
- tests/** | |
- .github/workflows/main.yml | |
- setup.py | |
- pyproject.toml | |
jobs: | |
type-check: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: pip | |
- name: Install the development dependencies | |
run: pip install -r requirements.txt | |
- name: Run typechecker | |
run: pyright | |
lint: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: pip | |
- name: Install the development dependencies | |
run: pip install -r requirements.txt | |
- name: Run linter | |
run: pylint $(git ls-files '*.py') | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: pip | |
- name: Install the development dependencies | |
run: pip install -r requirements.txt | |
- name: Build the extension | |
run: python setup.py build_ext --inplace | |
- name: Run tests | |
run: pytest | |
install: | |
runs-on: windows-latest | |
steps: | |
- name: Install KeyWin | |
run: pip install git+https://github.com/winstxnhdw/KeyWin | |
- name: Mini smoke test | |
run: python -c "from keywin import keyboard; keyboard.press(0x5B, 0x44)" |