Skip to content

Commit

Permalink
Switch to pbr for less boilerplate
Browse files Browse the repository at this point in the history
Begins removes lots of argparse boilerplate; pbr removes lots of
setup.py boilerplate.
  • Loading branch information
jamezpolley committed May 21, 2015
1 parent d505860 commit f562e56
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 43 deletions.
29 changes: 29 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[metadata]
name = begins
author = Aaron Iles
author-email = [email protected]
summary = Command line programs for busy developers
description-file = README.rst
home-page = http://begins.readthedocs.org
license = ASL
classifier =
Development Status :: 4 - Beta
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Operating System :: MacOS :: MacOS X
Operating System :: POSIX :: Linux
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Software Development :: Libraries :: Python Module
[backwards_compat]
zip_safe = false
[files]
packages =
begins
45 changes: 2 additions & 43 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,11 @@
import re
import sys


def load_version(filename='begin/version.py'):
"Parse a __version__ number from a source file"
with open(filename) as source:
text = source.read()
match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", text)
if not match:
msg = "Unable to find version number in {}".format(filename)
raise RuntimeError(msg)
version = match.group(1)
return version

PYTHON3K = sys.version_info[0] > 2

requires = ['funcsigs'] if sys.version_info[:2] < (3, 3) else []
requires += ['argparse'] if sys.version_info[:2] < (2, 7) else []

setup(
name="begins",
version=load_version(),
packages=['begin'],
zip_safe=False,
author="Aaron Iles",
author_email="[email protected]",
url="http://begins.readthedocs.org",
description="Command line programs for busy developers",
long_description=open('README.rst').read(),
license="ASL",
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
],
install_requires=requires,
setup_requires=['pbr'],
pbr=True,
tests_require=['mock'] + ([] if PYTHON3K else ['unittest2']),
test_suite="tests" if PYTHON3K else "unittest2.collector"
)

0 comments on commit f562e56

Please sign in to comment.