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

Commit

Permalink
Provide version number to documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmerry committed Oct 23, 2018
1 parent 3c92253 commit 1418f55
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions birdisle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os

from . import _birdisle
from ._version import __version__


class Server(object):
Expand Down
2 changes: 2 additions & 0 deletions birdisle/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file is parsed by a regex, so keep the format exactly the same
__version__ = "0.1"
21 changes: 16 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,29 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys
import re
sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------

project = 'birdisle-py'
copyright = '2018, Bruce Merry'
author = 'Bruce Merry'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''
def get_version():
root = os.path.dirname(os.path.dirname(__file__))
with open(os.path.join(root, 'birdisle', '_version.py'), 'r') as f:
content = f.read()
match = re.search('__version__ = "([^"]+)"', content)
version = match.group(1)
release = '.'.join(version.split('.')[:2])
return version, release

# version: The short X.Y version
# release: The full version, including alpha/beta/rc tags
version, release = get_version()


# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/usr/bin/env python
import os
import re
from setuptools import setup, find_packages

with open('README.md', 'r') as f:
long_description = f.read()

with open(os.path.join('birdisle', '_version.py'), 'r') as f:
match = re.search('__version__ = "([^"]+)"', f.read())
version = match.group(1)

tests_require = [
'pytest', 'pytest-forked', 'redis',
'pytest-asyncio; python_version >= "3.5"',
Expand All @@ -13,7 +19,7 @@

setup(
name='birdisle',
version='0.1',
version=version,
author='Bruce Merry',
author_email='[email protected]',
description='Python bindings for birdisle',
Expand Down

0 comments on commit 1418f55

Please sign in to comment.