30 Jul 2024 01:42 PM - last edited on 19 Aug 2024 08:18 AM by Michal_Gebacki
Hello,
Our custom python plugins (EF1) often have JSON files included which contain a huge part of config settings
I just wonder how to import/migrate those files into the EF2 equivalent of the plugins.
I noticed they are never included in the compiled packages and thus give an error when trying to access them.
Now testing with various settings in the 'setup.py', but no results so far
Thanks for the ideas/feedback
Jan
Solved! Go to Solution.
02 Aug 2024 07:52 AM
You will have to include package_data in your setup.py file, as illustrated in the setuptools docs.
So if your directory structure looks like this:
You would want to have something like this in your setup.py file:
setup(name="servicebus_plugin",
version=find_version(),
description="Demo plugin for community",
author="You :)",
packages=find_packages(),
package_data={"servicebus_plugin": [
"config/*.json"
]},
python_requires=">=3.10",
include_package_data=True,
install_requires=["dt-extensions-sdk"],
extras_require={"dev": ["dt-extensions-sdk[cli]"]},
)
12 Aug 2024 09:11 AM
Hello, sorry for the delay
Indeed, that's something that seems to work!
except the wildcard (config/*.json) was not accepted, so I added all the config files 1 by 1.
Thanks,
Jan