
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
The module contains two main components:
%loadext ipydex.displaytools
)##:
, ##:T
, ##:S
) which cause
that either the return value or the right hand side of an assignment
of a line is displayed (T
means additional transposition and S
means only .shape
attribute is displayed)print
or display
statementsx = np.random.rand() ##:
display("x := {}".format(x))
to the source
code of the cell (before its execution)Security advice: Because the extension manipulates the source code before its execution, it might cause unwanted and strange behavior. Thus, this program is distributed in the hope that it will be useful, but without any warranty.
The following functions are meant to be used in ordinary python-scripts:
IPS()
IPython.embed()
ST()
activate_ips_on_exception()
__mu
to 1
and exit the shell (CTRL+D) in order to move up one level in the frame stack
dirsearch(name, obj)
Container
This package has grown over more than a decade. It is only partially covered by unittests. Its internals are not exemplary for recommended coding practice. It certainly contains bugs. No warranty for any purpose is given.
Nevertheless it might be useful.
In your test directory add a file conftest.py
:
# This file enables the ipydex excepthook together with pytest.
# The custom excepthook can be activated by `activate_ips_on_exception()`
# in your test-file.
# To prevent unwanted dependencies the custom excepthook is only active if a
# special environment variable is "True". Use the following command for this:
#
# export PYTEST_IPS=True
import os
if os.getenv("PYTEST_IPS") == "True":
import ipydex
# This function is just an optional reminder
def pytest_runtest_setup(item):
print("This invocation of pytest is customized")
def pytest_exception_interact(node, call, report):
# the option `leave_ut=True` causes the excepthook to leave functions
# from the unittest package. This is a convenience feature such that
# the code wakes up in your own testcode
ipydex.ips_excepthook(
call.excinfo.type, call.excinfo.value, call.excinfo.tb, leave_ut=True
)
ipydex.Container
for Debugging e.g. in Jupyter Notebooksfrom ipydex import Container
# ...
def func1(x, debug_container=None):
y = complicated_func1(x)
res = complicated_func2(x, y)
# convenient way to non-intrusively gather internal information
if debug_container is not None:
debug_container.fetch_locals()
# now the following attributes exists:
# debug_container.x
# debug_container.y
# debug_container.res
return res
# create debug container
dc = Container()
# call the function which should be debugged, pass the container
# as keyword argument
res = func1(100, debug_container=dc)
# after the function returned dc contains new attributes which allow to
# investigate *internal* behavior of func1
print(C.x)
print(C.y)
print(C.res)
FAQs
IPython based debugging and exploring tool
We found that ipydex 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.