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

Pretix cookiecutter template

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #63841 failed
Showing
with 361 additions and 0 deletions
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
.ropeproject/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
# Django stuff:
*.log
data/
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints
test:
script:
- cp /keys/.pypirc ~/.pypirc
- virtualenv env
- source env/bin/activate
- XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools pytest pytest-django coverage
- XDG_CACHE_HOME=/cache pip3 install -U "git+https://github.com/pretix/pretix.git@master#egg=pretix&subdirectory=src"
- python setup.py develop
- make
- coverage run -m py.test tests
- coverage report
tags:
- python3
style:
script:
- cp /keys/.pypirc ~/.pypirc
- virtualenv env
- source env/bin/activate
- XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools isort docformatter black flake8 check-manifest
- XDG_CACHE_HOME=/cache pip3 install -U "git+https://github.com/pretix/pretix.git@master#egg=pretix&subdirectory=src"
- python setup.py develop
- docformatter --check -r .
- black --check .
- isort -c .
- flake8 .
- check-manifest .
tags:
- python3
pypi:
script:
- cp /keys/.pypirc ~/.pypirc
- virtualenv env
- source env/bin/activate
- XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools twine check-manifest
- XDG_CACHE_HOME=/cache pip3 install -U pretix
- python setup.py develop
- python setup.py sdist bdist_wheel
- check-manifest .
- twine check dist/*
- twine upload dist/*
tags:
- python3
only:
- pypi
artifacts:
paths:
- dist/
#!/bin/sh
REPO_DIR=$(git rev-parse --show-toplevel)
GIT_DIR=$REPO_DIR/.git
VENV_ACTIVATE=$VIRTUAL_ENV/bin/activate
if [[ ! -f $VENV_ACTIVATE ]]
then
echo "Could not find your virtual environment"
fi
echo "#!/bin/sh" >> $GIT_DIR/hooks/pre-commit
echo "set -e" >> $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 "isort -c ." >> $GIT_DIR/hooks/pre-commit
echo "flake8 ." >> $GIT_DIR/hooks/pre-commit
chmod +x $GIT_DIR/hooks/pre-commit
LICENSE 0 → 100644
MIT License
Copyright (c) 2022 Felix Schäfer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
recursive-include pretix_matrix_inviter/static *
recursive-include pretix_matrix_inviter/templates *
recursive-include pretix_matrix_inviter/locale *
include LICENSE
exclude .gitlab-ci.yml
Makefile 0 → 100644
all: localecompile
LNGS:=`find pretix_matrix_inviter/locale/ -mindepth 1 -maxdepth 1 -type d -printf "-l %f "`
localecompile:
django-admin compilemessages
localegen:
django-admin makemessages --keep-pot -i build -i dist -i "*egg*" $(LNGS)
.PHONY: all localecompile localegen
Matrix Inviter
==========================
This is a plugin for `pretix`_.
Ask participants for their Matrix ID and invite them to a Matrix Room or Space.
Development setup
-----------------
1. Make sure that you have a working `pretix development setup`_.
2. Clone this repository.
3. Activate the virtual environment you use for pretix development.
4. Execute ``python setup.py develop`` within this directory to register this application with pretix's plugin registry.
5. Execute ``make`` within this directory to compile translations.
6. Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in
the 'plugins' tab in the settings.
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed::
pip install flake8 isort black docformatter
To check your plugin for rule violations, run::
docformatter --check -r .
black --check .
isort -c .
flake8 .
You can auto-fix some of these issues by running::
docformatter -r .
isort .
black .
To automatically check for these issues before you commit, you can run ``.install-hooks``.
License
-------
Copyright 2022 Felix Schäfer
Released under the terms of the MIT License
.. _pretix: https://github.com/pretix/pretix
.. _pretix development setup: https://docs.pretix.eu/en/latest/development/setup.html
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.0.0"
class PluginApp(PluginConfig):
name = "pretix_matrix_inviter"
verbose_name = "Matrix Inviter"
class PretixPluginMeta:
name = gettext_lazy("Matrix Inviter")
author = "Felix Schäfer"
description = gettext_lazy("Ask participants for their Matrix ID and invite them to a Matrix Room or Space.")
visible = True
version = __version__
category = "FEATURE"
compatibility = "pretix>=2.7.0"
def ready(self):
from . import signals # NOQA
default_app_config = "pretix_matrix_inviter.PluginApp"
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: Felix Schäfer\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: Felix Schäfer\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"
# Register your receivers here
[flake8]
ignore = N802,W503,E402
max-line-length = 160
exclude = migrations,.ropeproject,static,_static,build
[isort]
combine_as_imports = true
default_section = THIRDPARTY
include_trailing_comma = true
known_third_party = pretix
known_standard_library = typing
multi_line_output = 3
skip = setup.py
use_parentheses = True
force_grid_wrap = 0
line_length = 88
known_first_party = pretix_matrix_inviter
[tool:pytest]
DJANGO_SETTINGS_MODULE = pretix.testutils.settings
[coverage:run]
source = pretix_matrix_inviter
omit = */migrations/*,*/urls.py,*/tests/*
[coverage:report]
exclude_lines =
pragma: no cover
def __str__
der __repr__
if settings.DEBUG
NOQA
NotImplementedError
[check-manifest]
ignore =
.update-locales.sh
.install-hooks.sh
Makefile
manage.py
tests/*
setup.py 0 → 100644
import os
from distutils.command.build import build
from django.core import management
from setuptools import find_packages, setup
from pretix_matrix_inviter import __version__
try:
with open(
os.path.join(os.path.dirname(__file__), "README.rst"), 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-matrix-inviter",
version=__version__,
description="Ask participants for their Matrix ID and invite them to a Matrix Room or Space.",
long_description=long_description,
url="https://gitlab.fachschaften.org/kif/pretix-matrix-inviter",
author="Felix Schäfer",
author_email="admin@kif.rocks",
license="MIT License",
install_requires=[],
packages=find_packages(exclude=["tests", "tests.*"]),
include_package_data=True,
cmdclass=cmdclass,
entry_points="""
[pretix.plugin]
pretix_matrix_inviter=pretix_matrix_inviter:PretixPluginMeta
""",
)
# put your pytest fixtures here
def test_empty():
# put your first tests here
assert 1 + 1 == 2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment