Skip to content
Snippets Groups Projects
Commit 6284076f authored by Felix Schäfer's avatar Felix Schäfer :construction_worker:
Browse files

Apply updateded pretix plugin cookiecutter

parent a44f2d3b
No related branches found
No related tags found
No related merge requests found
Pipeline #182001 passed
...@@ -9,19 +9,11 @@ cache: ...@@ -9,19 +9,11 @@ cache:
paths: paths:
- .cache - .cache
docformatter:
stage: linting
image: python:3
before_script:
- pip3 install -U pip docformatter
script:
- docformatter --check -r .
black: black:
stage: linting stage: linting
image: python:3 image: python:3
before_script: before_script:
- pip3 install -U pip black - pip3 install -U pip pretix black
script: script:
- black --check . - black --check .
...@@ -29,7 +21,7 @@ isort: ...@@ -29,7 +21,7 @@ isort:
stage: linting stage: linting
image: python:3 image: python:3
before_script: before_script:
- pip3 install -U pip isort - pip3 install -U pip pretix isort
script: script:
- isort -c . - isort -c .
...@@ -37,6 +29,14 @@ flake8: ...@@ -37,6 +29,14 @@ flake8:
stage: linting stage: linting
image: python:3 image: python:3
before_script: before_script:
- pip3 install -U pip flake8 - pip3 install -U pip pretix flake8
script: script:
- flake8 . - flake8 .
check-manifest:
stage: linting
image: python:3
before_script:
- pip3 install -U pip pretix check-manifest
script:
- check-manifest .
...@@ -10,7 +10,6 @@ fi ...@@ -10,7 +10,6 @@ fi
echo "#!/bin/sh" >> $GIT_DIR/hooks/pre-commit echo "#!/bin/sh" >> $GIT_DIR/hooks/pre-commit
echo "set -e" >> $GIT_DIR/hooks/pre-commit echo "set -e" >> $GIT_DIR/hooks/pre-commit
echo "source $VENV_ACTIVATE" >> $GIT_DIR/hooks/pre-commit echo "source $VENV_ACTIVATE" >> $GIT_DIR/hooks/pre-commit
echo "docformatter --check -r ." >> $GIT_DIR/hooks/pre-commit
echo "black --check ." >> $GIT_DIR/hooks/pre-commit echo "black --check ." >> $GIT_DIR/hooks/pre-commit
echo "isort -c ." >> $GIT_DIR/hooks/pre-commit echo "isort -c ." >> $GIT_DIR/hooks/pre-commit
echo "flake8 ." >> $GIT_DIR/hooks/pre-commit echo "flake8 ." >> $GIT_DIR/hooks/pre-commit
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This is a plugin for [pretix](https://github.com/pretix/pretix). This is a plugin for [pretix](https://github.com/pretix/pretix).
Let users create an keycloak acccount Let users create a keycloak acccount.
## Installation ## Installation
...@@ -32,18 +32,16 @@ Once the plugin is enabled you can configure it in Settings > Keycloak user crea ...@@ -32,18 +32,16 @@ Once the plugin is enabled you can configure it in Settings > Keycloak user crea
This plugin has CI set up to enforce a few code style rules. To check This plugin has CI set up to enforce a few code style rules. To check
locally, you need these packages installed: locally, you need these packages installed:
pip install flake8 isort black docformatter pip install flake8 isort black
To check your plugin for rule violations, run: To check your plugin for rule violations, run:
docformatter --check -r .
black --check . black --check .
isort -c . isort -c .
flake8 . flake8 .
You can auto-fix some of these issues by running: You can auto-fix some of these issues by running:
docformatter -r .
isort . isort .
black . black .
......
from django.utils.translation import gettext_lazy
try:
from pretix.base.plugins import PluginConfig
except ImportError:
raise RuntimeError("Please use pretix 2.7 or above to run this plugin!")
__version__ = "1.5.0" __version__ = "1.5.0"
class PluginApp(PluginConfig):
name = "pretix_keycloak_create_user"
verbose_name = "Keycloak user creator"
class PretixPluginMeta:
name = gettext_lazy("Keycloak user creator")
author = "Fachschaft Informatik TU Dortmund"
description = gettext_lazy(
"Create users from pretix participants in a Keycloak realm."
)
visible = True
version = __version__
category = "FEATURE"
compatibility = "pretix>=2.7.0"
def ready(self):
from . import signals # NOQA
default_app_config = "pretix_keycloak_create_user.PluginApp"
from django.utils.translation import gettext_lazy
from . import __version__
try:
from pretix.base.plugins import PluginConfig
except ImportError:
raise RuntimeError("Please use pretix 2.7 or above to run this plugin!")
class PluginApp(PluginConfig):
default = True
name = "pretix_keycloak_create_user"
verbose_name = "Keycloak user creator"
class PretixPluginMeta:
name = gettext_lazy("Keycloak user creator")
author = "Fachschaft Informatik TU Dortmund"
description = gettext_lazy("Invite Pretix participants to a Keycloak realm.")
visible = True
version = __version__
category = "FEATURE"
compatibility = "pretix>=2.7.0"
def ready(self):
from . import signals # NOQA
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-07 19:01+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Fachschaft Informatik TU Dortmund\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-07 19:01+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Fachschaft Informatik TU Dortmund\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
package = "pretix-keycloak-create-user" package = "pretix-keycloak-create-user"
modules = [ "pretix_keycloak_create_user" ] modules = [ "pretix_keycloak_create_user" ]
marketplace_name = "keycloak-create-user" marketplace_name = "keycloak-create-user"
[project]
name = "pretix-keycloak-create-user"
dynamic = ["version"]
description = "Invite Pretix participants to a Keycloak realm."
readme = "README.md"
license = {text = "MIT"}
keywords = ["pretix"]
authors = [
{name = "Fachschaft Informatik TU Dortmund", email = "root@oh14.de"},
]
maintainers = [
{name = "Fachschaft Informatik TU Dortmund", email = "root@oh14.de"},
]
dependencies = [
"requests"
]
[project.entry-points."pretix.plugin"]
pretix_keycloak_create_user = "pretix_keycloak_create_user:PretixPluginMeta"
[project.entry-points."distutils.commands"]
build = "pretix_plugin_build.build:CustomBuild"
[build-system]
requires = [
"setuptools",
"pretix-plugin-build",
]
[project.urls]
homepage = "https://gitlab.fachschaften.org/tudo-fsinfo/admin/pretix-keycloak-create-user"
repository = "https://gitlab.fachschaften.org/tudo-fsinfo/admin/pretix-keycloak-create-user"
[tool.setuptools]
include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "pretix_keycloak_create_user.__version__"}
[tool.setuptools.packages.find]
include = ["pretix*"]
namespaces = false
...@@ -40,3 +40,5 @@ ignore = ...@@ -40,3 +40,5 @@ ignore =
Makefile Makefile
manage.py manage.py
tests/* tests/*
*.po
.gitkeep
import os from setuptools import setup
from distutils.command.build import build
from django.core import management
from setuptools import find_packages, setup
from pretix_keycloak_create_user import __version__ setup()
try:
with open(
os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8"
) as f:
long_description = f.read()
except Exception:
long_description = ""
class CustomBuild(build):
def run(self):
management.call_command("compilemessages", verbosity=1)
build.run(self)
cmdclass = {"build": CustomBuild}
setup(
name="pretix-keycloak-create-user",
version=__version__,
description="Invite Pretix participants to a Keycloak realm.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://gitlab.fachschaften.org/tudo-fsinfo/admin/pretix-keycloak-create-user",
project_urls={
"Changelog": "https://gitlab.fachschaften.org/tudo-fsinfo/admin/pretix-keycloak-create-user/-/blob/main/CHANGELOG.md",
"Tracker": "https://gitlab.fachschaften.org/tudo-fsinfo/admin/pretix-keycloak-create-user/-/issues",
"Pretix Marketplace": "https://marketplace.pretix.eu/products/pretix-keycloak-create-user/",
},
author="Fachschaft Informatik TU Dortmund",
author_email="root@oh14.de",
license="MIT",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"License :: OSI Approved :: MIT License",
"Topic :: Communications :: Chat",
],
install_requires=["requests"],
packages=find_packages(exclude=["tests", "tests.*"]),
include_package_data=True,
cmdclass=cmdclass,
entry_points="""
[pretix.plugin]
pretix_keycloak_create_user=pretix_keycloak_create_user:PretixPluginMeta
""",
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment