Skip to content

Commit 3343536

Browse files
authored
Python 3.9 upgrade (#1827)
* Remove unmaintained Vagrant setup/instructions * update python version to 3.9 * upgrade dependencies to reach python3.9 compatibility * upgrade requests, migrate to latest chardet * result of `pyupgrade --py3-plus --py39-plus
1 parent 694bfac commit 3343536

File tree

122 files changed

+98
-524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+98
-524
lines changed

Vagrantfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

base-requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ django-pipeline==1.6.14
33
django-sitetree==1.10.0
44
Django==2.0.13
55
docutils==0.12
6-
Markdown==2.5.2
6+
Markdown==3.3.4
77
cmarkgfm==0.4.2
8-
Pillow==5.1.0
9-
psycopg2==2.7.3.2
8+
Pillow==8.3.1
9+
psycopg2==2.8.6
1010
python3-openid==3.1.0
1111
# lxml used by BeautifulSoup.
12-
lxml==4.1.1
12+
lxml==4.6.3
1313
cssselect==0.9.1
14-
feedparser==5.2.1
14+
feedparser==6.0.8
1515
beautifulsoup4==4.6.0
1616
icalendar==3.8.4
17-
chardet2==2.0.3
17+
chardet==4.0.0
1818
# TODO: We may drop 'django-imagekit' completely.
1919
django-imagekit==4.0.2
2020
git+https://github.com/django-haystack/django-haystack.git@802b0f6f4b3b99314453261876a32bac2bbec94f
@@ -25,7 +25,7 @@ django-tastypie==0.14.1
2525
pytz==2017.2
2626
python-dateutil==2.8.1
2727

28-
requests[security]>=2.20.0
28+
requests[security]>=2.26.0
2929

3030
django-honeypot==0.6.0
3131
django-markupfield==1.4.3

blogs/migrations/0001_initial.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
from django.db import models, migrations
52
import django.utils.timezone
63
from django.conf import settings

blogs/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def text_from_html(body):
2727
soup = BeautifulSoup(body, "html.parser")
2828
texts = soup.findAll(text=True)
2929
visible_texts = filter(tag_visible, texts)
30-
return u" ".join(t.strip() for t in visible_texts)
30+
return " ".join(t.strip() for t in visible_texts)
3131

3232

3333
class BlogEntry(models.Model):

blogs/tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BlogParserTest(unittest.TestCase):
1111
def setUpClass(cls):
1212
super().setUpClass()
1313
cls.test_file_path = get_test_rss_path()
14-
cls.entries = get_all_entries("file://{}".format(cls.test_file_path))
14+
cls.entries = get_all_entries(f"file://{cls.test_file_path}")
1515

1616
def test_entries(self):
1717
self.assertEqual(len(self.entries), 25)

boxes/migrations/0001_initial.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
from django.db import models, migrations
52
import markupfield.fields
63
import django.utils.timezone

boxes/migrations/0002_auto_20150416_1853.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
from django.db import models, migrations
52

63

boxes/migrations/0003_auto_20171101_2138.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# -*- coding: utf-8 -*-
21
# Generated by Django 1.11.5 on 2017-11-01 21:38
3-
from __future__ import unicode_literals
42

53
from django.db import migrations
64

cms/management/commands/create_initial_data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def collect_initial_data_functions(self, app_label):
3535
app_list = apps.get_app_configs()
3636
for app in app_list:
3737
try:
38-
factory_module = importlib.import_module('{}.factories'.format(app.name))
38+
factory_module = importlib.import_module(f'{app.name}.factories')
3939
except ImportError:
4040
continue
4141
else:
@@ -50,7 +50,7 @@ def output(self, app_name, verbosity, *, done=False, result=False):
5050
if done:
5151
self.stdout.write(self.style.SUCCESS('DONE'))
5252
else:
53-
self.stdout.write('Creating initial data for {!r}... '.format(app_name), ending='')
53+
self.stdout.write(f'Creating initial data for {app_name!r}... ', ending='')
5454
if verbosity >= 2 and result:
5555
pprint.pprint(result)
5656

@@ -74,7 +74,7 @@ def flush_handler(self, do_flush, verbosity):
7474
try:
7575
call_command('flush', verbosity=verbosity, interactive=False)
7676
except Exception as exc:
77-
self.stdout.write(self.style.ERROR('{}: {}'.format(type(exc).__name__, exc)))
77+
self.stdout.write(self.style.ERROR(f'{type(exc).__name__}: {exc}'))
7878
return confirm
7979

8080
def handle(self, **options):
@@ -92,7 +92,7 @@ def handle(self, **options):
9292
try:
9393
call_command('loaddata', 'sitetree_menus', '-v0')
9494
except Exception as exc:
95-
self.stdout.write(self.style.ERROR('{}: {}'.format(type(exc).__name__, exc)))
95+
self.stdout.write(self.style.ERROR(f'{type(exc).__name__}: {exc}'))
9696
else:
9797
self.output('sitetree', verbosity, done=True)
9898

@@ -106,7 +106,7 @@ def handle(self, **options):
106106
try:
107107
result = function()
108108
except Exception as exc:
109-
self.stdout.write(self.style.ERROR('{}: {}'.format(type(exc).__name__, exc)))
109+
self.stdout.write(self.style.ERROR(f'{type(exc).__name__}: {exc}'))
110110
continue
111111
else:
112112
self.output(app_name, verbosity, done=True, result=result)

codesamples/migrations/0001_initial.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
from django.db import models, migrations
52
import markupfield.fields
63
import django.utils.timezone

0 commit comments

Comments
 (0)