Closed seanbreckenridge closed 2 years ago
@karlicoss curious if you had any thoughts here (I wrote up mine in the changelog)
I know similar things couldn't really be done on karlicoss/HPI
since the dependent user base is so much higher (and often running in the background using promnesia and forgot about), so I thought I'd get ahead of it and remove possible module name conflicts from happening in the future
It is a breaking change, but I'd rather break it now in one commit than later when it becomes relevant for each module in particular, if that makes sense
If anyone is using my modules, its likely through my promnesia modules, so as long as they update both at the same time, there should be no issues
Related issues on main repo: extensions/overrides, reddit issue
Yep, agree, this looks good! Also new modules I'm writing are using a similar structure now.
So, say we switch promnesia to use from my.reddit.all import ...
-- I guess the main failure modes we anticipate are
Someone runs pip install -U promnesia
(or git pull) -- it will update the promnesia reddit module, but will leave hpi
intact? (because it's an optional dependency).
Not much we can do about it (they'd have to update HPI as well), but the sad thing is that it's gonna result in some cryptic import errors. So we could add some checks to promnesia, e.g. against HPI version, or just checking whether my.reddit
is a namespace package or regular package (i.e. old). Then could gracefully suggest the user to update HPI, without failing the whole indexing.
Similarly, someone updates HPI, but forgets to update promnesia -- this is trickier, discussing in Zulip
but the sad thing is that it's gonna result in some cryptic import errors. So we could add some checks to promnesia
yeah, this was one of my main concerns as well. Is true you can always handle it downstream, but it does start to add levels of complexity.
Is something I'll consider if I get around to writing an install/update command -- perhaps it could be used for both HPI/promnesia, and if it can just leverage something known like git submodule
then this could always try to fetch the remote hash without merging, to let you know something has been updated remotely before causing some cryptic error. Still feels fairly complicated though
see CHANGELOG.md for thoughts