Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.11 and test 3.12-dev #545

Merged
merged 12 commits into from
Jun 16, 2023
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.x

- name: Install dependencies
run: |
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: Test

on: [push, pull_request]

env:
FORCE_COLOR: 1

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12-dev']

services:
postgres:
Expand All @@ -27,10 +30,10 @@ jobs:
--health-retries 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -40,7 +43,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
Expand All @@ -64,6 +67,6 @@ jobs:
DB_PORT: 5432

- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
name: Python ${{ matrix.python-version }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ repos:
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Project page: https://readthedocs.org/projects/django-model-utils/

version: 2

build:
os: ubuntu-22.04
tools:
python: "3"

python:
install:
- method: pip
path: .

sphinx:
configuration: docs/conf.py
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ To be released
--------

- Confirm support for `Django 4.2`
- Add support for `Python 3.11` (GH-#545)
- Add support for `Python 3.12` (GH-#545)
- Drop support for `Python 3.7` (GH-#545)

4.3.1 (2022-11-15)
------------------
Expand Down
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# serve to show the default.

import os
from pkg_resources import get_distribution
import importlib.metadata

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -49,7 +49,8 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
release = get_distribution('django-model-utils').version
release = importlib.metadata.version('django-model-utils')

# for example take major/minor
version = '.'.join(release.split('.')[:2])

Expand Down
6 changes: 3 additions & 3 deletions model_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from pkg_resources import DistributionNotFound, get_distribution
import importlib.metadata

from .choices import Choices # noqa:F401
from .tracker import FieldTracker, ModelTracker # noqa:F401

try:
__version__ = get_distribution("django-model-utils").version
except DistributionNotFound: # pragma: no cover
__version__ = importlib.metadata.version('django-model-utils')
except importlib.metadata.PackageNotFoundError: # pragma: no cover
# package is not installed
__version__ = None
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==6.2.5
pytest-django==3.10.0
psycopg2-binary==2.8.6
psycopg2-binary==2.9.5
pytest-cov==2.10.1
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def long_desc(root_path):
maintainer='JazzBand',
url='https://github.com/jazzband/django-model-utils',
packages=find_packages(exclude=['tests*']),
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=['Django>=3.2'],
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -39,10 +39,11 @@ def long_desc(root_path):
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
foarsitter marked this conversation as resolved.
Show resolved Hide resolved
'Programming Language :: Python :: 3.12',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{37,38,39,310}-dj32
py{38,39,310}-dj{40,41,42,main}
py{38,39,310,311,312}-dj{40,41,42,main}
flake8
isort

Expand All @@ -11,6 +11,8 @@ python =
3.8: py38, flake8, isort
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
deps =
Expand All @@ -27,6 +29,7 @@ ignore_errors =
djmain: True
passenv =
CI
FORCE_COLOR
GITHUB_*
DB_*
usedevelop = True
Expand Down
Loading