In the answer to this question it was suggested that advanced users might like to develop packages directly, rather than developing in the playground and then creating separate packages -- specifically, the idea was to create cross-package helper functions without having to package / repackage, etc.
A few questions here. Some of this is pretty "out of the box," so I'm happy to do my own experimentation / research, but just wanted to ask in case there are any known issues / thoughts / best practices that come to mind.
/usr/share/docassemble/local3.8/lib/python3.8/site-packages/docassemble/[[package-name]]/data
?.../site-packages/docassemble/helpers
for development of helper functions / cross-use interview stuff, and then import into .../data
as needed?/usr/share/docassemble/config/
, .../docassemble/backup
, etc., in the docs, but I haven't found anything for the whole filesystem, or the docassemble layer's filesystem (obviously not necessary to lay out alpine
, for example)..yml
files is .../data
?/usr/share/docassemble/local3.8/lib/python3.8/site-packages/docassemble/helpers/helper.py
directory and file, I could then use something like the following to import helper.py
in a fictional interview.yml
file? Not saying that would be the best idea, but just asking if it might work to try to understand a bit more about docassemble... haven't fully thought through the workflow for something like this (i.e. if it might be better to just use the playground to package things up, or if there's another easier option).---
modules:
- .....helpers.helper
---
docassemble/packagename/data/
folder and import like this:---
modules:
- .module
---
I suppose I could even even structure my files like this .../data/modules/module.py
, and then import with something like the following?
---
modules:
- .modules.module
---
Happy to do my own experimentation / research, but just wanted to ask in case there are any known issues / thoughts that come to mind.
Dockerfile
runs python3.8 -m venv --copies /usr/share/docassemble/local3.8
. When it comes time to upgrade to Python 3.9, it will do python3.9 -m venv --copies /usr/share/docassemble/local3.9
. How packages are installed inside that virtual environment is up to the developers of Python and pip
.site-packages/docassemble/helpers
would be the directory for the Python package docassemble.helpers
. You could write such a package and publish it on PyPI (the name is not taken yet).docassemble.familylaw:data/questions/kids.yml
. If you write data/static/tweaks.css
it will assume you mean a file in the current package. If you just give it a file name (e.g., tweaks.css
) it will assume you mean a file in the current package and it will make an assumption about what data folder you are referring to based on the context. If your Python package is called docassemble.familylaw
, then the data folder is located at docassemble/familylaw/data
inside the docassemble.familylaw
package.docassemble.helpers
and install it, but bypassing docassemble's package installation system by writing files directly to the Python virtual environment is not advisable. Note that docassemble is a cloud application, so a docassemble "server" may be a cluster of machines. The package management system ensures that you can do docker stop
, docker rm
, docker pull
, and docker run
, and your server will be up and running again with all the right Python packages, even if the docker pull
results in an upgrade from Python 3.8 to Python 3.9.modules
block has nothing to do with the data
folder. If docassemble.xyz
is listed in a modules
block, docassemble runs from docassemble.xyz import *
and imports the module's exported names into the interview answer namespace.