Skip to content

Commit

Permalink
More robust file resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
owickstrom committed Nov 9, 2022
1 parent daca8d6 commit 1e80ab9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import sphinx_rtd_theme
import re
import os

import datetime

Expand All @@ -29,9 +30,11 @@
copyright = u'2020-2022, Oskar Wickström'
author = u'Oskar Wickström'

dir_path = os.path.dirname(os.path.realpath(__file__))


def get_version():
with open("../../pyproject.toml", "r") as f:
with open(f"{dir_path}/../../pyproject.toml", "r") as f:
for line in f.readlines():
matches = re.match(r'version = "(.*)"', line)
if matches:
Expand Down

0 comments on commit 1e80ab9

Please sign in to comment.