mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Update package data discovery
This commit is contained in:
20
setup.py
20
setup.py
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user