-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix missing template package_data * Troubleshoot package data * More package data troubleshooting * More package data troubleshooting --------- Co-authored-by: Daniel McKnight <[email protected]>
- Loading branch information
1 parent
390d140
commit 57039d7
Showing
1 changed file
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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__)) | ||
|
||
|
@@ -61,6 +61,21 @@ def get_requirements(requirements_filename: str): | |
else: | ||
version = line.split("'")[1] | ||
|
||
|
||
def find_resource_files(): | ||
base_path = path.join(BASE_PATH, "neon_diana_utils") | ||
resource_base_dirs = ("docker", "templates") | ||
package_data = [] | ||
for res in resource_base_dirs: | ||
if path.isdir(path.join(base_path, res)): | ||
for (directory, _, files) in walk(path.join(base_path, res)): | ||
if files: | ||
package_data.append( | ||
path.join(directory.replace(base_path, "").lstrip('/'), | ||
'*')) | ||
return package_data | ||
|
||
|
||
setup( | ||
name='neon-diana-utils', | ||
version=version, | ||
|
@@ -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, | ||
|