Skip to content

Commit 768e398

Browse files
author
Laurent Franceschetti
committed
Fix obsolete call to pkg_resources (#157)
- This has been replaced by importlib.metadata. Since version 3.7 of Python is end of life, the minimal version of python supported is now 3.8.
1 parent e8e0356 commit 768e398

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mkdocs_macros/context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import subprocess
1717
import platform
1818
import traceback
19-
import pkg_resources
19+
from importlib.metadata import version as package_version
2020
import datetime
2121
from dateutil.parser import parse as date_parse
2222
from functools import partial
@@ -289,8 +289,7 @@ def define_env(env):
289289
'system_version': system_version(),
290290
'python_version': python_version(),
291291
'mkdocs_version': mkdocs.__version__,
292-
'macros_plugin_version':
293-
pkg_resources.get_distribution(PACKAGE_NAME).version,
292+
'macros_plugin_version': package_version(PACKAGE_NAME),
294293
'jinja2_version': jinja2.__version__,
295294
# 'site_git_version': site_git_version(),
296295
}

webdoc/docs/advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Including external files in pages
1717
### Usage
1818

1919
To include external files within a page, you may use the
20-
`include` directive from jinja2, directly in your markdown code e.g.:
20+
[`include` directive of jinja2](https://jinja.palletsprojects.com/en/3.1.x/templates/#include), directly in your markdown code e.g.:
2121

2222
```jinja2
2323
## Paragraph

0 commit comments

Comments
 (0)