You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to create different families of transformers and those to be optionally installed.
Aproach
Using Namespace Packaging we will be able to achieve multiple packages within the RDT project and those to be installed afterwards as addons and only be installed if the user actually wants them.
Structure
The addons folder for the multiple families should be created within the rdt/transformers/ without a __init__.py file inside it. This folder will contain multiple folders representing a family which will become a package.
Read all the yaml dependencies so those can be installed for testing environment.
Use find_namespace_package instead of find_packages, and specify what to be found (change the rdt.* for rdt.transformers ).
Add yaml dependency.
rdt/transformers/__init__.py
The __init__.py must dynamically detect and import the installed addons. This is done by reading if found any config.yaml file on the addons/ folders.
The best aproach for this is by using importlib.
Multiple Package Deployment
A dynamic way of deploying the packages to PyPI by using the config.json file for each family must be created for easy maintanance and release process.
The text was updated successfully, but these errors were encountered:
Expected behavior
We want to create different families of transformers and those to be optionally installed.
Aproach
Using Namespace Packaging we will be able to achieve multiple packages within the
RDT
project and those to be installed afterwards as addons and only be installed if the user actually wants them.Structure
The
addons
folder for the multiple families should be created within therdt/transformers/
without a__init__.py
file inside it. This folder will contain multiple folders representing a family which will become apackage
.Each family folder will contain a
__init__.py
file, aconfig.json
file and the python modules that contain code for this addon.Config file (JSON)
The config file for each addon has the following structure:
name
: The name of the package / library. This is usuallyrdt_<family_name>
. Required.transformers
: A list of transformers that can be imported from this family. Requiredrequirements
: A list of requirements for that package. Only required if there are any requirements needed to be installed.Changes to the current code
setup.py
The
setup.py
file has to be adapted to:yaml
dependencies so those can be installed for testing environment.find_namespace_package
instead offind_packages
, and specify what to be found (change therdt.*
forrdt.transformers
).yaml
dependency.rdt/transformers/__init__.py
The
__init__.py
must dynamically detect and import the installedaddons
. This is done by reading if found anyconfig.yaml
file on theaddons/
folders.The best aproach for this is by using
importlib
.Multiple Package Deployment
A dynamic way of deploying the packages to PyPI by using the
config.json
file for each family must be created for easy maintanance and release process.The text was updated successfully, but these errors were encountered: