Merge branch 'master' into swedish-translation

This commit is contained in:
Jelmer 2023-06-16 11:25:36 +02:00 committed by GitHub
commit 23e7ee3382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 52 additions and 20 deletions

View file

@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v4
with: with:
python-version: 3.8 python-version: 3.x
- name: Install dependencies - name: Install dependencies
run: | run: |

View file

@ -2,6 +2,9 @@ name: Test
on: [push, pull_request] on: [push, pull_request]
env:
FORCE_COLOR: 1
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -9,7 +12,7 @@ jobs:
fail-fast: false fail-fast: false
max-parallel: 5 max-parallel: 5
matrix: 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: services:
postgres: postgres:
@ -27,10 +30,10 @@ jobs:
--health-retries 5 --health-retries 5
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -40,7 +43,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)" echo "::set-output name=dir::$(pip cache dir)"
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ${{ steps.pip-cache.outputs.dir }} path: ${{ steps.pip-cache.outputs.dir }}
key: key:
@ -64,6 +67,6 @@ jobs:
DB_PORT: 5432 DB_PORT: 5432
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v3
with: with:
name: Python ${{ matrix.python-version }} name: Python ${{ matrix.python-version }}

View file

@ -14,7 +14,7 @@ repos:
files: ^(model_utils|tests)/ files: ^(model_utils|tests)/
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.3.1 rev: v3.6.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py38-plus]

18
.readthedocs.yml Normal file
View file

@ -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

View file

@ -4,7 +4,11 @@ Changelog
To be released To be released
-------- --------
Swedish translation (GH-#561) - 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)
- Swedish translation (GH-#561)
4.3.1 (2022-11-15) 4.3.1 (2022-11-15)
------------------ ------------------

View file

@ -11,7 +11,7 @@
# serve to show the default. # serve to show the default.
import os import os
from pkg_resources import get_distribution import importlib.metadata
# If extensions (or modules to document with autodoc) are in another directory, # 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 # add these directories to sys.path here. If the directory is relative to the
@ -49,7 +49,8 @@ parent_dir = os.path.dirname(os.path.dirname(__file__))
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
release = get_distribution('django-model-utils').version release = importlib.metadata.version('django-model-utils')
# for example take major/minor # for example take major/minor
version = '.'.join(release.split('.')[:2]) version = '.'.join(release.split('.')[:2])

View file

@ -1,10 +1,10 @@
from pkg_resources import DistributionNotFound, get_distribution import importlib.metadata
from .choices import Choices # noqa:F401 from .choices import Choices # noqa:F401
from .tracker import FieldTracker, ModelTracker # noqa:F401 from .tracker import FieldTracker, ModelTracker # noqa:F401
try: try:
__version__ = get_distribution("django-model-utils").version __version__ = importlib.metadata.version('django-model-utils')
except DistributionNotFound: # pragma: no cover except importlib.metadata.PackageNotFoundError: # pragma: no cover
# package is not installed # package is not installed
__version__ = None __version__ = None

View file

@ -1,4 +1,4 @@
pytest==6.2.5 pytest==6.2.5
pytest-django==3.10.0 pytest-django==3.10.0
psycopg2-binary==2.8.6 psycopg2-binary==2.9.5
pytest-cov==2.10.1 pytest-cov==2.10.1

View file

@ -29,7 +29,7 @@ setup(
maintainer='JazzBand', maintainer='JazzBand',
url='https://github.com/jazzband/django-model-utils', url='https://github.com/jazzband/django-model-utils',
packages=find_packages(exclude=['tests*']), packages=find_packages(exclude=['tests*']),
python_requires=">=3.7", python_requires=">=3.8",
install_requires=['Django>=3.2'], install_requires=['Django>=3.2'],
classifiers=[ classifiers=[
'Development Status :: 5 - Production/Stable', 'Development Status :: 5 - Production/Stable',
@ -39,14 +39,16 @@ setup(
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: Django', 'Framework :: Django',
'Framework :: Django :: 3.2', 'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0', 'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1', 'Framework :: Django :: 4.1',
'Framework :: Django :: 4.2',
], ],
zip_safe=False, zip_safe=False,
package_data={ package_data={

View file

@ -1,7 +1,7 @@
[tox] [tox]
envlist = envlist =
py{37,38,39,310}-dj32 py{37,38,39,310}-dj32
py{38,39,310}-dj{40,41,main} py{38,39,310,311,312}-dj{40,41,42,main}
flake8 flake8
isort isort
@ -11,6 +11,8 @@ python =
3.8: py38, flake8, isort 3.8: py38, flake8, isort
3.9: py39 3.9: py39
3.10: py310 3.10: py310
3.11: py311
3.12: py312
[testenv] [testenv]
deps = deps =
@ -19,6 +21,7 @@ deps =
dj32: Django==3.2.* dj32: Django==3.2.*
dj40: Django==4.0.* dj40: Django==4.0.*
dj41: Django==4.1.* dj41: Django==4.1.*
dj42: Django==4.2.*
djmain: https://github.com/django/django/archive/main.tar.gz djmain: https://github.com/django/django/archive/main.tar.gz
ignore_outcome = ignore_outcome =
djmain: True djmain: True
@ -26,6 +29,7 @@ ignore_errors =
djmain: True djmain: True
passenv = passenv =
CI CI
FORCE_COLOR
GITHUB_* GITHUB_*
DB_* DB_*
usedevelop = True usedevelop = True