Skip to content

Commit c5b0d34

Browse files
author
Ryan P Kilby
committed
Packaging should use manifest
1 parent c63e35c commit c5b0d34

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

setup.py

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
from io import open
88

9-
from setuptools import setup
9+
from setuptools import setup, find_packages
1010

1111
try:
1212
from pypandoc import convert
@@ -28,31 +28,6 @@ def get_version(package):
2828
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
2929

3030

31-
def get_packages(package):
32-
"""
33-
Return root package and all sub-packages.
34-
"""
35-
return [dirpath
36-
for dirpath, dirnames, filenames in os.walk(package)
37-
if os.path.exists(os.path.join(dirpath, '__init__.py'))]
38-
39-
40-
def get_package_data(package):
41-
"""
42-
Return all files under the root package, that are not in a
43-
package themselves.
44-
"""
45-
walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
46-
for dirpath, dirnames, filenames in os.walk(package)
47-
if not os.path.exists(os.path.join(dirpath, '__init__.py'))]
48-
49-
filepaths = []
50-
for base, filenames in walk:
51-
filepaths.extend([os.path.join(base, filename)
52-
for filename in filenames])
53-
return {package: filepaths}
54-
55-
5631
version = get_version('rest_framework')
5732

5833

@@ -84,8 +59,8 @@ def get_package_data(package):
8459
long_description=read_md('README.md'),
8560
author='Tom Christie',
8661
author_email='[email protected]', # SEE NOTE BELOW (*)
87-
packages=get_packages('rest_framework'),
88-
package_data=get_package_data('rest_framework'),
62+
packages=find_packages(exclude=['tests*']),
63+
include_package_data=True,
8964
install_requires=[],
9065
zip_safe=False,
9166
classifiers=[

0 commit comments

Comments
 (0)