Skip to content

Commit 74afab4

Browse files
author
Aaron Halfaker
committed
Convert to about.py pattern.
1 parent ce9faf2 commit 74afab4

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

mwcli/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
from .streamer import Streamer
22
from .router import Router
3+
from .about import (__name__, __version__, __author__, __author_email__,
4+
__description__, __license__, __url__)
35

46
read_json = Streamer.read_json
5-
__all__ = [Router, Streamer, read_json]
7+
__all__ = [Router, Streamer, read_json,
8+
__name__, __version__, __author__, __author_email__,
9+
__description__, __license__, __url__]
610

711
__version__ = "0.0.2"

mwcli/about.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__name__ = "mwcli"
2+
__version__ = "0.0.2"
3+
__author__ = "Aaron Halfaker"
4+
__author_email__ = "[email protected]"
5+
__description__ = "A set of utilities for processing MediaWiki on the command line."
6+
__license__ = "MIT"
7+
__url__ = "https://github.com/mediawiki-utilities/python-mwcli"
8+
9+
all = [__name__, __version__, __author__, __author_email__, __description__,
10+
__license__, __url__]

setup.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from distutils.core import setup
33

44
from setuptools import find_packages
5+
about_path = os.path.join(os.path.dirname(__file__), "mwcli/about.py")
6+
exec(compile(open(about_path).read(), about_path, "exec"))
57

68

79
def requirements(fname):
@@ -10,16 +12,15 @@ def requirements(fname):
1012

1113

1214
setup(
13-
name='mwcli',
14-
version="0.0.2",
15-
author='Aaron Halfaker',
16-
author_email='[email protected]',
15+
name=__name__, # noqa
16+
version=__version__, # noqa
17+
author=__author__, # noqa
18+
author_email=__author_email__, # noqa
19+
description=__description__, # noqa
20+
url=__url__, # noqa
21+
license=__license__, # noqa
1722
packages=find_packages(),
1823
scripts=[],
19-
url='http://pypi.python.org/pypi/mwcli',
20-
license=open('LICENSE').read(),
21-
description='A set of utilities for writing MediaWiki command-line ' +
22-
'utilities',
2324
long_description=open('README.md').read(),
2425
install_requires=requirements("requirements.txt"),
2526
test_suite='nose.collector',

0 commit comments

Comments
 (0)