<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Today I altered the install function to overwrite existing addons
(but back them up and restore them in case the installation
fails). This took awhile because I started out with the notion
that the install function would check and compare version numbers
of already installed addons. This eventually lead me to the
realization that having multiple addon install locations (which
may not all be writable) complicates matters more than I had first
thought.</p>
<p>For example, what should be done if a user wants to update a
package/addon which is bundled with blender (and therefore likely
in /usr/share or some such non-user-writable dir)?</p>
<p>Blender currently becomes grumpy when multiple addons with the
same name are anywhere in the search paths, so I think a change in
that behavior will be required to fully solve this. Some ideas:<br>
</p>
<p>* Allow multiple versions of an addon to be installed at the same
time (but probably not allow them to be <i>enabled</i> at the
same time).<br>
* Let user-config addons override system addons.<br>
</p>
<p>Anyway, that's all a problem for the (hopefully not far off)
future. In the end I decided the install function should simply
install what it's asked to install, and version handling would
best occur a level or two above.<br>
</p>
<p>As a side note, I was surprised by the apparent lack of a
standard library equivalent to something like rm. I suspect I may
be missing something there, but for now I made my own by combining
shutil.rmtree and Path.unlink.</p>
<p><br>
I also spent time trying to get pytest working:</p>
<p>I created a "tests" directory in bpkg_manager, added a simple
test, and created an empty __init__.py. Unfortunately, pytest
wanted to run the __init__.py in the parent directory
(bpkg_manager), which tries to import bpy. I tried to mock bpy in
my test, but that didn't have any effect. It turns out the empty
__init__.py I added to turn the tests into a module (useful when
using unittest) was causing this to happen.</p>
<p>Ellwood<br>
</p>
</body>
</html>