Skip to content

Commit

Permalink
PEP-396
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Jan 14, 2015
1 parent 9cb5f9c commit a59d4db
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import sys
import os

import vpoller

# 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 @@ -55,9 +57,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3.5'
version = vpoller.__version__
# The full version, including alpha/beta/rc tags.
release = '0.3.5'
release = vpoller.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
17 changes: 14 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
from setuptools import setup
import re
import ast

from setuptools import setup, find_packages


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

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

setup(
name='vpoller',
version='0.3.5',
version=version,
description='Distributed VMware vSphere API Proxy',
long_description=open('README.rst').read(),
author='Marin Atanasov Nikolov',
author_email='[email protected]',
license='BSD',
url='https://github.com/dnaeon/py-vpoller',
download_url='https://github.com/dnaeon/py-vpoller/releases',
packages=['vpoller', 'vpoller.helpers'],
package_dir={'': 'src'},
packages=find_packages('src'),
scripts=[
'src/vpoller-client',
'src/vpoller-proxy',
Expand Down
3 changes: 2 additions & 1 deletion src/vpoller-client
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ discovering and polling of vSphere Object properties.

import logging

from vpoller import __version__
from vpoller.client import VPollerClient
from docopt import docopt

Expand Down Expand Up @@ -70,7 +71,7 @@ Examples:
"""

args = docopt(usage, version='0.3.5')
args = docopt(usage, version=__version__)

level = logging.DEBUG if args['--debug'] else logging.INFO
logging.basicConfig(
Expand Down
3 changes: 2 additions & 1 deletion src/vpoller-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ between a pool of ZeroMQ workers.
import os
import logging

from vpoller import __version__
from vpoller.client import VPollerClient
from vpoller.proxy import VPollerProxyManager
from docopt import docopt
Expand Down Expand Up @@ -98,7 +99,7 @@ Options:
"""

args = docopt(usage, version='0.3.5')
args = docopt(usage, version=__version__)

if not os.path.exists(args['--file']):
raise SystemExit, 'Configuration file %s does not exist'
Expand Down
3 changes: 2 additions & 1 deletion src/vpoller-worker
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ performing the actual polling from a vCenter server.
import os
import logging

from vpoller import __version__
from vpoller.client import VPollerClient
from vpoller.worker import VPollerWorkerManager
from docopt import docopt
Expand Down Expand Up @@ -110,7 +111,7 @@ Options:
"""

args = docopt(usage, version='0.3.5')
args = docopt(usage, version=__version__)

if not os.path.exists(args['--file']):
raise SystemExit, 'Configuration file %s does not exist' % args['--file']
Expand Down
2 changes: 1 addition & 1 deletion src/vpoller/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ == '0.3.5'
__version__ = '0.3.5'

0 comments on commit a59d4db

Please sign in to comment.