Skip to content

Commit

Permalink
Merge pull request #12 from nimasmi/chore/python-3-12
Browse files Browse the repository at this point in the history
Chore/Python 3.12
  • Loading branch information
nimasmi authored May 2, 2024
2 parents 89faf9b + c7b882e commit 3ae4bd5
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 24 deletions.
64 changes: 44 additions & 20 deletions .github/workflows/CI-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI tests
on: [push]

env:
poetry-version: 1.2.0
poetry-version: 1.8.2

jobs:
lint:
Expand All @@ -20,61 +20,85 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
django-version: ["3.2.9", "4.1.3", "4.2"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
django-version: ["3.2.9", "4.1.3", "4.2", "5.0.2"]
exclude:
- django-version: "3.2"
# Django too old
- django-version: "3.2.9"
python-version: "3.11"
- django-version: "3.2.9"
python-version: "3.12"

# Django too new
- django-version: "5.0.2"
python-version: "3.8"
- django-version: "5.0.2"
python-version: "3.9"
- django-version: "5.0.2"
python-version: "3.10"
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@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.poetry-version }}
- name: Cache Poetry virtual env
uses: actions/cache@v2
env:
cache-name: cache-poetry-virtualenv
with:
path: .venv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}-${{ hashFiles('pyproject.toml') }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.poetry-version }}
- name: Install Python packages
- name: Install packages
run: |
poetry config virtualenvs.in-project true
poetry remove django
poetry add django==${{ matrix.django-version }} --python ${{ matrix.python-version }}
poetry install
poetry add django==${{ matrix.django-version }}
poetry show django
test:
runs-on: ubuntu-latest
needs: [build, lint]
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
django-version: ["3.2.9", "4.1.3", "4.2"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
django-version: ["3.2.9", "4.1.3", "4.2", "5.0.2"]
exclude:
- django-version: "3.2"
# Django too old
- django-version: "3.2.9"
python-version: "3.11"
- django-version: "3.2.9"
python-version: "3.12"

# Django too new
- django-version: "5.0.2"
python-version: "3.8"
- django-version: "5.0.2"
python-version: "3.9"
- django-version: "5.0.2"
python-version: "3.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.poetry-version }}
- name: Cache Poetry virtual env
uses: actions/cache@v2
env:
cache-name: cache-poetry-virtualenv
with:
path: .venv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}-${{ hashFiles('pyproject.toml') }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.poetry-version }}
- name: Test
run: |
poetry run python -m django --version
poetry run python runtests.py
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## Unreleased

### Features

- Support Python 3.12
- Support Django 5.0

### Development

- Improve version test matrices to skip testing incompatible combinations

## 0.4.0 (2023-11-13)

### Features
Expand Down
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ classifiers = [
license = "BSD-2-Clause"

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
django = ">=3.2,<5.0"
python = ">=3.8,<3.13"
django = [
{version = ">=3.2", python = ">=3.8,<3.13"},
{version = ">=5.0", python = ">=3.10,<3.13"},
]
notifications-python-client = "^8.1.0"

[tool.poetry.dev-dependencies]
Expand All @@ -39,5 +42,5 @@ detect-secrets = "1.4.0"
factory-boy = "^3.2.0"

[build-system]
requires = ["poetry-core>=1.2.0"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 3ae4bd5

Please sign in to comment.