my.github.gdpr/my.zulip.organization: use kompress support for tar.gz if it's available

otherwise fall back onto unpacking into tmp dir via my.core.structure
This commit is contained in:
Dima Gerasimov 2024-09-18 23:03:03 +01:00 committed by karlicoss
parent 201ddd4d7c
commit 6a18f47c37
4 changed files with 135 additions and 82 deletions

View file

@ -1,4 +1,5 @@
from .internal import assert_subpackage; assert_subpackage(__name__)
from . import warnings
# do this later -- for now need to transition modules to avoid using kompress directly (e.g. ZipPath)
@ -8,10 +9,7 @@ try:
from kompress import *
except ModuleNotFoundError as e:
if e.name == 'kompress':
warnings.high('Please install kompress (pip3 install kompress), it will be required in the future. Falling onto vendorized kompress for now.')
warnings.high('Please install kompress (pip3 install kompress). Falling onto vendorized kompress for now.')
from ._deprecated.kompress import * # type: ignore[assignment]
else:
raise e
# this is deprecated in compress, keep here for backwards compatibility
open = kopen # noqa: F405