diff --git a/README.rst b/README.rst index 51a38e6..e33a33f 100644 --- a/README.rst +++ b/README.rst @@ -59,7 +59,7 @@ Development setup 3. Activate the virtual environment you use for pretalx development. -4. Execute ``python setup.py develop`` within this directory to register +4. Execute ``python -m pip install -e .`` within this directory to register this application with pretalx's plugin registry. 5. Execute ``make`` within this directory to compile translations. diff --git a/pretalx_broadcast_tools/__init__.py b/pretalx_broadcast_tools/__init__.py new file mode 100644 index 0000000..8a124bf --- /dev/null +++ b/pretalx_broadcast_tools/__init__.py @@ -0,0 +1 @@ +__version__ = "2.2.0" diff --git a/pretalx_broadcast_tools/apps.py b/pretalx_broadcast_tools/apps.py index 49afbca..4834890 100644 --- a/pretalx_broadcast_tools/apps.py +++ b/pretalx_broadcast_tools/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig from django.utils.translation import gettext_lazy +from pretalx_broadcast_tools import __version__ + class PluginApp(AppConfig): name = "pretalx_broadcast_tools" @@ -15,7 +17,7 @@ class PluginApp(AppConfig): "embedded into your broadcasting software" ) visible = True - version = "2.2.0" + version = __version__ category = "FEATURE" def ready(self): diff --git a/pretalx_broadcast_tools/exporter.py b/pretalx_broadcast_tools/exporter.py index 2c2d2bd..fcd87e1 100644 --- a/pretalx_broadcast_tools/exporter.py +++ b/pretalx_broadcast_tools/exporter.py @@ -17,7 +17,7 @@ from reportlab.platypus import ( TableStyle, ) -from .utils.placeholders import placeholders +from pretalx_broadcast_tools.utils.placeholders import placeholders A4_WIDTH, A4_HEIGHT = A4 PAGE_PADDING = 10 * mm diff --git a/pretalx_broadcast_tools/urls.py b/pretalx_broadcast_tools/urls.py index daab6b1..876d38d 100644 --- a/pretalx_broadcast_tools/urls.py +++ b/pretalx_broadcast_tools/urls.py @@ -1,5 +1,5 @@ from django.urls import re_path -from pretalx.event.models.event import SLUG_CHARS +from pretalx.event.models.event import SLUG_REGEX from .views.event_info import BroadcastToolsEventInfoView from .views.orga import BroadcastToolsOrgaView @@ -9,37 +9,37 @@ from .views.static_html import BroadcastToolsLowerThirdsView, BroadcastToolsRoom urlpatterns = [ re_path( - f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/event.json$", + rf"^(?P{SLUG_REGEX})/p/broadcast-tools/event.json$", BroadcastToolsEventInfoView.as_view(), name="event_info", ), re_path( - f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/schedule.json$", + f"^(?P{SLUG_REGEX})/p/broadcast-tools/schedule.json$", BroadcastToolsScheduleView.as_view(), name="schedule", ), re_path( - f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/lower-thirds/$", + f"^(?P{SLUG_REGEX})/p/broadcast-tools/lower-thirds/$", BroadcastToolsLowerThirdsView.as_view(), name="lowerthirds", ), re_path( - f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/feedback-qr/(?P[0-9]+).svg$", + f"^(?P{SLUG_REGEX})/p/broadcast-tools/feedback-qr/(?P[0-9]+).svg$", BroadcastToolsFeedbackQrCodeSvg.as_view(), name="feedback_qr_id", ), re_path( - f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/public-qr/(?P[0-9]+).svg$", + f"^(?P{SLUG_REGEX})/p/broadcast-tools/public-qr/(?P[0-9]+).svg$", BroadcastToolsPublicQrCodeSvg.as_view(), name="public_qr_id", ), re_path( - f"^(?P[{SLUG_CHARS}]+)/p/broadcast-tools/room-info/$", + f"^(?P{SLUG_REGEX})/p/broadcast-tools/room-info/$", BroadcastToolsRoomInfoView.as_view(), name="room_info", ), re_path( - f"^orga/event/(?P[{SLUG_CHARS}]+)/settings/p/broadcast-tools/$", + f"^orga/event/(?P{SLUG_REGEX})/settings/p/broadcast-tools/$", BroadcastToolsOrgaView.as_view(), name="orga", ), diff --git a/pretalx_broadcast_tools/views/orga.py b/pretalx_broadcast_tools/views/orga.py index 487db1c..6eba32a 100644 --- a/pretalx_broadcast_tools/views/orga.py +++ b/pretalx_broadcast_tools/views/orga.py @@ -1,5 +1,5 @@ from django.views.generic import FormView -from pretalx.common.mixins.views import PermissionRequired +from pretalx.common.views.mixins import PermissionRequired from ..forms import BroadcastToolsSettingsForm diff --git a/pretalx_broadcast_tools/views/qr.py b/pretalx_broadcast_tools/views/qr.py index 618b562..ec55d65 100644 --- a/pretalx_broadcast_tools/views/qr.py +++ b/pretalx_broadcast_tools/views/qr.py @@ -1,4 +1,4 @@ -from xml.etree import ElementTree as ET +from xml.etree import ElementTree import qrcode import qrcode.image.svg @@ -15,7 +15,7 @@ class BroadcastToolsFeedbackQrCodeSvg(View): image = qrcode.make( f"{domain}{talk.urls.feedback}", image_factory=qrcode.image.svg.SvgImage ) - svg_data = mark_safe(ET.tostring(image.get_image()).decode()) + svg_data = mark_safe(ElementTree.tostring(image.get_image()).decode()) return HttpResponse(svg_data, content_type="image/svg+xml") @@ -26,5 +26,5 @@ class BroadcastToolsPublicQrCodeSvg(View): image = qrcode.make( f"{domain}{talk.urls.public}", image_factory=qrcode.image.svg.SvgImage ) - svg_data = mark_safe(ET.tostring(image.get_image()).decode()) + svg_data = mark_safe(ElementTree.tostring(image.get_image()).decode()) return HttpResponse(svg_data, content_type="image/svg+xml") diff --git a/pretalx_broadcast_tools/views/schedule.py b/pretalx_broadcast_tools/views/schedule.py index ccb6360..f838489 100644 --- a/pretalx_broadcast_tools/views/schedule.py +++ b/pretalx_broadcast_tools/views/schedule.py @@ -5,7 +5,7 @@ from django.http import JsonResponse from django.urls import reverse from django.views import View from pretalx.agenda.views.schedule import ScheduleMixin -from pretalx.common.mixins.views import EventPermissionRequired +from pretalx.common.views.mixins import EventPermissionRequired from pretalx.schedule.exporters import ScheduleData from ..utils.placeholders import placeholders diff --git a/pyproject.toml b/pyproject.toml index bec5d33..5ee17b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pretalx-broadcast-tools" -version = "2.2.0" +dynamic = ["version"] description = """ Some tools which can be used for supporting a broadcasting software. This currently includes a generator for PDF printouts, a 'lower thirds' @@ -24,9 +24,8 @@ dependencies = [ pretalx_broadcast_tools = "pretalx_broadcast_tools:PretalxPluginMeta" [build-system] -requires = [ - "setuptools", -] +build-backend = "setuptools.build_meta" +requires = ["setuptools", "wheel"] [project.urls] homepage = "https://github.com/Kunsi/pretalx-plugin-broadcast-tools" @@ -35,5 +34,8 @@ repository = "https://github.com/Kunsi/pretalx-plugin-broadcast-tools.git" [tool.setuptools] include-package-data = true +[tool.setuptools.dynamic] +version = {attr = "pretalx_broadcast_tools.__version__"} + [tool.setuptools.packages.find] include = ["pretalx*"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup()