Skip to content

Commit

Permalink
Fix pkg_resources deprecation warning + CI: bump django and python (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Sep 7, 2023
2 parents 1eeac0b + a0e653f commit ded08f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: check-added-large-files
- id: debug-statements
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: "5.12.0"
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
Expand Down
9 changes: 7 additions & 2 deletions src/robots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from pkg_resources import get_distribution
try:
from importlib.metadata import version

__version__ = get_distribution("django-robots").version
__version__ = version("django-robots")
except ImportError:
from pkg_resources import get_distribution

__version__ = get_distribution("django-robots").version

# needed for Django<3.2
default_app_config = "robots.apps.RobotsConfig"
11 changes: 8 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ envlist =
# list of supported Django/Python versions:
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
py{36,37,38,39,310}-dj{22,31,32}
py{38,39,310}-dj{40}
py{38,39,310}-djmain
py{38,39,310}-dj{40,41}
py{38,39,310,311}-dj42
py{310,311,312}-djmain
py38-{lint,docs}

[gh-actions]
Expand All @@ -13,6 +14,8 @@ python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
usedevelop = true
Expand All @@ -28,7 +31,9 @@ deps =
dj22: django>=2.2,<2.3
dj31: django>=3.1,<3.2
dj32: django>=3.2,<3.3
dj40: django>=4.0a1,<4.1
dj40: django>=4.0,<4.1
dj41: django>=4.1,<4.2
dj42: django>=4.2,<4.3
djmain: https://github.com/django/django/archive/main.tar.gz

[testenv:py38-lint]
Expand Down

0 comments on commit ded08f1

Please sign in to comment.