Remove usage of pkg_resources in docs/conf.py (#4251)

This commit is contained in:
Victorien 2024-02-26 16:49:39 +01:00 committed by GitHub
parent ea66d40dd7
commit 899002399a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,10 +15,9 @@
import os import os
import string import string
from importlib.metadata import version
from pathlib import Path from pathlib import Path
from pkg_resources import get_distribution
CURRENT_DIR = Path(__file__).parent CURRENT_DIR = Path(__file__).parent
@ -43,7 +42,7 @@ def make_pypi_svg(version: str) -> None:
# Autopopulate version # Autopopulate version
# The version, including alpha/beta/rc tags, but not commit hash and datestamps # The version, including alpha/beta/rc tags, but not commit hash and datestamps
release = get_distribution("black").version.split("+")[0] release = version("black").split("+")[0]
# The short X.Y version. # The short X.Y version.
version = release version = release
for sp in "abcfr": for sp in "abcfr":