Skip to content

Commit abef84f

Browse files
Ryan P Kilbycarltongibson
authored andcommitted
Fix packaging (#5624)
* Packaging should use manifest * Add schema.js template to MANIFEST
1 parent fc94fbd commit abef84f

File tree

2 files changed

+4
-29
lines changed

2 files changed

+4
-29
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include README.md
22
include LICENSE.md
33
recursive-include rest_framework/static *.js *.css *.png *.eot *.svg *.ttf *.woff
4-
recursive-include rest_framework/templates *.html
4+
recursive-include rest_framework/templates *.html schema.js
55
global-exclude __pycache__
66
global-exclude *.py[co]

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)