IIEnv: Proposal #33
Labels
No Label
abstractions
architecture
bug
distribution
docs
duplicate
enhancement
feature
physical
proposal
question
simulation
tooling
tracker
unconfirmed
ux
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: so-rose/oscillode#33
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Proposal
Blender addons often need dependencies, but can't use their own versions of dependencies without stepping over each other's toes. It would be very nice if different parts of the same Python program could use different versions of imported modules.
With "Interpreter-Integrated Environments", you can do that. It's like
venv
, but in the same process.Benefits
Having this brick in place opens the door to some staggeringly useful benefits:
sys.modules
entries to delete after uninstalling an addon.iienv
would lead to unsolvable questions of what is "ok" to delete, since another addon / Blender itself might still be using it.sys.modules
.sys.modules
entries for that addon only, and reloads not only the altered addon modules, but also updated dependencies. All without affecting Blender or other addons, while still preserving/updating module references within saved callbacks.Costs
No hubris is without purgatory, and so you too must also endure a few caveats if you want to use
iienv
:builtins.__import__
: Whileiienv
does its very best to keep its hands off of anyimport
that it does not wish to manage, replacing abuiltins
is almost always a bad idea, no matter why it is done.iienv
is very constrained to the Python interpreter and version that it is tested on. Currently,iienv
is only tested onCPython 3.11
(to matchBlender 4.1
); do not presume that it works with anything else!import
system is full of surprising edge cases, and whileiienv
tries its best to be explicit about them, there will be packages that simply cannot work for reasons that may be entirely unapparent.Status
numpy
from two packages.The file is checked into the repo in
src/
, and should be considered experimental.