-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix packaging #5624
Merged
Merged
Fix packaging #5624
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
include README.md | ||
include LICENSE.md | ||
recursive-include rest_framework/static *.js *.css *.png *.eot *.svg *.ttf *.woff | ||
recursive-include rest_framework/templates *.html | ||
recursive-include rest_framework/templates *.html schema.js | ||
global-exclude __pycache__ | ||
global-exclude *.py[co] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
import sys | ||
from io import open | ||
|
||
from setuptools import setup | ||
from setuptools import setup, find_packages | ||
|
||
try: | ||
from pypandoc import convert | ||
|
@@ -28,31 +28,6 @@ def get_version(package): | |
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) | ||
|
||
|
||
def get_packages(package): | ||
""" | ||
Return root package and all sub-packages. | ||
""" | ||
return [dirpath | ||
for dirpath, dirnames, filenames in os.walk(package) | ||
if os.path.exists(os.path.join(dirpath, '__init__.py'))] | ||
|
||
|
||
def get_package_data(package): | ||
""" | ||
Return all files under the root package, that are not in a | ||
package themselves. | ||
""" | ||
walk = [(dirpath.replace(package + os.sep, '', 1), filenames) | ||
for dirpath, dirnames, filenames in os.walk(package) | ||
if not os.path.exists(os.path.join(dirpath, '__init__.py'))] | ||
|
||
filepaths = [] | ||
for base, filenames in walk: | ||
filepaths.extend([os.path.join(base, filename) | ||
for filename in filenames]) | ||
return {package: filepaths} | ||
|
||
|
||
version = get_version('rest_framework') | ||
|
||
|
||
|
@@ -84,8 +59,8 @@ def get_package_data(package): | |
long_description=read_md('README.md'), | ||
author='Tom Christie', | ||
author_email='[email protected]', # SEE NOTE BELOW (*) | ||
packages=get_packages('rest_framework'), | ||
package_data=get_package_data('rest_framework'), | ||
packages=find_packages(exclude=['tests*']), | ||
include_package_data=True, | ||
install_requires=[], | ||
zip_safe=False, | ||
classifiers=[ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!