Skip to content

Commit

Permalink
chore: update pytest workflow. (#32)
Browse files Browse the repository at this point in the history
* update pytest workflow.

* Run against the pull request, not the target.

This hides secrects like GITHUB_TOKEN, which we do not need.

* Avoid typing_extensions.

TypedDict is in Python proper since like 3.8. or 3.9. But also read

    https://news.ycombinator.com/item?id=21307640
  • Loading branch information
rainwoodman authored Dec 14, 2024
1 parent 3c1f2d1 commit e0c979b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/pytestPR.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: "PyTest PR"

on:
pull_request_target:
# Use pull_request, not pull_request_target because we run arbitrary code in
# this workflow. c.f.
# https://nathandavison.com/blog/github-actions-and-the-threat-of-malicious-pull-requests
pull_request:
types:
- opened
- edited
Expand All @@ -15,14 +18,14 @@ jobs:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v3
- name: developer mode install
run: pip install -e .
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pytest dependencies
run: pip install pytest pytest-md pytest-emoji
- name: developer mode install
run: pip install -e .
- uses: pavelzw/pytest-action@v2
with:
emoji: false
Expand Down
2 changes: 1 addition & 1 deletion src/blueair_api/const.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Mapping
from typing_extensions import TypedDict
from typing import TypedDict

SENSITIVE_FIELD_NAMES = [
"username",
Expand Down

0 comments on commit e0c979b

Please sign in to comment.