Skip to content

Commit 9c8e475

Browse files
committed
bump django 5.2 and django-oscar to 4.0
1 parent 04b77bd commit 9c8e475

File tree

10 files changed

+52
-70
lines changed

10 files changed

+52
-70
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
python-version: [3.6, 3.7, 3.8, 3.9]
18-
django-version: [2.2]
17+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
18+
django-version: ['4.2', '5.2']
19+
exclude:
20+
# Django 5.2(LTS) supports python 3.10 and up.
21+
- django-version: '5.2'
22+
python-version: '3.8'
23+
- django-version: '5.2'
24+
python-version: '3.9'
1925
services:
2026
postgres:
21-
image: postgres:10
27+
image: postgres:16
2228
ports:
2329
- 5432/tcp
2430
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
@@ -50,18 +56,19 @@ jobs:
5056
- name: Upload coverage to Codecov
5157
uses: codecov/codecov-action@v1
5258
with:
53-
fail_ci_if_error: true
59+
fail_ci_if_error: false
5460
lint_python:
5561
runs-on: ubuntu-latest
5662
steps:
57-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v4
5864
- name: Set up Python ${{ matrix.python-version }}
59-
uses: actions/setup-python@v2
65+
uses: actions/setup-python@v5
6066
with:
61-
python-version: 3.7
67+
python-version: 3.11
6268
- name: Install dependencies
6369
run: |
6470
python -m pip install --upgrade pip
71+
pip install -e .[test]
6572
pip install -r requirements.txt
6673
- name: Run linters
6774
run: |

paypal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '2.0.0'
1+
VERSION = '3.0.0'

requirements.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Testing
2-
django-oscar>=2.0,<3.2
3-
django-webtest==1.9.10
4-
tox>=3.20<4
5-
pytest-django==4.5.2
6-
pytest-cov>=2.10<3
7-
django-widget-tweaks==1.4.9
2+
django-oscar==4.0
3+
django-webtest
4+
pytest-django
5+
pytest-cov
86
sorl-thumbnail
97
coverage
108

sandbox/apps/shipping/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from decimal import Decimal as D
22

3-
from oscar.apps.shipping.methods import Free, FixedPrice
3+
from oscar.apps.shipping.methods import FixedPrice, Free
44
from oscar.apps.shipping.repository import Repository as CoreRepository
55

66

sandbox/settings.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
# Django settings for oscar project.
66
PROJECT_DIR = os.path.dirname(__file__)
7-
location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
7+
location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)),
8+
x)
89

910
DEBUG = True
1011
TEMPLATE_DEBUG = True
@@ -21,12 +22,14 @@
2122

2223
DATABASES = {
2324
'default': {
24-
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
25-
'NAME': location('db.sqlite'), # Or path to database file if using sqlite3.
26-
'USER': '', # Not used with sqlite3.
27-
'PASSWORD': '', # Not used with sqlite3.
28-
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
29-
'PORT': '', # Set to empty string for default. Not used with sqlite3.
25+
'ENGINE': 'django.db.backends.sqlite3',
26+
# Add 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
27+
'NAME': location('db.sqlite'),
28+
# Or path to database file if using sqlite3.
29+
'USER': '', # Not used with sqlite3.
30+
'PASSWORD': '', # Not used with sqlite3.
31+
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
32+
'PORT': '', # Set to empty string for default. Not used with sqlite3.
3033
}
3134
}
3235
ATOMIC_REQUESTS = True
@@ -206,7 +209,6 @@
206209
}
207210
}
208211

209-
210212
INSTALLED_APPS = [
211213
'django.contrib.auth',
212214
'django.contrib.contenttypes',
@@ -275,7 +277,8 @@
275277
APPEND_SLASH = True
276278

277279
# Oscar settings
278-
from oscar.defaults import * # noqa
280+
from oscar.defaults import * # noqa
281+
279282
OSCAR_ALLOW_ANON_CHECKOUT = True
280283

281284
OSCAR_SHOP_TAGLINE = 'PayPal'
@@ -301,7 +304,6 @@
301304
]
302305
})
303306

304-
305307
# Haystack settings
306308
HAYSTACK_CONNECTIONS = {
307309
'default': {

sandbox/urls.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
from django.apps import apps
2-
from django.conf.urls.i18n import i18n_patterns
32
from django.conf import settings
3+
from django.conf.urls.i18n import i18n_patterns
4+
from django.conf.urls.static import static
45
from django.contrib import admin
56
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
6-
from django.conf.urls.static import static
77
from django.urls import include, path
88

9-
109
admin.autodiscover()
1110

1211
urlpatterns = [
@@ -17,11 +16,14 @@
1716
# PayPal Express integration...
1817
path('checkout/paypal/', include('paypal.express_checkout.urls')),
1918
# Dashboard views for Payflow Pro
20-
path('dashboard/paypal/payflow/', apps.get_app_config("payflow_dashboard").urls),
19+
path('dashboard/paypal/payflow/',
20+
apps.get_app_config("payflow_dashboard").urls),
2121
# Dashboard views for Express
22-
path('dashboard/paypal/express/', apps.get_app_config("express_dashboard").urls),
22+
path('dashboard/paypal/express/',
23+
apps.get_app_config("express_dashboard").urls),
2324
# Dashboard views for Express Checkout
24-
path('dashboard/paypal/express-checkout/', apps.get_app_config('express_checkout_dashboard').urls),
25+
path('dashboard/paypal/express-checkout/',
26+
apps.get_app_config('express_checkout_dashboard').urls),
2527
path('', include(apps.get_app_config('oscar').urls[0])),
2628
)
2729

@@ -31,6 +33,6 @@
3133
settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
3234

3335
import debug_toolbar
34-
urlpatterns = [
35-
path('__debug__/', include(debug_toolbar.urls)),
36-
] + urlpatterns
36+
37+
urlpatterns = [path('__debug__/',
38+
include(debug_toolbar.urls)), ] + urlpatterns

setup.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
packages=find_packages(exclude=['sandbox*', 'tests*']),
1818
include_package_data=True,
1919
install_requires=[
20-
'django>=2.2,<4.2',
20+
'django>=4.2',
2121
'paypal-checkout-serversdk>=1.0.1',
22-
'requests>=2.26.0',
22+
'requests',
2323
'django-localflavor'
2424
],
2525
extras_require={
26-
'oscar': ['django-oscar>=2.0,<4.0']
26+
'oscar': ['django-oscar>=4.0']
2727
},
2828
# See http://pypi.python.org/pypi?%3Aaction=list_classifiers
2929
classifiers=[
@@ -35,9 +35,6 @@
3535
'Operating System :: Unix',
3636
'Programming Language :: Python',
3737
'Programming Language :: Python :: 3',
38-
'Programming Language :: Python :: 3.6',
39-
'Programming Language :: Python :: 3.7',
40-
'Programming Language :: Python :: 3.8',
41-
'Programming Language :: Python :: 3.9',
38+
'Programming Language :: Python :: 3.11',
4239
'Topic :: Other/Nonlisted Topic'],
4340
)

tests/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,5 @@
118118
SITE_ID = 1
119119
ROOT_URLCONF = 'tests.urls'
120120

121-
STATIC_URL = '/'
122-
STATIC_ROOT = '/static/'
121+
STATIC_URL = '/static'
122+
MEDIA_URL = '/media'

tests/unit/express/view_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.test import TestCase, override_settings
66
from django.test.client import Client
77
from django.urls import reverse
8-
from django.utils.encoding import force_text
8+
from django.utils.encoding import force_str
99
from oscar.apps.basket.models import Basket
1010
from oscar.apps.order.models import Order
1111
from oscar.core.loading import get_classes
@@ -185,9 +185,9 @@ def perform_action(self):
185185
def test_context(self):
186186
self.assertEqual(D('33.98'), self.response.context['paypal_amount'])
187187
self.assertEqual('Royal Mail Signed For™ 2nd Class',
188-
force_text(self.response.context['shipping_method'].name))
188+
force_str(self.response.context['shipping_method'].name))
189189
self.assertEqual('uk_rm_2ndrecorded',
190-
force_text(self.response.context['shipping_method'].code))
190+
force_str(self.response.context['shipping_method'].code))
191191

192192
def test_keys_in_context(self):
193193
keys = ('shipping_address', 'shipping_method',

tox.ini

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

0 commit comments

Comments
 (0)