Skip to content

Commit

Permalink
Solve version resolving for READTHEDOCS
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrukwa committed Jan 17, 2021
1 parent 97eedda commit 5cf56ca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
9 changes: 8 additions & 1 deletion divik/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
"""Unsupervised high-throughput data analysis methods"""
import os

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata

__version__ = importlib_metadata.version(__name__)
if os.environ.get('READTHEDOCS') == 'True':
import toml
dirname = os.path.dirname(__file__)
with open(os.path.join(dirname, '../pyproject.toml')) as f:
__version__ = toml.load(f)['tool']['poetry']['version']
else:
__version__ = importlib_metadata.version(__name__)

from ._summary import plot, reject_split

Expand Down
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import os
import sys

import toml

sys.path.insert(0, os.path.abspath(".."))
from divik import __version__

# -- Project information -----------------------------------------------------

Expand All @@ -20,7 +21,9 @@
author = "Grzegorz Mrukwa"

# The full version, including alpha/beta/rc tags
release = __version__
dirname = os.path.dirname(__file__)
with open(os.path.join(dirname, '../pyproject.toml')) as f:
release = toml.load(f)['tool']['poetry']['version']


# -- General configuration ---------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sphinx
sphinx-autodoc-typehints
sphinx-rtd-theme
numpydoc
toml
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "divik"
version = "3.0.0"
version = "3.0.1"
description = "Divisive iK-means algorithm implementation"
authors = ["Grzegorz Mrukwa <g.mrukwa@gmail.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 5cf56ca

Please sign in to comment.