From baf081c2c280615bfc09ef91d043f2af24f54976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 29 Sep 2019 15:09:42 +0200 Subject: [PATCH] debian: switch to Python 3 (#36233) --- debian/combo-manage | 5 +- debian/control | 59 +++++++++---------- debian/debian_config.py | 6 +- debian/py3dist-overrides | 8 +++ debian/pydist-overrides | 1 - debian/python-combo.install | 1 - debian/python-combo.maintscript | 1 - .../{python-combo.dirs => python3-combo.dirs} | 0 .../{python-combo.docs => python3-combo.docs} | 0 debian/python3-combo.install | 1 + debian/rules | 5 +- debian/settings.py | 3 +- debian/uwsgi.ini | 2 +- manage.py | 2 +- 14 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 debian/py3dist-overrides delete mode 100644 debian/pydist-overrides delete mode 100644 debian/python-combo.install delete mode 100644 debian/python-combo.maintscript rename debian/{python-combo.dirs => python3-combo.dirs} (100%) rename debian/{python-combo.docs => python3-combo.docs} (100%) create mode 100644 debian/python3-combo.install diff --git a/debian/combo-manage b/debian/combo-manage index 804f9b77..ace3e87d 100755 --- a/debian/combo-manage +++ b/debian/combo-manage @@ -18,9 +18,8 @@ fi if test $# -eq 0 then - python ${MANAGE} help + python3 ${MANAGE} help exit 1 fi -python ${MANAGE} "$@" - +python3 ${MANAGE} "$@" diff --git a/debian/control b/debian/control index 81c7cdf6..12da38f9 100644 --- a/debian/control +++ b/debian/control @@ -2,33 +2,32 @@ Source: combo Maintainer: Jérôme Schneider Section: python Priority: optional -Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 9), python-django, dh-python, dh-systemd, sassc +Build-Depends: python3-setuptools, python3-all, python3-django, debhelper (>= 9), dh-python, dh-systemd, sassc Standards-Version: 3.9.6 -X-Python-Version: >= 2.7 -Package: python-combo +Package: python3-combo Architecture: all -Depends: ${misc:Depends}, ${python:Depends}, - python-django (>= 1:1.11), - python-djangorestframework (>= 3.3), - python-gadjo (>= 0.53), - python-pyproj, - python-requests, - python-feedparser, - python-xstatic-josefinsans, - python-xstatic-leaflet, - python-xstatic-leaflet-markercluster, - python-xstatic-opensans, - python-xstatic-roboto-fontface (<< 0.5.0.0), - python-eopayment (>= 1.35), - python-django-haystack (>= 2.4.0), - python-django-ratelimit, - python-sorl-thumbnail, - python-pil, - python-pywebpush, - python-pygal, - python-lxml -Recommends: python-django-mellon, python-whoosh +Depends: ${misc:Depends}, ${python3:Depends}, + python3-django (>= 1:1.11), + python3-djangorestframework (>= 3.3), + python3-gadjo (>= 0.53), + python3-pyproj, + python3-requests, + python3-feedparser, + python3-xstatic-josefinsans, + python3-xstatic-leaflet, + python3-xstatic-leaflet-markercluster, + python3-xstatic-opensans, + python3-xstatic-roboto-fontface (<< 0.5.0.0), + python3-eopayment (>= 1.35), + python3-django-haystack (>= 2.4.0), + python3-django-ratelimit, + python3-sorl-thumbnail, + python3-pil, + python3-pywebpush, + python3-pygal, + python3-lxml +Recommends: python3-django-mellon, python3-whoosh Conflicts: python-lingo Breaks: combo (<< 2.34.post2) Description: Portal Management System (Python module) @@ -36,13 +35,13 @@ Description: Portal Management System (Python module) Package: combo Architecture: all Depends: ${misc:Depends}, - python-combo (= ${binary:Version}), - python-hobo (>= 0.63.1), - python-django-tenant-schemas, - python-psycopg2, - python-django-mellon, + python3-combo (= ${binary:Version}), + python3-hobo (>= 1.34), + python3-django-tenant-schemas, + python3-psycopg2, + python3-django-mellon, uwsgi, - uwsgi-plugin-python + uwsgi-plugin-python3 Recommends: nginx Suggests: postgresql Breaks: python-combo (<< 2.34.post2) diff --git a/debian/debian_config.py b/debian/debian_config.py index 87e421bb..01a70587 100644 --- a/debian/debian_config.py +++ b/debian/debian_config.py @@ -7,7 +7,7 @@ PROJECT_NAME = 'combo' # # hobotization (multitenant) # -execfile('/usr/lib/hobo/debian_config_common.py') +exec(open('/usr/lib/hobo/debian_config_common.py').read()) # add custom hobo agent module INSTALLED_APPS = ('hobo.agent.combo', ) + INSTALLED_APPS @@ -18,7 +18,7 @@ TEMPLATES[0]['OPTIONS']['context_processors'].append('hobo.context_processors.st # # local settings # -execfile(os.path.join(ETC_DIR, 'settings.py')) +exec(open(os.path.join(ETC_DIR, 'settings.py')).read()) # run additional settings snippets -execfile('/usr/lib/hobo/debian_config_settings_d.py') +exec(open('/usr/lib/hobo/debian_config_settings_d.py').read()) diff --git a/debian/py3dist-overrides b/debian/py3dist-overrides new file mode 100644 index 00000000..dd691814 --- /dev/null +++ b/debian/py3dist-overrides @@ -0,0 +1,8 @@ +django_ckeditor python3-django-ckeditor +xstatic_leaflet python3-xstatic-leaflet, +xstatic_leaflet_markercluster python3-xstatic-leaflet-markercluster +xstatic_josefinsans python3-xstatic-josefinsans +xstatic_opensans python3-xstatic-opensans +eopayment python3-eopayment +gadjo python3-gadjo +pywebpush python3-pywebpush diff --git a/debian/pydist-overrides b/debian/pydist-overrides deleted file mode 100644 index 0c6fbc3e..00000000 --- a/debian/pydist-overrides +++ /dev/null @@ -1 +0,0 @@ -django_ckeditor python-django-ckeditor diff --git a/debian/python-combo.install b/debian/python-combo.install deleted file mode 100644 index 5fda4d4e..00000000 --- a/debian/python-combo.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/python2*/*-packages diff --git a/debian/python-combo.maintscript b/debian/python-combo.maintscript deleted file mode 100644 index d9618889..00000000 --- a/debian/python-combo.maintscript +++ /dev/null @@ -1 +0,0 @@ -rm_conffile /etc/cron.hourly/python-combo 1.3-1 python-combo diff --git a/debian/python-combo.dirs b/debian/python3-combo.dirs similarity index 100% rename from debian/python-combo.dirs rename to debian/python3-combo.dirs diff --git a/debian/python-combo.docs b/debian/python3-combo.docs similarity index 100% rename from debian/python-combo.docs rename to debian/python3-combo.docs diff --git a/debian/python3-combo.install b/debian/python3-combo.install new file mode 100644 index 00000000..8e72dc99 --- /dev/null +++ b/debian/python3-combo.install @@ -0,0 +1 @@ +usr/lib/python3.* diff --git a/debian/rules b/debian/rules index 83aef84d..56d08732 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,7 @@ #!/usr/bin/make -f # -*- makefile -*- -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +export PYBUILD_DISABLE=test %: - dh $@ --with python2,systemd + dh $@ --with python3,systemd --buildsystem=pybuild diff --git a/debian/settings.py b/debian/settings.py index d9d69bde..56ff61b9 100644 --- a/debian/settings.py +++ b/debian/settings.py @@ -9,7 +9,8 @@ # WARNING! Quick-start development settings unsuitable for production! # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ -# This file is sourced by "execfile" from /usr/lib/combo/debian_config.py +# This file is sourced by "exec(open(...).read())" from +# /usr/lib/combo/debian_config.py # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False diff --git a/debian/uwsgi.ini b/debian/uwsgi.ini index 342a093a..37af66be 100644 --- a/debian/uwsgi.ini +++ b/debian/uwsgi.ini @@ -2,7 +2,7 @@ auto-procname = true procname-prefix-spaced = combo -plugin = python +plugin = python3 module = combo.wsgi:application http-socket = /run/combo/combo.sock diff --git a/manage.py b/manage.py index 9b191a68..fddbd9fd 100755 --- a/manage.py +++ b/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys