sort out pyproject and replace jinja2-haml with hamlish

This commit is contained in:
Izalia Mae 2024-11-28 05:43:39 -05:00
parent 8a5a13f516
commit 5131831363
2 changed files with 4 additions and 22 deletions

View file

@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "ActivityRelay" name = "ActivityRelay"
description = "Generic LitePub relay (works with all LitePub consumers and Mastodon)" description = "Generic LitePub relay (works with all LitePub consumers and Mastodon)"
license = {text = "AGPLv3"} license = {file = "LICENSE"}
classifiers = [ classifiers = [
"Environment :: Console", "Environment :: Console",
"License :: OSI Approved :: GNU Affero General Public License v3", "License :: OSI Approved :: GNU Affero General Public License v3",
@ -16,15 +16,14 @@ classifiers = [
dependencies = [ dependencies = [
"activitypub-utils >= 0.3.2, < 0.4", "activitypub-utils >= 0.3.2, < 0.4",
"aiohttp >= 3.9.5", "aiohttp >= 3.9.5",
"aiohttp-swagger[performance] == 1.0.16",
"argon2-cffi == 23.1.0", "argon2-cffi == 23.1.0",
"barkshark-lib >= 0.2.3, < 0.3.0", "barkshark-lib >= 0.2.3, < 0.3.0",
"barkshark-sql >= 0.2.0, < 0.3.0", "barkshark-sql >= 0.2.0, < 0.3.0",
"click == 8.1.2", "click == 8.1.2",
"docstring-parser == 0.16", "docstring-parser == 0.16",
"hamlish == 0.4.0",
"hiredis == 2.3.2", "hiredis == 2.3.2",
"idna == 3.4", "idna == 3.4",
"jinja2-haml == 0.3.5",
"markdown == 3.6", "markdown == 3.6",
"platformdirs == 4.2.2", "platformdirs == 4.2.2",
"pyyaml == 6.0.1", "pyyaml == 6.0.1",
@ -40,7 +39,6 @@ content-type = "text/markdown; charset=UTF-8"
[project.urls] [project.urls]
Documentation = "https://git.pleroma.social/pleroma/relay/-/blob/main/docs/index.md" Documentation = "https://git.pleroma.social/pleroma/relay/-/blob/main/docs/index.md"
Source = "https://git.pleroma.social/pleroma/relay" Source = "https://git.pleroma.social/pleroma/relay"
Tracker = "https://git.pleroma.social/pleroma/relay/-/issues"
[project.scripts] [project.scripts]
activityrelay = "relay.manage:main" activityrelay = "relay.manage:main"
@ -74,9 +72,6 @@ relay = [
[tool.setuptools.dynamic] [tool.setuptools.dynamic]
version = {attr = "relay.__version__"} version = {attr = "relay.__version__"}
[tool.setuptools.dynamic.optional-dependencies]
dev = {file = ["dev-requirements.txt"]}
[tool.mypy] [tool.mypy]
show_traceback = true show_traceback = true
install_types = true install_types = true
@ -89,15 +84,3 @@ ignore_missing_imports = true
implicit_reexport = true implicit_reexport = true
strict = true strict = true
follow_imports = "silent" follow_imports = "silent"
[[tool.mypy.overrides]]
module = "relay.database"
implicit_reexport = true
[[tool.mypy.overrides]]
module = "aputils"
implicit_reexport = true
[[tool.mypy.overrides]]
module = "blib"
implicit_reexport = true

View file

@ -5,7 +5,7 @@ import textwrap
from aiohttp.web import Request from aiohttp.web import Request
from blib import File from blib import File
from collections.abc import Callable from collections.abc import Callable
from hamlish_jinja import HamlishExtension from hamlish import HamlishExtension, HamlishSettings
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
from jinja2.ext import Extension from jinja2.ext import Extension
from jinja2.nodes import CallBlock, Node from jinja2.nodes import CallBlock, Node
@ -21,6 +21,7 @@ if TYPE_CHECKING:
class Template(Environment): class Template(Environment):
render_markdown: Callable[[str], str] render_markdown: Callable[[str], str]
hamlish: HamlishSettings
def __init__(self, app: Application): def __init__(self, app: Application):
@ -39,8 +40,6 @@ class Template(Environment):
) )
self.app = app self.app = app
self.hamlish_enable_div_shortcut = True
self.hamlish_mode = 'indented'
def render(self, path: str, request: Request, **context: Any) -> str: def render(self, path: str, request: Request, **context: Any) -> str: