Skip to content

Commit 4da5ef9

Browse files
committed
Exclude tests from dist package.
Learned a lot about setup.py and MANIFEST.in by reading the files used by [pip](https://github.com/pypa/pip) and experimenting. This version of the control files should be a lot better at keeping cruft from getting in the sdist package.
1 parent 16210da commit 4da5ef9

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ include INSTALL
44
include LICENSE
55
include MANIFEST.in
66
include README.md
7-
recursive-include docs Makefile *.rst *.py
7+
recursive-include docs *.rst
8+
prune docs/_build

setup.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
if 'nosetests' in sys.argv[1:]:
99
setup_requires.append('nose>=1.0')
1010

11+
tests_require=['nose>=1.0']
12+
1113
setup(
1214
name='iptools',
1315
version=__version__,
@@ -18,9 +20,10 @@
1820
download_url='http://pypi.python.org/packages/source/i/iptools/',
1921
license='BSD',
2022
platforms=['any', ],
21-
packages=find_packages(),
23+
packages=find_packages(exclude=['docs', 'tests', 'tests.*']),
2224
include_package_data=True,
23-
test_suite='tests',
25+
test_suite='nose.collector',
26+
tests_require=tests_require,
2427
setup_requires=setup_requires,
2528
classifiers=[
2629
'Development Status :: 5 - Production/Stable',
@@ -37,10 +40,18 @@
3740
'Topic :: Utilities',
3841
'Topic :: Internet',
3942
],
40-
long_description="""Utilities for manipulating IPv4 and IPv6 addresses
41-
including a class that can be used to include CIDR network blocks
42-
in Django's INTERNAL_IPS setting.""",
43+
keywords="ip2long long2ip django cidr ipv4 ipv6",
44+
long_description="""
45+
Utilities for manipulating IPv4 and IPv6 addresses including a
46+
class that can be used to include CIDR network blocks in Django's
47+
INTERNAL_IPS setting.
48+
49+
Full documentation at http://python-iptools.readthedocs.org/
50+
""",
4351
zip_safe=False,
52+
extras_require={
53+
'testing':tests_require,
54+
},
4455
)
4556

4657
# vim: set sw=4 ts=4 sts=4 et :

0 commit comments

Comments
 (0)