Skip to content

Commit

Permalink
Use importlib.metadata to get package version for Sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jul 11, 2022
1 parent b00e94f commit 8d06357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
# flake8: noqa: E402
import sys
from importlib.metadata import version as pkg_version
from os import makedirs, symlink
from os.path import dirname, exists, join
from shutil import copytree, rmtree
Expand All @@ -28,7 +29,6 @@

# Add project path so we can import our package
sys.path.insert(0, '..')
from pyinaturalist import __version__
from pyinaturalist.constants import DOCS_DIR, EXAMPLES_DIR, PROJECT_DIR, SAMPLE_DATA_DIR
from pyinaturalist.docs.model_docs import document_models

Expand All @@ -50,7 +50,7 @@
project = 'pyinaturalist'
source_suffix = ['.rst', '.md']
templates_path = ['_templates']
version = release = __version__
version = release = pkg_version('pyinaturalist')

# Sphinx extensions
extensions = [
Expand Down

0 comments on commit 8d06357

Please sign in to comment.