Skip to content

Commit

Permalink
GitHub Actions: Test on Python v3.12 and Django v5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Jan 22, 2024
1 parent 84ef643 commit d846c5e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 24 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ jobs:
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
django-version: ['3.2', '4.0', '4.1', '4.2']
fail-fast: false
matrix: # https://docs.djangoproject.com/en/stable/faq/install/#what-python-version-can-i-use-with-django
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
django-version: ['3.2', '4.2', '5.0']
exclude:
- django-version: "3.2"
python-version: "3.11"
- django-version: "3.2"
python-version: "3.12"
- django-version: "5.0"
python-version: "3.8"
- django-version: "5.0"
python-version: "3.9"
services:
postgres:
image: postgres:14
Expand All @@ -31,9 +40,9 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -52,17 +61,17 @@ jobs:
run: |
coverage run --parallel -m pytest -x
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.5.2
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -73,9 +82,9 @@ jobs:
lint_js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up NodeJS
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
Expand All @@ -87,23 +96,23 @@ jobs:
sandbox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Build sandbox
run: |
python -m pip install --upgrade pip
make sandbox
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Build docs
run: |
make docs
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
from oscar import get_version # noqa isort:skip

install_requires = [
'django>=3.2,<4.3',
'django>=3.2,<5.1',
# PIL is required for image fields, Pillow is the "friendly" PIL fork
'pillow>=6.0',
# We use the ModelFormSetView from django-extra-views for the basket page
'django-extra-views>=0.13,<0.15',
# Search support
'django-haystack>=3.0b1',
# Search support # We NEED a production release!!!
'django-haystack @ git+https://github.com/django-haystack/django-haystack.git',
# Treebeard is used for categories
'django-treebeard>=4.3.0',
# Babel is used for currency formatting
Expand Down
2 changes: 1 addition & 1 deletion src/oscar/apps/payment/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ def start_month(self, format="%m/%y"):

# pylint: disable=W0622
def expiry_month(self, format="%m/%y"):
return self.expiry_date.strftime(format)
return self.expiry_date.strftime(format) # pylint: disable=no-member
4 changes: 2 additions & 2 deletions tests/functional/dashboard/test_review.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import timedelta
from datetime import timedelta, timezone as datetime_timezone

from django.urls import reverse
from django.utils import timezone
Expand Down Expand Up @@ -84,7 +84,7 @@ def n_days_ago(days):
ProductReviewSearchForm doesn't recognize the timezone notation.
"""
return timezone.make_naive(
now - timedelta(days=days), timezone=timezone.utc
now - timedelta(days=days), timezone=datetime_timezone.utc
)

now = timezone.now()
Expand Down

0 comments on commit d846c5e

Please sign in to comment.