Skip to content

Commit

Permalink
Add version.py to manage project version number
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler committed Mar 21, 2023
1 parent 3f00e07 commit 6b0e58a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
sys.path.insert(0, os.path.abspath('../'))

import inori
from inori import *

# -- Project information -----------------------------------------------------
Expand All @@ -23,7 +24,7 @@
author = 'Joshua Fehler'

# The full version, including alpha/beta/rc tags
release = 'v0.0.11'
version = inori.__version__


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions inori/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__version_info__ = (0, 0, 11)
__version__ = '.'.join(map(str, __version_info__))
17 changes: 16 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@ def read(filename: str):
return f.read()


def get_version_data() -> dict:
"""Read the project's version file as text."""
data = {}

path = os.path.join(os.path.dirname(__file__), 'inori', 'version.py')

with open(path) as fp:
exec(fp.read(), data)

return data


version_data = get_version_data()


setup(
name="inori",
version="0.0.11",
version=version_data['__version__'],
description="The Universal API Client Constructor.",
long_description=read('README.rst'),
author="Joshua Fehler",
Expand Down

0 comments on commit 6b0e58a

Please sign in to comment.