Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 7c9f1a0

Browse files
committed
ci: add python workflow
1 parent 896cd7a commit 7c9f1a0

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

.github/workflows/python.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Tests on Python 3.7+
2+
name: Python Test
3+
4+
on:
5+
push:
6+
branches: [ "*" ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: [ 3.7, 3.8, 3.9 ]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Run image
25+
uses: abatilo/[email protected]
26+
27+
- name: Install dependencies
28+
run: |
29+
poetry install
30+
31+
- name: Run lint with black
32+
run: |
33+
poetry run black --check .
34+
35+
- name: Lint with flake8
36+
if: always()
37+
run: |
38+
poetry run flake8 --count --statistics
39+
40+
- name: Lint with mypy
41+
if: always()
42+
run: |
43+
poetry run mypy .

linkedin_messaging/linkedin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Any,
88
Awaitable,
99
Callable,
10+
cast,
1011
DefaultDict,
1112
Dict,
1213
List,
@@ -331,8 +332,8 @@ def add_event_listener(
331332
self.event_listeners[payload_key].append(fn)
332333

333334
object_translation_map: Dict[str, DataClassJsonMixin] = {
334-
"event": ConversationEvent,
335-
"reactionSummary": ReactionSummary,
335+
"event": cast(DataClassJsonMixin, ConversationEvent),
336+
"reactionSummary": cast(DataClassJsonMixin, ReactionSummary),
336337
}
337338

338339
async def _fire(self, payload_key: str, event: Any):

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ exclude = .git,__pycache__,build,dist,.venv
44
max-line-length = 88
55
extension =
66
MC1 = flake8-pep3101
7+
8+
[mypy-bs4]
9+
ignore_missing_imports = True

0 commit comments

Comments
 (0)