-
Notifications
You must be signed in to change notification settings - Fork 75
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
FEAT(index) add --sources & --overwrite to CLI to partially update db from config sources #211
Conversation
I'd like to add here more commits, to implement a new CLI option
Also documentation is missing (and a |
Another alternative would be to add just 2 mutual-exclusive options: If will implement this, and await feedback. |
- CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - The precedence for deciding update/overwrite: env-var, --update/overwrite, --source exist? - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
Implemented the 2nd alternative (and updated OP above with the new feature). |
This PR is now only missing the docs & examples, and at the moment has taken the following design choices: Added
|
- CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - The precedence for deciding update/overwrite: env-var, --update/overwrite, --source exist? - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
Hm, CI fails (for the context, this promnesia/.github/workflows/main.yml Line 40 in e44a2bd
CI=true tox .
You can also run specific parts of tox as for example But also of course running tests directly with pytest would work too, guess you'll figure this out. But |
To be honest, I think it would make sense to deprecate it (not a major violation of backwards compatibility, doubt many people used it either). But maybe nice to add a |
Thanks! Left some comments.. |
- CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - The precedence for deciding update/overwrite: env-var, --update/overwrite, --source exist? - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
A kind request, when it's time to merge (not yet), i suggest to rebase this PR - not to squash it, |
Yes! I have a similar workflow, and happy to do that when people maintain clean history. I think I squashed your first PR since it had lots of 'fix' commits, but the other one I just rebased as is. |
- CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - The precedence for deciding update/overwrite: env-var, --update/overwrite, --source exist? - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
More work...
Still owing ...
|
as suggested in karlicoss#20: - drop PROMNESIA_INDEX_POLICY env-var. - CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
as suggested in karlicoss#20: - drop PROMNESIA_INDEX_POLICY env-var. - CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
ea2f66f
to
ce58ab4
Compare
args can be both Source.name & Source's positional index.
as suggested in karlicoss#20: - drop PROMNESIA_INDEX_POLICY env-var. - CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
as suggested in karlicoss#20: - drop PROMNESIA_INDEX_POLICY env-var. - CLI options described in the 2nd case explained in karlicoss#211, due to simplicity. - Function defaults are false, as suggested in [karlicoss#20](karlicoss#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
add also --dry into `promnesia demo` sub-command.
as suggested in #20: - drop PROMNESIA_INDEX_POLICY env-var. - CLI options described in the 2nd case explained in #211, due to simplicity. - Function defaults are false, as suggested in [#20](#20 (comment)). - Both index & demo updated. - Env-var now checks its value one of (update|overwrite). - All update/overwrite decision logic moved to __main_.
Hooray, thanks! Sorry it's taken a while, I guess todos for me which would make it quicker next time:
I'll look at it after I get some sleep (crazy schedule) Other todos from the discussions:
Not sure if forgot anything? |
Done the CI updates & developer info! #217 keeping circle though, since it's still useful because of systemd test. Also if you go to “Actions” tab on your promnesia fork and click “I understand my workflows, go ahead and enable them”, the pipelines should start running for you even before you PR, so hopefully will make it all quicker next time. |
… in 'update' mode relevant to #211
… in 'update' mode relevant to #211
… in 'update' mode relevant to #211
Fixes #20
new
--sources
option(s)new
--overwrite
optiondue to simplicity. if missing, defaults to "dynamic partial updates" as described in this and this.
PROMNESIA_INDEX_POLICY
env-var, since it is the default behavior now.--overwrite
areFalse
, as suggested in the comment below.promnesia index
&promnesia demo
sub-commands have been updated.promnesia/__main__.py
.:Various