From fa2f1708c69ff9b154c87b6aa546f94053dd7cd6 Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Tue, 5 Apr 2022 07:28:47 +0200 Subject: [PATCH] setup.py: fix copying of the HTML files --- setup.py | 26 ++++++++++++++++---------- strictdoc/__init__.py | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index b409743c9..bd996cbfb 100644 --- a/setup.py +++ b/setup.py @@ -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() diff --git a/strictdoc/__init__.py b/strictdoc/__init__.py index 479dad091..40b07ef16 100644 --- a/strictdoc/__init__.py +++ b/strictdoc/__init__.py @@ -1 +1 @@ -__version__ = "0.0.22" +__version__ = "0.0.23"