Skip to content

Commit

Permalink
Merge pull request #655 from strictdoc-project/fix-package-data
Browse files Browse the repository at this point in the history
setup.py: fix copying of the HTML files
  • Loading branch information
stanislaw committed Apr 5, 2022
2 parents 26a525f + fa2f170 commit e9fe5ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
26 changes: 16 additions & 10 deletions setup.py
Expand Up @@ -5,21 +5,27 @@

import strictdoc

package_data = {}
package_data = {
"": ["requirements.txt", "requirements.development.txt"],
# It looks like the package data in setup.py does not support globbing
# (see pypa/setuptools#1806, https://github.com/pypa/setuptools/issues/1806)
# Doing the globbing manually for now.
# https://stackoverflow.com/questions/27664504/how-to-add-package-data-recursively-in-python-setup-py
# TODO: Can be better.
"strictdoc.export.html": [
"*",
"*/*",
"*/*/*",
"*/*/*/*",
"*/*/*/*/*",
"*/*/*/*/*/*",
],
}

data_files = [
"requirements.txt",
"requirements.development.txt",
]
start_point = os.path.join("strictdoc", "export", "html")
for root, dirs, files in os.walk(start_point):
root_files = []
for file in files:
if file.endswith(".py") or file.endswith(".pyc"):
continue
root_files.append(os.path.join(root, file))
if len(root_files) > 0:
data_files.append((root, root_files))

with open("requirements.txt") as fp:
REQUIREMENTS = fp.read()
Expand Down
2 changes: 1 addition & 1 deletion strictdoc/__init__.py
@@ -1 +1 @@
__version__ = "0.0.22"
__version__ = "0.0.23"

0 comments on commit e9fe5ae

Please sign in to comment.