Refs #40 -- Removed Python 3.2/3.3 support

This commit is contained in:
Raphael Michel
2015-08-22 14:22:55 +02:00
parent 6b341ed485
commit 9ab6cc52c7
6 changed files with 7 additions and 22 deletions

View File

@@ -1,8 +1,6 @@
language: python language: python
sudo: false sudo: false
python: python:
- "3.2"
- "3.3"
- "3.4" - "3.4"
install: install:
- pip install -q -r src/requirements.txt - pip install -q -r src/requirements.txt

View File

@@ -15,8 +15,7 @@ You get those two bundled in the ``pretix/standalone`` docker image.
If you want to set them up manually, you can also get pretix from GitHub or wait for us to set up proper If you want to set them up manually, you can also get pretix from GitHub or wait for us to set up proper
``pip`` packages and set up a simple gunicorn instance pointing to the ``pretix.wsgi`` endpoint. ``pip`` packages and set up a simple gunicorn instance pointing to the ``pretix.wsgi`` endpoint.
To run pretix, you will need at least Python 3.2, although we recommend **Python 3.4** as we will To run pretix, you will need **at least Python 3.4**.
remove support for 3.2 soon and some features (like PDF output) already do not work with 3.2.
You can get the direct dependencies by doing a ``pip install -r requirements.txt`` in the pretix source You can get the direct dependencies by doing a ``pip install -r requirements.txt`` in the pretix source
directory. You'll also need ``nodejs`` and the ``less`` node package. We'll provide detailled documentation directory. You'll also need ``nodejs`` and the ``less`` node package. We'll provide detailled documentation

View File

@@ -1,9 +0,0 @@
import importlib.util
import sys
def module_exists(modname):
if sys.version_info[0:1] >= (3, 4):
return bool(importlib.util.find_spec(modname))
else:
return bool(importlib.find_loader(modname))

View File

@@ -42,7 +42,7 @@
</form> </form>
{% else %} {% else %}
<div class="alert alert-error"> <div class="alert alert-error">
{% trans "HBCI is only available with Python 3.3 or newer and with aqbanking-cli and aqhbci-tool4 installed." %} {% trans "HBCI is only available with aqbanking-cli and aqhbci-tool4 installed." %}
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@@ -108,12 +108,9 @@ class ImportView(EventPermissionRequiredMixin, TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs) ctx = super().get_context_data(**kwargs)
if sys.version_info[:2] >= (3, 3): ctx['hbci_available'] = shutil.which('aqbanking-cli') and shutil.which('aqhbci-tool4')
ctx['hbci_available'] = shutil.which('aqbanking-cli') and shutil.which('aqhbci-tool4') if ctx['hbci_available']:
if ctx['hbci_available']: ctx['hbci_form'] = self.hbci_form
ctx['hbci_form'] = self.hbci_form
else:
ctx['hbci_available'] = False
return ctx return ctx
def process_csv_file(self): def process_csv_file(self):

View File

@@ -1,4 +1,5 @@
import importlib import importlib
import importlib.util
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
@@ -6,7 +7,6 @@ from django.conf.urls import include, url
import pretix.control.urls import pretix.control.urls
import pretix.presale.urls import pretix.presale.urls
from pretix.helpers.importlib import module_exists
urlpatterns = [ urlpatterns = [
url(r'^control/', include(pretix.control.urls, namespace='control')), url(r'^control/', include(pretix.control.urls, namespace='control')),
@@ -23,7 +23,7 @@ if settings.DEBUG:
pluginpatterns = [] pluginpatterns = []
for app in apps.get_app_configs(): for app in apps.get_app_configs():
if hasattr(app, 'PretixPluginMeta'): if hasattr(app, 'PretixPluginMeta'):
if module_exists(app.name + '.urls'): if importlib.util.find_spec(app.name + '.urls'):
urlmod = importlib.import_module(app.name + '.urls') urlmod = importlib.import_module(app.name + '.urls')
pluginpatterns.append( pluginpatterns.append(
url(r'', include(urlmod, namespace=app.label)) url(r'', include(urlmod, namespace=app.label))