Feat: packaging (#127)

- Add configuration files for packaging
- Precommit now uses ruff

Co-authored-by: bkfox <thomas bkfox net>
Reviewed-on: rc/aircox#127
This commit is contained in:
Thomas Kairos
2023-10-11 10:58:34 +02:00
parent 5ea092dba6
commit f7a61fe6c0
82 changed files with 332 additions and 935 deletions

View File

@ -51,9 +51,7 @@ class WrapperMixin:
ns = None
ns_attr = None
def __init__(
self, target=None, ns=None, ns_attr=None, type_interface=None, **kwargs
):
def __init__(self, target=None, ns=None, ns_attr=None, type_interface=None, **kwargs):
self.target = target
if ns:
self.inject(ns, ns_attr)
@ -87,10 +85,7 @@ class WrapperMixin:
if self.target is ns_target:
return
elif self.target is not None and self.ns:
raise RuntimeError(
"self target already injected. It must be "
"`release` before `inject`."
)
raise RuntimeError("self target already injected. It must be " "`release` before `inject`.")
self.target = ns_target
setattr(ns, ns_attr, self.interface)
@ -145,9 +140,7 @@ class SpoofMixin:
traces = self.traces[name]
if not isinstance(traces, list):
traces = (traces,)
return tuple(
self._get_trace(trace, args=args, kw=kw) for trace in traces
)
return tuple(self._get_trace(trace, args=args, kw=kw) for trace in traces)
def _get_trace(self, trace, args=False, kw=False):
if (args and kw) or (not args and not kw):