Updated pyproject.toml, black+mypy
This commit is contained in:
parent
8d5a8fd424
commit
76b2241a82
|
@ -34,7 +34,7 @@ from mastoposter import (
|
||||||
execute_integrations,
|
execute_integrations,
|
||||||
load_integrations_from,
|
load_integrations_from,
|
||||||
__version__,
|
__version__,
|
||||||
__description__
|
__description__,
|
||||||
)
|
)
|
||||||
from mastoposter.integrations import FilteredIntegration
|
from mastoposter.integrations import FilteredIntegration
|
||||||
from mastoposter.sources import websocket_source
|
from mastoposter.sources import websocket_source
|
||||||
|
@ -104,12 +104,9 @@ async def listen(
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = ArgumentParser(
|
parser = ArgumentParser(prog="mastoposter", description=__description__)
|
||||||
prog="mastoposter",
|
parser.add_argument(
|
||||||
description=__description__
|
"config", nargs="?", default=getenv("MASTOPOSTER_CONFIG_FILE")
|
||||||
)
|
|
||||||
parser.add_argument("config", nargs="?",
|
|
||||||
default=getenv("MASTOPOSTER_CONFIG_FILE")
|
|
||||||
)
|
)
|
||||||
parser.add_argument("-v", action="version", version=__version__)
|
parser.add_argument("-v", action="version", version=__version__)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
|
@ -43,7 +43,7 @@ class DiscordIntegration(BaseIntegration):
|
||||||
username: Optional[str] = None,
|
username: Optional[str] = None,
|
||||||
avatar_url: Optional[str] = None,
|
avatar_url: Optional[str] = None,
|
||||||
embeds: Optional[List[DiscordEmbed]] = None,
|
embeds: Optional[List[DiscordEmbed]] = None,
|
||||||
) -> dict:
|
) -> None:
|
||||||
async with AsyncClient(
|
async with AsyncClient(
|
||||||
transport=AsyncHTTPTransport(retries=self.retries)
|
transport=AsyncHTTPTransport(retries=self.retries)
|
||||||
) as c:
|
) as c:
|
||||||
|
@ -65,7 +65,6 @@ class DiscordIntegration(BaseIntegration):
|
||||||
)
|
)
|
||||||
).json()
|
).json()
|
||||||
logger.debug("Result: %r", result)
|
logger.debug("Result: %r", result)
|
||||||
return result
|
|
||||||
|
|
||||||
async def __call__(self, status: Status) -> Optional[str]:
|
async def __call__(self, status: Status) -> Optional[str]:
|
||||||
source = status.reblog or status
|
source = status.reblog or status
|
||||||
|
|
|
@ -35,3 +35,12 @@ mastoposter = "mastoposter.__main__:main"
|
||||||
|
|
||||||
[tool.flit.sdist]
|
[tool.flit.sdist]
|
||||||
include = ["config.ini", "contrib/*"]
|
include = ["config.ini", "contrib/*"]
|
||||||
|
|
||||||
|
[tool.black]
|
||||||
|
line-length = 79
|
||||||
|
target-version = ['py37', 'py38']
|
||||||
|
|
||||||
|
[tool.mypy]
|
||||||
|
warn_return_any = true
|
||||||
|
warn_unused_configs = true
|
||||||
|
check_untyped_defs = true
|
||||||
|
|
Loading…
Reference in New Issue