Skip to content

Commit

Permalink
Add __version__ to twtxt, make use of it elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
buckket committed Feb 16, 2016
1 parent f5ee679 commit 93fa2e0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import alabaster

import twtxt

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -61,9 +63,9 @@
# built documents.
#
# The short X.Y version.
version = '1.2.0'
version = twtxt.__version__
# The full version, including alpha/beta/rc tags.
release = '1.2.0'
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 1 addition & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Welcome to twtxt!
=================

Current release: v\ |version|.
Release: v\ |version|.

Welcome to twtxt’s documentation. This documentation is divided into multiple parts.
We recommend you to get started with the :ref:`installation` and then head over to the
Expand Down Expand Up @@ -40,8 +40,5 @@ This part of the documentation describes the modules, classes, functions and oth

api




.. _GitHub: https://github.com/buckket/twtxt
.. _irc.freenode.net: https://freenode.net/
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import ast
import re
import sys
from setuptools import setup, find_packages

from setuptools import find_packages
from setuptools import setup

_version_re = re.compile(r'__version__\s+=\s+(.*)')


if sys.version_info < (3, 4, 1):
raise RuntimeError("twtxt requires Python 3.4.1+")

with open('twtxt/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))


setup(
name='twtxt',
version='1.2.0',
version=version,

url='https://github.com/buckket/twtxt',

Expand Down
3 changes: 3 additions & 0 deletions twtxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
:copyright: (c) 2016 by buckket.
:license: MIT, see LICENSE for more details.
"""


__version__ = '1.2.1-dev'

0 comments on commit 93fa2e0

Please sign in to comment.