Skip to content
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

Project dependencies may have API risk issues #255

Closed
PyDeps opened this issue Oct 27, 2022 · 2 comments · Fixed by #258
Closed

Project dependencies may have API risk issues #255

PyDeps opened this issue Oct 27, 2022 · 2 comments · Fixed by #258

Comments

@PyDeps
Copy link

PyDeps commented Oct 27, 2022

Hi, In nbclient, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

jupyter_client>=6.1.5
nbformat>=5.0
nest_asyncio
traitlets>=5.2.2

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict.
The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project,
The version constraint of dependency jupyter_client can be changed to >=7.0.6,<=7.3.4.

The above modification suggestions can reduce the dependency conflicts as much as possible,
and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the jupyter_client
jsonutil.json_clean
The calling methods from the all methods
kwargs.pop
content.get.get
self.async_setup_kernel
json_clean
exec_err_msg.format
getattr
asyncio.wait_for
self.async_start_new_kernel
typing.TypeVar
self.start_new_kernel_client
timestamp
jsonutil.json_clean
re.match
self.create_kernel_manager
self._display_id_map.setdefault.setdefault
f.read
exceptions.CellExecutionComplete
type
self.kc.iopub_channel.get_msg
traitlets.Unicode.tag
format
exceptions.DeadKernelError
self.km.start_kernel
self.kc.execute
self.nb.metadata.widgets.items
nbclient.cli.NbClientApp
self._async_check_alive
cell.source.strip
jsonutil.json_clean.get
self.kc.is_alive
buffer.base64.b64encode.decode
os.path.dirname
any
asyncio.get_event_loop.remove_signal_handler
max
arg.startswith
nbformat.v4.new_markdown_cell
self.widget_buffers.get
outcome.update
asyncio.new_event_loop.run_until_complete
map
comm_id.self.comm_objects.handle_msg
self.nb.metadata.get.get
hook.output
state.get
self.kc.wait_for_ready
asyncio.new_event_loop
self.send
textwrap.dedent.Enum.tag
os.path.join
zip
super
self.kc.stop_channels
tuple
self.timeout_func
coro
int
binascii.b2a_base64
traitlets.default
self._publish_msg
self._update_display_id
asyncio.ensure_future.cancel
print
self._get_buffer_data
outs.append
float
math.isinf
ValueError
req.strip
msg.get
list.strftime
atexit.register
datetime.datetime.strftime
self._async_cleanup_kernel
self.km.client
nbformat.v4.new_output
super.client
check_patch_tornado
self.kernel_client.shell_channel.send
isinstance
traitlets.Type
self.resources.get.get
client.NotebookClient.execute
self.clear_display_id_mapping
exec_reply_content.get
len
msg_id.self.output_hook_stack.pop
self.reset_execution_trackers
self.__unicode__
collections.defaultdict
nbformat.v4.new_output.extend
textwrap.dedent.Integer.tag
sys.modules.get
self.handle_comm_msg
self.kernel_manager_class
util.ensure_async.get
self.set_widgets_metadata
os.chdir
s.encode.encode
traitlets.Dict
obj.b2a_base64.decode
nbformat.v4.new_notebook
comm_id.self.widget_buffers.update
handler
shutil.copy
self._get_timeout
notebook_path.replace
self.async_execute_cell
asyncio.sleep
f.write
sys.path.insert
nbformat.read
self.async_start_new_kernel_client
timeout_err_msg.format
self.widget_registry.get
self.log.error
encoded_buffers.append
self._check_raise_for_error
super.__init__
widget_class
self.async_wait_for_reply
traitlets.Enum
list
exceptions.CellExecutionError.from_cell_and_msg
exec
self.set_state
traitlets.Any
self.log.debug
RuntimeError
self.widget_state.items
self.kc.shell_channel.get_msg
self.km.is_alive
nbformat.v4.new_code_cell
version_str.replace.replace
cell_map.setdefault.append
inspect.isawaitable
base64.b64encode
read
self._async_poll_kernel_alive
join
self.executor.remove_output_hook
self.comm_id.encode
self._display_id_map.setdefault
compile
self.log.info
NotebookClient
traitlets.List
fhandle.read
self._cleanup_kernel
self.outputs.append
datetime.datetime.utcnow.isoformat
self._async_handle_timeout
hasattr
str
util.run_sync
asyncio.ensure_future
set
self.sync_state
read_reqs
list.items
traitlets.List.tag
self.run_notebook
self.widget_registry.get.get
msg_id.self.output_hook_stack.append
self.get_notebooks
self.kc.kernel_info
repr
traitlets.Integer
exceptions.CellTimeoutError.error_from_timeout_and_cell
self.km.shutdown_kernel
super.initialize
parts.append
traitlets.Unicode
kwargs.km.resources.nb.NotebookClient.execute
self.resources.get
self.widget_buffers.get.values
os.getcwd
textwrap.dedent
os.path.abspath
textwrap.dedent.Dict.tag
traitlets.Bool
util.ensure_async
notebook_path.pathlib.Path.parent.absolute
open
self.task_poll_for_reply.cancel
msg_type.startswith
sys.exit
self.kc.start_channels
iter
enumerate
self.process_message
super.start_kernel
hook.clear_output
content.self.widget_state.setdefault.update
atexit.unregister
asyncio.get_event_loop
util.run_hook
self._async_poll_output_msg
just_run
textwrap.dedent.Unicode.tag
check_ipython
self.comm_open_handlers.get
display_id.self._display_id_map.items
nbformat.v4.output_from_msg
time.monotonic
setuptools.setup
textwrap.dedent.Any.tag
req_path.read.splitlines
self._display_id_map.items
self.widget_state.setdefault
self.log.warning
traitlets.Unicode.List.tag
math.isnan
cls
nbclient.cli.NbClientApp.document_config_options
textwrap.dedent.Callable.tag
asyncio.get_running_loop
self.clear_output
self.start_new_kernel
asyncio.set_event_loop
cell.metadata.get
self.nb.metadata.get
dict
asyncio.get_event_loop.add_signal_handler
self.output
content.get
version_str.replace.split
re.compile
self._serialize_widget_state
self.kernel_client.session.msg
datetime.datetime.utcnow
textwrap.dedent.Unicode.List.tag
traitlets.Callable
nbclient.__version__.split
self.km.interrupt_kernel
self.executor.register_output_hook
client.NotebookClient
hook
self.km.cleanup_resources
self._async_poll_for_reply
cell.source.strip.split
nest_asyncio.apply
datetime.datetime.strptime
textwrap.dedent.Bool.tag
pathlib.Path

@developer
Could please help me check this issue?
May I pull a request to fix it?
Thank you very much.

@theochit
Copy link

I will second this, I encountered a breaking event loop bug from jupyter_client>=6.1.5 because it installed 8.0.0a, an alpha release. Downgrading to the latest stable version 7.4.7 fixed my issue.

@davidbrochart
Copy link
Member

The decision was made to not add upper bounds to dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants