-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to export rulesets as python eggs #13
Comments
My idea about exporting TableRules would be more like this:
where spec would be evaluated like Of course we could store spec data on class or even module level to keep things prettier. So definition import would happen once, not every time we create an instance or class (if we cache it). Moreover, we don't need to differentiate module rules and table rules at import time if we stick to this approach - we would just be saving the table rule results as a separate module in the egg rules. So lots of things would become simpler. Regarding "pythonic approach" description, I think that this begs for a Rulestore backend that would work on python module of the structure we defined (with data in rulestore.py and rules/*.py modules). So effectively this would mean we could export data from any rulestore backend to egg-based backend. I'm not sure if this is exactly what we want or it covers all of the use cases, but guess it's worth considering such approach. |
thanks. only just noticed your comment. not sure we have already discussed this sufficiently in our recent chat: in general
on intended use cases (of pyrules):
one egg files:
Update: user names only |
Utlimate goal is to be able to store, version and deploy rulesets between development, test and production environments. This story should implement the basics for this goal -- as soon as we can serialise/deserialise rules and rulesets, the other elements become trivial.
Expected behavior
Tasks
Implementation notes
import
a. Module rules
A module rule is simply a python class in the app's
rules
module/package. Hence importing (e.g. in a celery instance) means to find allRule
instances.b. TableRulesets
Basically the same as with Module rules, assuming that each tablerule has been properly specified as shown below, and the tablerules.py is imported at startup.
export
Rules are either python modules or yaml specifications. Hence exporting a ruleset and building an egg from it involves these steps:
pythonic approach
rules
module / name space package.version
fileI prefer the python approach. It may be helpful to code a full example egg by hand before automating it from the django models.
For completeness, this would be the non-pythonic approach. Yikes...
non python approach
The setup.py should have a
version
file with a version number that is incremented automatically on each build.The text was updated successfully, but these errors were encountered: