Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Update conf
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrochukM committed Mar 7, 2018
1 parent 34edeba commit 212d191
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,10 @@
copyright = '2018, Michael Petrochuk'
author = 'Michael Petrochuk'


def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get(
"encoding", "utf8")) as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


# The short X.Y version
version = find_version('..', 'torchnlp', '__init__.py')
version = torchnlp.__version__
# The full version, including alpha/beta/rc tags
release = find_version('..', 'torchnlp', '__init__.py')
release = torchnlp.__version__

# -- General configuration ---------------------------------------------------

Expand Down

0 comments on commit 212d191

Please sign in to comment.