Update package data discovery

This commit is contained in:
Dougal Matthews
2015-06-19 09:13:55 +01:00
parent 00f96640c4
commit aa7c34e3a7

View File

@@ -31,22 +31,6 @@ def get_packages(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}
if sys.argv[-1] == 'publish':
if os.system("pip freeze | grep wheel"):
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
@@ -72,7 +56,7 @@ setup(
author='Tom Christie',
author_email='tom@tomchristie.com', # SEE NOTE BELOW (*)
packages=get_packages("mkdocs"),
package_data=get_package_data("mkdocs"),
include_package_data=True,
install_requires=[
'click>=4.0',
'Jinja2>=2.7.1',
@@ -108,7 +92,7 @@ setup(
'Topic :: Documentation',
'Topic :: Text Processing',
],
zip_safe=False
zip_safe=False,
)
# (*) Please direct queries to the discussion group: