-
Notifications
You must be signed in to change notification settings - Fork 172
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
Abstract Isolation Providers and Add Dummy One #302
Conversation
Minor commit message issue: In |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deeplow I just finished my first pass of the PR. Feel free to share your thoughts.
f961895
to
61481a0
Compare
I have now revered the changes and save a dummy PDF so all tests pass on platforms where the dummy converter will be enabled. |
61481a0
to
f5a7edf
Compare
I checked your fixups and they look good. I also tested the code a bit locally. Feel free to merge! |
de89b3c
to
5ae8121
Compare
Rebased on top of main and added one last FIXUP commit which made it to wrong branch. |
I saw the FIXUP commit. I'm ok with the static method, but just wanted to mention that you are free to use |
In general, it's preferable to have a base.py module, and import that. The reason is that you may want to re-export the isolation provider classes in __init__.py, and doing so would lead to cyclic references.[1] [1]: #302 (comment)
I wish I could, but because I am calling this already from a static context, I don't have access to self. |
First step in encapsulating the isolation provider.
Encapsulate container logic into an implementation of AbstractIsolationProvider. This flexibility will allow for other types of isolation managers, such as a Dummy one.
All isolation providers will some similar steps when convert() is called. For this reason, all the common parts are captured in convert() and then each isolation provider implements its own specific conversion process in _convert() (which is called from the convert() method).
Provides more clear code organization having each provider in their own python file rather than a single one.
When enabled, the conversion part does nothing but print some simulated output. This can be useful for testing non-conversion code (e.g. GUI). Activated with the hidden flag --unsafe-dummy-conversion.
Make these methods callable without having to create an instance of the Container class. This was needed to make pytest-wrapper.py cleaner.
d684eb1
to
724dd2a
Compare
Rebased from main and squashed commits. |
Fedora-36 failed but I'll merge it anyways since it appears that the issue is not related to the PR. |
Encapsulates isolation providers (will be useful for adding Qubes support later) and adds a dummy one. It can be run on both the CLI and GUI with the
--unsafe-dummy-conversion
flag (hidden and available only in the testing environment). This is a step for adding Windows and MacOS to the CI testing environment, given that this way (at the cost of some fidelity) we gain the ability to run automated tests without the need for nested virtualization.It runs as expected but doesn't actually do any conversion. Instead it shows preset output conversion progress messages and always "succeeds" in the conversion.