6
6
import sys
7
7
from io import open
8
8
9
- from setuptools import setup
9
+ from setuptools import setup , find_packages
10
10
11
11
try :
12
12
from pypandoc import convert
@@ -28,31 +28,6 @@ def get_version(package):
28
28
return re .search ("__version__ = ['\" ]([^'\" ]+)['\" ]" , init_py ).group (1 )
29
29
30
30
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
-
56
31
version = get_version ('rest_framework' )
57
32
58
33
@@ -84,8 +59,8 @@ def get_package_data(package):
84
59
long_description = read_md ('README.md' ),
85
60
author = 'Tom Christie' ,
86
61
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 ,
89
64
install_requires = [],
90
65
zip_safe = False ,
91
66
classifiers = [
0 commit comments