Skip to content

Commit 78da537

Browse files
committed
Merge pull request cemerick#8 from maxcountryman/documentation
Add metadata and docstrings to the modules themselves, derive version in setup.py from there
2 parents c194ea4 + b56910b commit 78da537

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

nrepl/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/env python
22

3+
'''
4+
nrepl
5+
-----
6+
7+
A Python client for the nREPL Clojure networked-REPL server.
8+
9+
:copyright: (c) 2013 by Chas Emerick.
10+
:license: MIT, see LICENSE for more details.
11+
'''
12+
13+
314
import socket
415
import nrepl.bencode as bencode
516
import threading
@@ -8,6 +19,13 @@
819
except ImportError:
920
from urllib.parse import urlparse, ParseResult
1021

22+
__version_info__ = ('0', '0', '3')
23+
__version__ = '.'.join(__version_info__)
24+
__author__ = 'Chas Emerick'
25+
__license__ = 'MIT'
26+
__copyright__ = '(c) 2013 by Chas Emerick'
27+
__all__ = ['connect', 'WatchableConnection']
28+
1129

1230
def _bencode_connect(uri):
1331
s = socket.create_connection(uri.netloc.split(":"))

nrepl/bencode.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/env python
22

3+
'''
4+
nrepl.bencode
5+
-------------
6+
7+
This module provides BEncode-protocol support.
8+
9+
:copyright: (c) 2013 by Chas Emerick.
10+
:license: MIT, see LICENSE for more details.
11+
'''
12+
13+
314
try:
415
from cStringIO import StringIO
516
except ImportError:

setup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@
99
* `development version <https://github.com/cemerick/nrepl-python-client>`_
1010
'''
1111

12+
import os
13+
1214
from setuptools import setup, find_packages
1315

16+
# HACK: Pull the version number without requiring the package to be installed
17+
# beforehand, i.e. without using import.
18+
module_path = os.path.join(os.path.dirname(__file__), 'nrepl/__init__.py')
19+
version_line = [line for line in open(module_path)
20+
if line.startswith('__version_info__')][0]
21+
22+
__version__ = '.'.join(eval(version_line.split('__version_info__ = ')[-1]))
23+
1424
description = "A Python client for the nREPL Clojure networked-REPL server."
1525
classifiers = ['Development Status :: 4 - Beta',
1626
'Environment :: Console',
@@ -24,7 +34,7 @@
2434
'Topic :: Utilities']
2535

2636
setup(name="nrepl-python-client",
27-
version="0.0.3",
37+
version=__version__,
2838
packages=find_packages(),
2939
# metadata for upload to PyPI
3040
author="Chas Emerick",

0 commit comments

Comments
 (0)