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 0952343
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 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
4 changes: 2 additions & 2 deletions divik/feature_extraction/_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class HistogramEqualization(BaseEstimator, TransformerMixin):
Based on https://github.com/scikit-image/scikit-image/blob/master/skimage/exposure/exposure.py#L187-L223
Arguments
---------
Parameters
----------
n_bins : int, default 256
Number of bins for histogram equalization.
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
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ sphinx
sphinx-autodoc-typehints
sphinx-rtd-theme
numpydoc
toml
gin-config
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.2"
description = "Divisive iK-means algorithm implementation"
authors = ["Grzegorz Mrukwa <g.mrukwa@gmail.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 0952343

Please sign in to comment.