Transition Acorn first party dependencies (lib folder) to Python packages (OP#57)
Presently, many of the first party dependencies we use inside of Acorn are embedded as submodules. While this generally works, it deviates from the Python best practice of managing dependencies from pip
. The packages should be migrated to a module structure (with a semantic versioning scheme) and embedded in the requirements.txt
.
General Reference:
- How to Build Python Packages: https://www.oak-tree.tech/blog/python-packaging-primer
Development tasks:
-
Create example module structure for the major dependencies in lib
under the "Packages" group in Django apps: https://code.oak-tree.tech/django-apps/packages-
Package structure should follow the Git pattern described in the reference article above. (Eg, package repository is separate from the code repository and where the code repository is pulled at the time of git
checkout.) -
Package structures may need to utilize custom Gulp tasks to prepare frontend assets. The example should include a gulp.js
showing how the tasks are defined and a list of the dependencies needed for the tasks to execute. Where possible, this list should be kept consistent between all repositories so that developers do not need to learn a dozen different build systems for the Acorn dependencies. -
Package repositories should contain a README.md
describing Acorn, the package, and a Quickstart detailing the procedure for creating a package build. Where needed, this should also include the JavaScript steps required for packaging frontend assets.
-
-
Packages for Spatial Imaging Kaitara (highest priority) -
Acorn Base: core models and API views, base JavaScript assets, and Magnific lightbox. Requires custom Gulp.js tasks to compile JS assets. -
Acorn Secure: API authentication, database (application) encryption, and decorator functions -
Acorn Contently: basic CMS models, ACE text editor, and admin structures for using ACE code editor within the Django admin. Requires custom Gulp.js tasks to compile JS assets and CSS. -
Acorn Messages: prototype models and views which can be used to quickly develop message queues and event logs. -
Wagtail Content Handlers: Wagtail CMS content handlers, builds on top of Acorn Contently and allows for ACE and other rich-content to be added to Wagtail. Requires custom Gulp.js tasks to compile JS assets and CSS. -
Wagtail Foundation: Page models, components, stylesheets, JavaScript assets, and tooling used for theintegration of Foundation into Wagtail.
-
-
Packages for oak-tree.tech -
Hooks: RESTful web hooks for Acorn based projects -
Microservices (dependency of hooks): provides methods to manage service to service communication, request retry, and logging
-
Development notes:
- Packages need to be responsible for creating (and testing) their own frontend applications. Published packages should have CSS packaged from SCSS and JavaScript minified from sources.
- Packages should share compatible task runner systems. Gulp.js is preferred since it is compatible with the current Acorn build system and we can copy/paste the existing tasks.
- We should use Node.js 18.18.2 (the version of Node.js used in both the current Acorn and Sonador) for packaging.
Edited by Rob Oakes