File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 11
11
# serve to show the default.
12
12
import os
13
13
import sys
14
-
15
- from pkg_resources import get_distribution
14
+ from importlib import metadata
16
15
17
16
# If extensions (or modules to document with autodoc) are in another directory,
18
17
# add these directories to sys.path here. If the directory is relative to the
48
47
# |version| and |release|, also used in various other places throughout the
49
48
# built documents.
50
49
#
51
- release = get_distribution ("django-simple-history" ). version
50
+ release = metadata . version ("django-simple-history" )
52
51
# for example take major/minor
53
52
version = "." .join (release .split ("." )[:2 ])
54
53
Original file line number Diff line number Diff line change 1
- from pkg_resources import DistributionNotFound , get_distribution
1
+ from importlib import metadata
2
2
3
3
try :
4
- __version__ = get_distribution (__name__ ). version
5
- except DistributionNotFound :
4
+ __version__ = metadata . version (__name__ )
5
+ except metadata . PackageNotFoundError :
6
6
# package is not installed
7
7
pass
8
8
You can’t perform that action at this time.
0 commit comments