Skip to content

Commit

Permalink
upgrade dependencies (fossasia#70)
Browse files Browse the repository at this point in the history
* upgrade dependencies

* upgrade mt940. based on pretix/pretix#2331

* upgrade dependencies that don't need large changes

* run makemigrations after updating dependencies

---------

Co-authored-by: Martin Bähr <[email protected]>
  • Loading branch information
Martin Bähr committed May 24, 2024
1 parent b992bda commit cd7e353
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 74 deletions.
96 changes: 48 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,92 +21,92 @@ classifiers = [
]
dependencies = [
'Django==3.2.*',
'djangorestframework==3.12.*',
'djangorestframework==3.14.*',
'python-dateutil==2.8.*',
'isoweek',
'requests==2.25.0',
'requests==2.30.*',
'pytz',
'django-bootstrap3==15.0.*',
'django-formset-js-improved==0.5.0.2',
'django-bootstrap3==23.1.*',
'django-formset-js-improved==0.5.0.3',
'django-compressor==2.4.*',
'django-hierarkey==1.0.*,>=1.0.4',
'django-filter==2.4.*',
'django-scopes==1.2.*',
'django-localflavor==3.0.*',
'reportlab>=3.5.65',
'Pillow==8.*',
'django-hierarkey==1.1.*',
'django-filter==23.2',
'django-scopes==2.0.*',
'django-localflavor==4.0',
'reportlab==4.0.*',
'Pillow==9.5.*',
'PyPDF2==1.26.*',
'django-libsass==0.8',
'libsass==0.20.*',
'django-otp==0.7.*,>=0.7.5',
'django-libsass==0.9',
'libsass==0.22.*',
'django-otp==1.2.*',
'webauthn==0.4.*',
'python-u2flib-server==4.*',
'django-formtools==2.3',
'celery==4.4.*',
'kombu==4.6.*',
'django-statici18n==1.9.*',
'django-formtools==2.4.1',
'celery==5.2.*',
'kombu==5.2.*',
'django-statici18n==2.3.*',
'inlinestyler==0.2.*',
'BeautifulSoup4==4.8.*',
'BeautifulSoup4==4.12.*',
'slimit',
'lxml',
'static3==0.7.*',
'dj-static',
'csscompressor',
'django-markup',
'markdown==3.3.*',
'bleach==3.3.*',
'sentry-sdk==0.14.*',
'markdown==3.4.3',
'bleach==5.0.*',
'sentry-sdk==1.15.*',
'babel',
'paypalrestsdk==1.13.*',
'pycparser==2.13', # https://github.com/eliben/pycparser/issues/147
'django-redis==4.11.*',
'redis==3.4.*',
'stripe==2.42.*',
'chardet<3.1.0,>=3.0.2',
'mt-940==3.2',
'django-i18nfield==1.9.*,>=1.9.1',
'pycparser==2.21',
'django-redis==5.2.*',
'redis==4.5.*,>=4.5.4',
'stripe==5.4.*',
'chardet==5.1.*',
'mt-940==4.30.*',
'django-i18nfield==1.9.*,>=1.9.4',
'psycopg2-binary',
'tqdm==4.*',
'vobject==0.9.*',
'pycountry',
'django-countries>=6.0',
'django-countries==7.5.*',
'pyuca', # for better sorting of country names in django-countries
'defusedcsv>=1.1.0',
'vat_moss_forked==2020.3.20.0.11.0',
'jsonschema',
'django-hijack>=2.1.10,<2.2.0',
'openpyxl==3.0.*',
'django-hijack>=2.2.0,<2.3.0',
'openpyxl==3.1.*',
'django-oauth-toolkit==1.2.*',
'oauthlib==3.1.*',
'django-phonenumber-field==4.0.*',
'phonenumberslite==8.11.*',
'oauthlib==3.2.*',
'django-phonenumber-field==7.1.*',
'phonenumberslite==8.13.*',
'python-bidi==0.4.*', # Support for Arabic in reportlab
'arabic-reshaper==2.0.15', # Support for Arabic in reportlab
'arabic-reshaper==3.0.0', # Support for Arabic in reportlab
'packaging',
'tlds>=2020041600',
'text-unidecode==1.*',
'protobuf==3.15.*',
'protobuf==3.20.*',
'cryptography>=3.4.2',
'sepaxml==2.4.*,>=2.4.1',
'sepaxml==2.6.*',
]

[project.optional-dependencies]
memcached = ["pylibmc"]
dev = [
'django-debug-toolbar==3.2',
'pycodestyle==2.5.*',
'pyflakes==2.1.*',
'flake8==3.7.*',
'pep8-naming',
'django-debug-toolbar==4.0.*',
'pycodestyle==2.10.*',
'pyflakes==3.0.*',
'flake8==6.0.*',
'pep8-naming==0.13.*',
'coveralls',
'coverage',
'pytest==6.*',
'pytest==7.3.*',
'pytest-django==4.*',
'pytest-xdist==1.31.*',
'isort',
'pytest-mock==2.0.*',
'pytest-rerunfailures==9.*',
'responses==0.23.0',
'pytest-xdist==3.2.*',
'isort==5.12.*',
'pytest-mock==3.10.*',
'pytest-rerunfailures==11.*',
'responses',
'potypo',
'freezegun',
'pytest-cache',
Expand Down
1 change: 0 additions & 1 deletion src/pretix/api/serializers/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def to_internal_value(self, data):
(forms.EmailField, serializers.EmailField, ()),
(forms.UUIDField, serializers.UUIDField, ()),
(forms.URLField, serializers.URLField, ()),
(forms.NullBooleanField, serializers.NullBooleanField, ()),
(forms.BooleanField, serializers.BooleanField, ()),
)

Expand Down
7 changes: 4 additions & 3 deletions src/pretix/base/templatetags/rich_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ def markdown_compile_email(source):

class SnippetExtension(markdown.extensions.Extension):
def extendMarkdown(self, md, *args, **kwargs):
del md.parser.blockprocessors['olist']
del md.parser.blockprocessors['ulist']
del md.parser.blockprocessors['quote']
md.parser.blockprocessors.deregister('olist')
md.parser.blockprocessors.deregister('ulist')
md.parser.blockprocessors.deregister('quote')



def markdown_compile(source, snippet=False):
Expand Down
6 changes: 5 additions & 1 deletion src/pretix/control/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ def get_template_names(self):
def done(self, form_list, form_dict, **kwargs):
foundation_data = self.get_cleaned_data_for_step('foundation')
basics_data = self.get_cleaned_data_for_step('basics')
copy_data = self.get_cleaned_data_for_step('copy')
try:
copy_data = self.get_cleaned_data_for_step('copy')
except KeyError:
copy_data = None


with transaction.atomic(), language(basics_data['locale']):
event = form_dict['basics'].instance
Expand Down
4 changes: 2 additions & 2 deletions src/pretix/helpers/reportlab.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PIL.Image import BICUBIC
from PIL.Image import Resampling
from reportlab.lib.utils import ImageReader


Expand All @@ -10,7 +10,7 @@ def resize(self, width, height, dpi):
height = width * self._image.size[1] / self._image.size[0]
self._image.thumbnail(
size=(int(width * dpi / 72), int(height * dpi / 72)),
resample=BICUBIC
resample=Resampling.BICUBIC
)
self._data = None
return width, height
Expand Down
16 changes: 11 additions & 5 deletions src/pretix/plugins/banktransfer/mt940import.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def parse(file):
transaction_details = parse_transaction_details(td.replace("\n", ""))

payer = {
'name': transaction_details.get('accountholder', ''),
'name': transaction_details.get('accountholder', '') or t.data.get('applicant_name', ''),
# In reality, these fields are sometimes IBANs and BICs, and sometimes legacy numbers. We don't
# really know (except for a syntax check) which will be performed anyways much later in the stack.
'iban': transaction_details.get('accountnumber', ''),
'bic': transaction_details.get('blz', ''),
'iban': transaction_details.get('accountnumber', '') or t.data.get('applicant_iban', ''),
'bic': transaction_details.get('blz', '') or t.data.get('applicant_bin', ''),
}
reference, eref = join_reference(transaction_details.get('reference', '').split('\n'), payer)
if not eref:
Expand All @@ -166,11 +166,17 @@ def parse(file):
**{k: payer[k].strip() for k in ("iban", "bic") if payer.get(k)}
})
else:
payer = {
'payer': t.data.get('applicant_name', ''),
'iban': t.data.get('applicant_iban', ''),
'bic': t.data.get('applicant_bin', ''),
}
result.append({
'reference': "\n".join([
t.data.get(f) for f in ('transaction_details', 'customer_reference', 'bank_reference',
t.data.get(f) for f in ('transaction_details', 'customer_reference', 'bank_reference', 'purpose',
'extra_details', 'non_swift_text') if t.data.get(f, '')]),
'amount': str(round_decimal(t.data['amount'].amount)),
'date': t.data['date'].isoformat()
'date': t.data['date'].isoformat(),
**{k: payer[k].strip() for k in ("iban", "bic", "payer") if payer.get(k)}
})
return result
2 changes: 1 addition & 1 deletion src/pretix/plugins/stripe/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def api_kwargs(self):
return kwargs

def _init_api(self):
stripe.api_version = '2019-05-16'
stripe.api_version = '2022-08-01'
stripe.set_app_info(
"pretix",
partner_id="pp_partner_FSaz4PpKIur7Ox",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.25 on 2024-04-17 20:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('ticketoutputpdf', '0007_auto_20181123_1059'),
]

operations = [
migrations.AlterField(
model_name='ticketlayout',
name='layout',
field=models.TextField(default='[{\n "type":"textarea",\n "left":"17.50",\n "bottom":"274.60",\n "fontsize":"16.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"175.00",\n "content":"event_name",\n "text":"Sample event name",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"17.50",\n "bottom":"262.90",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"110.00",\n "content":"itemvar",\n "text":"Sample product – sample variation",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"17.50",\n "bottom":"252.50",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"110.00",\n "content":"attendee_name",\n "text":"John Doe",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"17.50",\n "bottom":"242.10",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"110.00",\n "content":"event_begin",\n "text":"2016-05-31 20:00",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"17.50",\n "bottom":"231.70",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"110.00",\n "content":"seat",\n "text":"Ground floor, Row 3, Seat 4",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"17.50",\n "bottom":"204.80",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"110.00",\n "content":"event_location",\n "text":"Random City",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"17.50",\n "bottom":"194.50",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"30.00",\n "content":"order",\n "text":"A1B2C",\n "align":"left"\n },\n {\n "type":"textarea",\n "left":"52.50",\n "bottom":"194.50",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"45.00",\n "content":"price",\n "text":"123.45 EUR",\n "align":"right"\n },\n {\n "type":"textarea",\n "left":"102.50",\n "bottom":"194.50",\n "fontsize":"13.0",\n "color":[\n 0,\n 0,\n 0,\n 1\n ],\n "fontfamily":"Open Sans",\n "bold":false,\n "italic":false,\n "width":"90.00",\n "content":"secret",\n "text":"tdmruoekvkpbv1o2mv8xccvqcikvr58u",\n "align":"left"\n },\n {\n "type":"barcodearea",\n "left":"130.40",\n "bottom":"204.50",\n "size":"64.00"\n },\n {\n "type":"poweredby",\n "left":"88.72",\n "bottom":"10.00",\n "size":"20.00",\n "content":"dark"\n }]'),
),
]
27 changes: 14 additions & 13 deletions src/tests/plugins/banktransfer/test_mt940.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,68 +194,69 @@
'payer': 'MUELLER',
'iban': '234567',
'bic': '10020030',
'reference': 'Miete November'},
'reference': 'NONREF\n55555\nMiete November'},
{'amount': '3000.00',
'date': '2002-11-02',
'payer': 'MUELLER',
'iban': '0847564700',
'bic': '50060400',
'reference': 'Gehalt Oktober Firma Mustermann GmbH'},
'reference': 'NONREF\n55555\nGehalt OktoberFirma Mustermann GmbH'},
],
[
{'amount': '-400.62',
'date': '2012-02-02',
'payer': 'MARTHAMUELLER',
'bic': '20020020',
'reference': 'RECHNUNGSNR. 1210815 KUNDENNR. 01234 22222222 DATUM 01.02.2012'},
'reference': 'NONREF\nRECHNUNGSNR. 1210815 KUNDENNR. 01234 22222222'},
{'amount': '-1210.00',
'date': '2012-02-03',
'reference': 'MIETE GOETHESTR. 12',
'reference': 'NONREF\nMIETE GOETHESTR. 12',
'payer': 'ABC IMMOBILIEN GMBH',
'bic': '30030030',
'iban': '3333333333'},
{'amount': '30.00',
'date': '2012-02-03',
'payer': 'STEFAN SCHMIDT',
'bic': '40040040',
'reference': 'RECHNUNG 20120188 STEFAN SCHMIDTKUNDENR. 4711,'},
'reference': 'NONREF\nRECHNUNG 20120188STEFAN SCHMIDTKUNDENR. 4711,'},
{'amount': '89.97',
'date': '2012-02-03',
'payer': 'PETER PETERSEN',
'iban': '5555555555',
'bic': '50050050',
'reference': 'RECHNUNG 20120165 PETER PETERSEN'}
'reference': 'NONREF\n000000000001\nRECHNUNG 20120165PETER PETERSEN'}
],
[
{'amount': '5000.00', 'date': '2002-03-17', 'reference': '68790452'},
{'amount': '5000.00', 'date': '2002-03-17',
'reference': '68790452\nVerwendungszweck 1\nVerwendungszweck 2\nEmpfänger\nBuchungstext\n12345\n1000\n4711'},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': '3037010000'},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '20000.00', 'date': '2002-03-22', 'reference': ''},
{'amount': '-50000.00', 'date': '2002-03-24', 'reference': ''}
{'amount': '20000.00', 'date': '2002-03-22', 'reference': 'Meyer + Schneider\nTestkonto\n37010000\n87132101'},
{'amount': '-50000.00', 'date': '2002-03-24', 'reference': 'bekannt\n12345'}
],
[
{'amount': '12.00',
'date': '2017-08-23',
'payer': 'Peter Schneider',
'iban': 'DE13495179316396679327',
'bic': 'NOTABIC',
'reference': 'Democon-Abcde (Peter Schneider ), Kategorie: Alles - E innahmen - Veranstaltungen Democon #1111'},
'reference': 'NONREF\nDemocon-Abcde (Peter Schneider), Kategorie: Alles - Einnahmen - Veranstaltungen Democon #1111'},
{'amount': '12.00',
'date': '2017-08-23',
'payer': 'Peter Schneider',
'iban': 'DE13495179316396679327',
'bic': 'NOTABIC',
'reference': 'Democon-Abcde (Peter Schneider ), Kategorie: Alles - E innahmen - Veranstaltungen Democon #1111'},
'reference': 'NONREF\nDemocon-Abcde (Peter Schneider), Kategorie: Alles - Einnahmen - Veranstaltungen Democon #1111'},
{'amount': '12.00',
'date': '2017-08-24',
'payer': 'Peter Schneider',
'iban': 'DE13495179316396679327',
'bic': 'NOTABIC',
'reference': 'Democon-Abcde (Peter Schneider ), Kategorie: Alles- E innahmen - Veranstaltungen Democon #1111'},
'reference': 'NONREF\nDemocon-Abcde (Peter Schneider), Kategorie: Alles- Einnahmen - Veranstaltungen Democon #1111'},
]
]

Expand Down

0 comments on commit cd7e353

Please sign in to comment.