Skip to content

Commit

Permalink
Troubleshoot package data
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Nov 21, 2023
1 parent 1b97b7a commit 32ceef5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from setuptools import setup, find_packages
from os import getenv, path
from os import getenv, path, walk

BASE_PATH = path.abspath(path.dirname(__file__))

Expand Down Expand Up @@ -61,6 +61,21 @@ def get_requirements(requirements_filename: str):
else:
version = line.split("'")[1]


def find_resource_files():
resource_base_dirs = ("docker", "helm_charts", "templates")
base_dir = path.join(BASE_PATH, "neon_diana_utils")
package_data = []
for res in resource_base_dirs:
if path.isdir(path.join(base_dir, res)):
for (directory, _, files) in walk(path.join(base_dir, res)):
if files:
package_data.append(
path.join(directory.replace(BASE_PATH, "").lstrip('/'),
'*'))
return package_data


setup(
name='neon-diana-utils',
version=version,
Expand All @@ -72,8 +87,7 @@ def get_requirements(requirements_filename: str):
author_email='[email protected]',
license='BSD-3-Clause',
packages=find_packages(),
package_data={'neon_diana_utils': ['templates/**', 'helm_charts/**']
},
package_data={'neon_diana_utils': find_resource_files()},
include_package_data=True,
install_requires=get_requirements("requirements.txt"),
zip_safe=True,
Expand Down

0 comments on commit 32ceef5

Please sign in to comment.