Skip to content

Commit

Permalink
linkedin-messaging: vendor and deprecate other repo
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Dec 12, 2023
1 parent 89a3334 commit 30c995d
Show file tree
Hide file tree
Showing 19 changed files with 1,202 additions and 15 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ jobs:
pre-commit run -av check-yaml
pre-commit run -av check-added-large-files
test:
name: Run the tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
pip install -r dev-requirements.txt
- name: Run pytest
run: |
pytest -vv
pytest -vv > pytest-coverage.txt
- name: Comment coverage
uses: coroo/[email protected]
if: ${{ github.event_name == 'pull_request' && github.event.action == 'created' }}

build-docker:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
rev: 5.12.0
hooks:
- id: isort
files: ^(cicd|linkedin_matrix)/.*\.pyi?$
files: ^(cicd|linkedin_matrix|linkedin_messaging)/.*\.pyi?$

# flake8
- repo: https://github.com/pycqa/flake8
Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ flake8-print>=5.0.0,<6
flake8>=6.0.0,<7
isort>=5.10.1,<6
pre-commit>=2.10.1,<4
pytest>=7.4.3,<7.5
termcolor>=2.1.1,<3
2 changes: 1 addition & 1 deletion linkedin_matrix/db/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from asyncpg import Record
from attr import dataclass
from linkedin_messaging import URN

from linkedin_messaging import URN
from mautrix.types import EventID, RoomID
from mautrix.util.async_db import Scheme

Expand Down
2 changes: 1 addition & 1 deletion linkedin_matrix/db/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from asyncpg import Record
from attr import dataclass
from linkedin_messaging import URN

from linkedin_messaging import URN
from mautrix.types import ContentURI, RoomID

from .model_base import Model
Expand Down
2 changes: 1 addition & 1 deletion linkedin_matrix/db/puppet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from asyncpg import Record
from attr import dataclass
from linkedin_messaging import URN
from yarl import URL

from linkedin_messaging import URN
from mautrix.types import ContentURI, SyncToken, UserID

from .model_base import Model
Expand Down
2 changes: 1 addition & 1 deletion linkedin_matrix/db/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from asyncpg import Record
from attr import dataclass
from linkedin_messaging import URN

from linkedin_messaging import URN
from mautrix.types import EventID, RoomID

from .model_base import Model
Expand Down
2 changes: 1 addition & 1 deletion linkedin_matrix/db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from asyncpg import Record
from attr import dataclass
from linkedin_messaging import URN

from linkedin_messaging import URN
from mautrix.types import RoomID, UserID

from .model_base import Model
Expand Down
2 changes: 1 addition & 1 deletion linkedin_matrix/formatter/from_linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from html import escape

from bs4 import BeautifulSoup

from linkedin_messaging import URN
from linkedin_messaging.api_objects import AttributedBody, SpInmailContent

from mautrix.types import Format, MessageType, TextMessageEventContent

from .. import puppet as pu, user as u
Expand Down
1 change: 0 additions & 1 deletion linkedin_matrix/formatter/from_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
MessageCreate,
TextEntity,
)

from mautrix.appservice import IntentAPI
from mautrix.types import Format, MessageType, TextMessageEventContent
from mautrix.util.formatter import (
Expand Down
6 changes: 3 additions & 3 deletions linkedin_matrix/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import asyncio

from bs4 import BeautifulSoup
import magic

from linkedin_matrix.db.message import Message
from linkedin_messaging import URN
from linkedin_messaging.api_objects import (
AttributedBody,
Expand All @@ -22,9 +25,6 @@
RealTimeEventStreamEvent,
ThirdPartyMedia,
)
import magic

from linkedin_matrix.db.message import Message
from mautrix.appservice import IntentAPI
from mautrix.bridge import BasePortal, NotificationDisabler, async_getter_lock
from mautrix.errors import MatrixError, MForbidden
Expand Down
4 changes: 2 additions & 2 deletions linkedin_matrix/puppet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from datetime import datetime
import re

from linkedin_messaging import URN
from linkedin_messaging.api_objects import MessagingMember, Picture
from yarl import URL
import aiohttp
import magic

from linkedin_messaging import URN
from linkedin_messaging.api_objects import MessagingMember, Picture
from mautrix.appservice import IntentAPI
from mautrix.bridge import BasePuppet, async_getter_lock
from mautrix.types import ContentURI, SyncToken, UserID
Expand Down
2 changes: 1 addition & 1 deletion linkedin_matrix/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import time

from aiohttp.client_exceptions import ServerConnectionError, TooManyRedirects

from linkedin_messaging import URN, LinkedInMessaging
from linkedin_messaging.api_objects import (
Conversation,
Expand All @@ -16,7 +17,6 @@
RealTimeEventStreamEvent,
UserProfileResponse,
)

from mautrix.bridge import BaseUser, async_getter_lock
from mautrix.errors import MNotFound
from mautrix.types import EventType, PushActionType, PushRuleKind, PushRuleScope, RoomID, UserID
Expand Down
6 changes: 6 additions & 0 deletions linkedin_messaging/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""An unofficial API for interacting with LinkedIn Messaging"""

from .api_objects import URN
from .linkedin import ChallengeException, LinkedInMessaging

__all__ = ("ChallengeException", "LinkedInMessaging", "URN")
Loading

0 comments on commit 30c995d

Please sign in to comment.