Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Type stubs <https://peps.python.org/pep-0561/#stub-only-packages>
_
for |compose|_.
.. |compose| replace:: compose
.. _compose: https://pypi.org/project/compose
This library's version numbers follow the SemVer 2.0.0 specification <https://semver.org/spec/v2.0.0.html>
_.
::
pip install compose-stubs
Like any other typing stub package, once installed it should "just work". You might need to restart your type checker.
MyPy fails to match the return type of an async
function to the argument type of the next function
in the type hints of acompose
and sacompose
,
leading to false errors about types not matching.
(Pyright and Pyre don't have this problem.)
Due to limitations in Python type hints, these typing stubs
only cover at most 16 arguments in a single call to compose
,
acompose
, or sacompose
. This limit could be higher,
but the higher the limit, the slower the type-checking.
A simple workaround is to just use multiple compose calls
to build up compositions bigger than 16 functions.
Due to limitations in Python type hints, there is an edge
case in the type hints for sacompose
if the return type
of one function in a composition is awaitable and the next
function accepts that awaitable (the most likely way for
this to happen is if it accepts Any
), then sacompose
actually returns an async callable, but the type inference
will think that it returns a sync callable.
Requires Python 3.10 and above (compose
itself remains
supported on much older versions, but the type hints need
typing.ParamSpec
).
FAQs
Type stubs for compose
We found that compose-stubs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.