Skip to content

Commit

Permalink
Support Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
max-muoto committed Nov 4, 2023
1 parent 78031f0 commit 85fde08
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: "ubuntu-20.04"
strategy:
matrix:
python: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout the source code
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Compatible with

- **Django Rest Framework**: 3.10, 3.11, 3.12, 3.13, 3.14
- **Django**: 2.2, 3.0, 3.1, 3.2, 4.0, 4.1
- **Python**: 3.6, 3.7, 3.8, 3.9, 3.10, 3.11
- **Python**: 3.8, 3.9, 3.10, 3.11, 3.12

Only the latest patch version of each ``major.minor`` series of Python, Django and Django REST Framework is supported.

Expand Down Expand Up @@ -95,7 +95,7 @@ Table of contents
Usage
*****

0. Installation
1. Installation
===============

The preferred installation method is directly from pypi:
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from docutils import nodes, utils
from docutils.parsers.rst import roles
from docutils.parsers.rst.roles import set_classes
from pkg_resources import get_distribution
import importlib.metadata

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -47,7 +47,7 @@
# built documents.

# The full version, including alpha/beta/rc tags.
release = get_distribution('drf_yasg').version
release = importlib.metadata.version('drf_yasg')
if 'noscm' in release:
raise AssertionError('Invalid package version string: %s. \n'
'The documentation must be built with drf_yasg installed from a distribution package, '
Expand Down
6 changes: 3 additions & 3 deletions src/drf_yasg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# coding=utf-8
from pkg_resources import DistributionNotFound, get_distribution
import importlib.metadata

__author__ = """Cristi V."""
__email__ = '[email protected]'

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # pragma: no cover
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError: # pragma: no cover
# package is not installed
pass
4 changes: 2 additions & 2 deletions src/drf_yasg/inspectors/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from decimal import Decimal
from inspect import signature as inspect_signature

import pkg_resources
import importlib.metadata
import typing
from django.core import validators
from django.db import models
Expand All @@ -23,7 +23,7 @@
decimal_as_float, field_value_to_representation, filter_none, get_serializer_class, get_serializer_ref_name
)

drf_version = pkg_resources.get_distribution("djangorestframework").version
drf_version = importlib.metadata.version("djangorestframework")

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 85fde08

Please sign in to comment.