pretix: init at 2024.2.0

Reinventing ticket presales, one ticket at a time.

+322
+259
pkgs/by-name/pr/pretix/package.nix
··· 1 + { lib 2 + , buildNpmPackage 3 + , fetchFromGitHub 4 + , fetchPypi 5 + , fetchpatch2 6 + , nodejs 7 + , python3 8 + , gettext 9 + }: 10 + 11 + let 12 + python = python3.override { 13 + packageOverrides = self: super: { 14 + django = super.django_4; 15 + 16 + stripe = super.stripe.overridePythonAttrs rec { 17 + version = "7.9.0"; 18 + 19 + src = fetchPypi { 20 + pname = "stripe"; 21 + inherit version; 22 + hash = "sha256-hOXkMINaSwzU/SpXzjhTJp0ds0OREc2mtu11LjSc9KE="; 23 + }; 24 + }; 25 + 26 + pretix-plugin-build = self.callPackage ./plugin-build.nix { }; 27 + }; 28 + }; 29 + 30 + pname = "pretix"; 31 + version = "2024.2.0"; 32 + 33 + src = fetchFromGitHub { 34 + owner = "pretix"; 35 + repo = "pretix"; 36 + rev = "refs/tags/v${version}"; 37 + hash = "sha256-emtF5dDXEXN8GIucHbjF+m9Vkg1Jj6nmQdHhBOkXMAs="; 38 + }; 39 + 40 + npmDeps = buildNpmPackage { 41 + pname = "pretix-node-modules"; 42 + inherit version src; 43 + 44 + sourceRoot = "${src.name}/src/pretix/static/npm_dir"; 45 + npmDepsHash = "sha256-kE13dcTdWZZNHPMcHEiK0a2dEcu3Z3/q815YhaVkLbQ="; 46 + 47 + dontBuild = true; 48 + 49 + installPhase = '' 50 + runHook preInstall 51 + 52 + mkdir $out 53 + cp -R node_modules $out/ 54 + 55 + runHook postInstall 56 + ''; 57 + }; 58 + in 59 + python.pkgs.buildPythonApplication rec { 60 + inherit pname version src; 61 + pyproject = true; 62 + 63 + patches = [ 64 + # Discover pretix.plugin entrypoints during build and add them into 65 + # INSTALLED_APPS, so that their static files are collected. 66 + ./plugin-build.patch 67 + 68 + (fetchpatch2 { 69 + # Allow customization of cache and log directory 70 + # https://github.com/pretix/pretix/pull/3997 71 + name = "pretix-directory-customization.patch"; 72 + url = "https://github.com/pretix/pretix/commit/e151d1d1f08917e547df49da0779b36bb73b7294.patch"; 73 + hash = "sha256-lO5eCKSqUaCwSm7rouMTFMwauWl9Tz/Yf0JE/IO+bnI="; 74 + }) 75 + ]; 76 + 77 + postPatch = '' 78 + NODE_PREFIX=src/pretix/static.dist/node_prefix 79 + mkdir -p $NODE_PREFIX 80 + cp -R ${npmDeps}/node_modules $NODE_PREFIX/ 81 + chmod -R u+w $NODE_PREFIX/ 82 + 83 + # unused 84 + sed -i "/setuptools-rust/d" pyproject.toml 85 + 86 + substituteInPlace pyproject.toml \ 87 + --replace-fail phonenumberslite phonenumbers \ 88 + --replace-fail psycopg2-binary psycopg2 \ 89 + --replace-fail vat_moss_forked==2020.3.20.0.11.0 vat-moss \ 90 + --replace-fail "bleach==5.0.*" bleach \ 91 + --replace-fail "dnspython==2.5.*" dnspython \ 92 + --replace-fail "importlib_metadata==7.*" importlib_metadata \ 93 + --replace-fail "protobuf==4.25.*" protobuf \ 94 + --replace-fail "pycryptodome==3.20.*" pycryptodome \ 95 + --replace-fail "pypdf==3.9.*" pypdf \ 96 + --replace-fail "python-dateutil==2.8.*" python-dateutil \ 97 + --replace-fail "sentry-sdk==1.40.*" sentry-sdk \ 98 + --replace-fail "stripe==7.9.*" stripe 99 + ''; 100 + 101 + build-system = with python.pkgs; [ 102 + gettext 103 + nodejs 104 + pythonRelaxDepsHook 105 + setuptools 106 + tomli 107 + ]; 108 + 109 + dependencies = with python.pkgs; [ 110 + arabic-reshaper 111 + babel 112 + beautifulsoup4 113 + bleach 114 + celery 115 + chardet 116 + cryptography 117 + css-inline 118 + defusedcsv 119 + dj-static 120 + django 121 + django-bootstrap3 122 + django-compressor 123 + django-countries 124 + django-filter 125 + django-formset-js-improved 126 + django-formtools 127 + django-hierarkey 128 + django-hijack 129 + django-i18nfield 130 + django-libsass 131 + django-localflavor 132 + django-markup 133 + django-oauth-toolkit 134 + django-otp 135 + django-phonenumber-field 136 + django-redis 137 + django-scopes 138 + django-statici18n 139 + djangorestframework 140 + dnspython 141 + drf-ujson2 142 + geoip2 143 + importlib-metadata 144 + isoweek 145 + jsonschema 146 + kombu 147 + libsass 148 + lxml 149 + markdown 150 + mt-940 151 + oauthlib 152 + openpyxl 153 + packaging 154 + paypalrestsdk 155 + paypal-checkout-serversdk 156 + pyjwt 157 + phonenumbers 158 + pillow 159 + pretix-plugin-build 160 + protobuf 161 + psycopg2 162 + pycountry 163 + pycparser 164 + pycryptodome 165 + pypdf 166 + python-bidi 167 + python-dateutil 168 + pytz 169 + pytz-deprecation-shim 170 + pyuca 171 + qrcode 172 + redis 173 + reportlab 174 + requests 175 + sentry-sdk 176 + sepaxml 177 + slimit 178 + static3 179 + stripe 180 + text-unidecode 181 + tlds 182 + tqdm 183 + vat-moss 184 + vobject 185 + webauthn 186 + zeep 187 + ] ++ plugins; 188 + 189 + optional-dependencies = with python.pkgs; { 190 + memcached = [ 191 + pylibmc 192 + ]; 193 + }; 194 + 195 + postInstall = '' 196 + mkdir -p $out/bin 197 + cp ./src/manage.py $out/bin/pretix-manage 198 + 199 + # Trim packages size 200 + rm -rfv $out/${python.sitePackages}/pretix/static.dist/node_prefix 201 + ''; 202 + 203 + dontStrip = true; # no binaries 204 + 205 + nativeCheckInputs = with python.pkgs; [ 206 + pytestCheckHook 207 + pytest-xdist 208 + pytest-mock 209 + pytest-django 210 + pytest-asyncio 211 + pytest-rerunfailures 212 + freezegun 213 + fakeredis 214 + responses 215 + ] ++ lib.flatten (lib.attrValues optional-dependencies); 216 + 217 + pytestFlagsArray = [ 218 + "--reruns" "3" 219 + 220 + # tests fail when run before 4:30am 221 + # https://github.com/pretix/pretix/pull/3987 222 + "--deselect=src/tests/base/test_orders.py::PaymentReminderTests::test_sent_days" 223 + "--deselect=src/tests/plugins/sendmail/test_rules.py::test_sendmail_rule_specified_subevent" 224 + ]; 225 + 226 + preCheck = '' 227 + export PYTHONPATH=$(pwd)/src:$PYTHONPATH 228 + export DJANGO_SETTINGS_MODULE=tests.settings 229 + ''; 230 + 231 + passthru = { 232 + inherit 233 + npmDeps 234 + python 235 + ; 236 + plugins = lib.recurseIntoAttrs 237 + (python.pkgs.callPackage ./plugins { 238 + inherit (python.pkgs) callPackage; 239 + } 240 + ); 241 + }; 242 + 243 + meta = with lib; { 244 + description = "Ticketing software that cares about your event—all the way"; 245 + homepage = "https://github.com/pretix/pretix"; 246 + license = with licenses; [ 247 + agpl3Only 248 + # 3rd party components below src/pretix/static 249 + bsd2 250 + isc 251 + mit 252 + ofl # fontawesome 253 + unlicense 254 + # all other files below src/pretix/static and src/pretix/locale and aux scripts 255 + asl20 256 + ]; 257 + maintainers = with maintainers; [ hexa ]; 258 + }; 259 + }
+37
pkgs/by-name/pr/pretix/plugin-build.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchPypi, 5 + setuptools, 6 + django, 7 + gettext, 8 + }: 9 + 10 + buildPythonPackage rec { 11 + pname = "pretix-plugin-build"; 12 + version = "1.0.1"; 13 + pyproject = true; 14 + 15 + src = fetchPypi { 16 + inherit pname version; 17 + hash = "sha256-iLbqcCAbeK4PyLXiebpdE27rt6bOP7eXczIG2bdvvYo="; 18 + }; 19 + 20 + build-system = [ 21 + setuptools 22 + ]; 23 + 24 + dependencies = [ 25 + django 26 + gettext 27 + ]; 28 + 29 + doCheck = false; # no tests 30 + 31 + meta = with lib; { 32 + description = ""; 33 + homepage = "https://github.com/pretix/pretix-plugin-build"; 34 + license = licenses.asl20; 35 + maintainers = with maintainers; [ hexa ]; 36 + }; 37 + }
+20
pkgs/by-name/pr/pretix/plugin-build.patch
··· 1 + diff --git a/src/pretix/_build_settings.py b/src/pretix/_build_settings.py 2 + index c03f56a1a..d1ea73b84 100644 3 + --- a/src/pretix/_build_settings.py 4 + +++ b/src/pretix/_build_settings.py 5 + @@ -24,6 +24,8 @@ 6 + This file contains settings that we need at wheel require time. All settings that we only need at runtime are set 7 + in settings.py. 8 + """ 9 + +from importlib_metadata import entry_points 10 + + 11 + from ._base_settings import * # NOQA 12 + 13 + ENTROPY = { 14 + @@ -47,3 +49,6 @@ HAS_MEMCACHED = False 15 + HAS_CELERY = False 16 + HAS_GEOIP = False 17 + SENTRY_ENABLED = False 18 + + 19 + +for entry_point in entry_points(group='pretix.plugin'): 20 + + INSTALLED_APPS.append(entry_point.module) # noqa: F405
+6
pkgs/by-name/pr/pretix/plugins/default.nix
··· 1 + { callPackage 2 + , ... 3 + }: 4 + 5 + { 6 + }