Skip to content

Commit

Permalink
Migrate to pathlib (qiskit-community#39)
Browse files Browse the repository at this point in the history
This looks a lot cleaner than the `os.path.dirname()` stuff
that existed previously.
  • Loading branch information
garrison authored Apr 13, 2022
1 parent 7dd7cae commit b4c1012
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@
"""

# General options:
import os
from pathlib import Path

project = "Template project"
copyright = "2022" # pylint: disable=redefined-builtin
author = ""

_rootdir = Path(__file__).parent.parent

# The full version, including alpha/beta/rc tags
with open(
os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"..",
"prototype_template",
"VERSION.txt",
),
"r",
) as f:
release = f.read()
release = (_rootdir / "prototype_template" / "VERSION.txt").read_text().strip()
# The short X.Y version
version = release

Expand Down

0 comments on commit b4c1012

Please sign in to comment.