Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linkedin-messaging: vendor and deprecate other repo #71

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,30 @@ 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 requirements.txt
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[![Apache 2.0](https://img.shields.io/pypi/l/linkedin-matrix)](LICENSE)

LinkedIn Messaging <-> Matrix bridge built using
[mautrix-python](https://github.com/tulir/mautrix-python) and
[linkedin-messaging-api](https://github.com/sumnerevans/linkedin-messaging-api).
[mautrix-python](https://github.com/tulir/mautrix-python).

## Documentation

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