litnimax / nameko-odoo

Nameko Odoo integration service
Other
3 stars 0 forks source link

Suggest to loosen the dependency on nameko #2

Open Agnes-U opened 2 years ago

Agnes-U commented 2 years ago

Hi, your project nameko-odoo requires "nameko==2.8.5" in its dependency. After analyzing the source code, we found that the following versions of nameko can also be suitable without affecting your project, i.e., nameko 2.8.3, 2.8.4. Therefore, we suggest to loosen the dependency on nameko from "nameko==2.8.5" to "nameko>=2.8.3,<=2.8.5" to avoid any possible conflict for importing more packages or for downstream projects that may use nameko-odoo.

May I pull a request to further loosen the dependency on nameko?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



We also give our detailed analysis as follows for your reference:

Your project nameko-odoo directly uses 8 APIs from package nameko.

nameko.extensions.Entrypoint.__init__, nameko.exceptions.RpcTimeout.__init__, nameko.extensions.DependencyProvider.__init__, nameko.standalone.rpc.ClusterRpcProxy.__init__, nameko.extensions.SharedExtension.__init__, nameko.web.handlers.HttpRequestHandler.__init__, nameko.extensions.ProviderCollector.__init__, nameko.web.server.WebServer.__init__

Beginning from the 8 APIs above, 3 functions are then indirectly called, including 1 nameko's internal APIs and 2 outsider APIs. The specific call graph is listed as follows (neglecting some repeated function occurrences).

[/litnimax/nameko-odoo]
+--nameko.extensions.Entrypoint.__init__
|      +--warnings.warn
+--nameko.exceptions.RpcTimeout.__init__
+--nameko.extensions.DependencyProvider.__init__
+--nameko.standalone.rpc.ClusterRpcProxy.__init__
|      +--nameko.standalone.rpc.StandaloneProxyBase.__init__
|      |      +--nameko.standalone.rpc.StandaloneProxyBase.ServiceContainer.__init__
|      |      +--nameko.containers.WorkerContext.__init__
|      +--nameko.standalone.rpc.ClusterProxy.__init__
+--nameko.extensions.SharedExtension.__init__
+--nameko.web.handlers.HttpRequestHandler.__init__
|      +--nameko.extensions.Entrypoint.__init__
+--nameko.extensions.ProviderCollector.__init__
|      +--eventlet.event.Event
+--nameko.web.server.WebServer.__init__
|      +--nameko.extensions.ProviderCollector.__init__

We scan nameko's versions and observe that during its evolution between any version from [2.8.3, 2.8.4] and 2.8.5, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 2.8.5(original) 2.8.3
['nameko.containers.WorkerContext', 'nameko.web.server.WebServer', 'nameko.standalone.rpc.PollingQueueConsumer.get_message', 'nameko.web.handlers.HttpRequestHandler.get_url_rule', 'nameko.web.handlers.HttpRequestHandler', 'nameko.containers.WorkerContext.origin_call_id', 'nameko.messaging.QueueConsumer.requeue_message', 'nameko.messaging.QueueConsumer', 'nameko.containers.WorkerContext.immediate_parent_call_id', 'nameko.web.server.WebServer.start', 'nameko.standalone.rpc.PollingQueueConsumer', 'nameko.cli.run.setup_backdoor', 'nameko.messaging.QueueConsumer.ack_message']

diff: 2.8.5(original) 2.8.4
['nameko.web.server.WebServer', 'nameko.cli.run.setup_backdoor', 'nameko.web.server.WebServer.start']

diff: 2.8.5(original) 2.9.0rc0
['nameko.messaging.QueueConsumer.on_connection_error', 'nameko.containers.ServiceContainer.__init__', 'nameko.messaging.Publisher.serializer', 'nameko.exceptions.RpcConnectionError', 'nameko.rpc.Responder.send_response', 'nameko.serialization.setup', 'nameko.messaging.Publisher', 'nameko.rpc.ReplyListener.on_consume_ready', 'nameko.messaging.QueueConsumer', 'nameko.rpc.Responder', 'nameko.cli.main._replace_env_var', 'nameko.standalone.rpc.PollingQueueConsumer.get_message', 'nameko.rpc.ReplyListener.setup', 'nameko.containers.ServiceContainer', 'nameko.exceptions.ReplyQueueExpiredWithPendingReplies', 'nameko.standalone.rpc.PollingQueueConsumer.register_provider', 'nameko.messaging.QueueConsumer.on_consume_ready', 'nameko.rpc.ReplyListener', 'nameko.standalone.rpc.ConsumeEvent.wait', 'nameko.standalone.events.event_dispatcher', 'nameko.standalone.rpc.ConsumeEvent', 'nameko.standalone.rpc.PollingQueueConsumer']

diff: 2.8.5(original) 2.9.0
['nameko.messaging.QueueConsumer.on_connection_error', 'nameko.containers.ServiceContainer.__init__', 'nameko.messaging.Publisher.serializer', 'nameko.exceptions.RpcConnectionError', 'nameko.rpc.Responder.send_response', 'nameko.serialization.setup', 'nameko.messaging.Publisher', 'nameko.rpc.ReplyListener.on_consume_ready', 'nameko.messaging.QueueConsumer', 'nameko.rpc.Responder', 'nameko.cli.main._replace_env_var', 'nameko.standalone.rpc.PollingQueueConsumer.get_message', 'nameko.rpc.ReplyListener.setup', 'nameko.containers.ServiceContainer', 'nameko.exceptions.ReplyQueueExpiredWithPendingReplies', 'nameko.standalone.rpc.PollingQueueConsumer.register_provider', 'nameko.messaging.QueueConsumer.on_consume_ready', 'nameko.rpc.ReplyListener', 'nameko.standalone.rpc.ConsumeEvent.wait', 'nameko.standalone.events.event_dispatcher', 'nameko.standalone.rpc.ConsumeEvent', 'nameko.standalone.rpc.PollingQueueConsumer']

diff: 2.8.5(original) 2.9.0-rc0
['nameko.messaging.QueueConsumer.on_connection_error', 'nameko.containers.ServiceContainer.__init__', 'nameko.messaging.Publisher.serializer', 'nameko.exceptions.RpcConnectionError', 'nameko.rpc.Responder.send_response', 'nameko.serialization.setup', 'nameko.messaging.Publisher', 'nameko.rpc.ReplyListener.on_consume_ready', 'nameko.messaging.QueueConsumer', 'nameko.rpc.Responder', 'nameko.cli.main._replace_env_var', 'nameko.standalone.rpc.PollingQueueConsumer.get_message', 'nameko.rpc.ReplyListener.setup', 'nameko.containers.ServiceContainer', 'nameko.exceptions.ReplyQueueExpiredWithPendingReplies', 'nameko.standalone.rpc.PollingQueueConsumer.register_provider', 'nameko.messaging.QueueConsumer.on_consume_ready', 'nameko.rpc.ReplyListener', 'nameko.standalone.rpc.ConsumeEvent.wait', 'nameko.standalone.events.event_dispatcher', 'nameko.standalone.rpc.ConsumeEvent', 'nameko.standalone.rpc.PollingQueueConsumer']

diff: 2.8.5(original) 2.9.1rc0
['nameko.rpc.RpcConsumer', 'nameko.messaging.QueueConsumer.on_connection_error', 'nameko.messaging.Publisher.setup', 'nameko.containers.ServiceContainer.__init__', 'nameko.messaging.Publisher.serializer', 'nameko.messaging.QueueConsumer.connection', 'nameko.exceptions.RpcConnectionError', 'nameko.rpc.Responder.send_response', 'nameko.serialization.setup', 'nameko.amqp.publish.get_producer', 'nameko.messaging.Publisher', 'nameko.rpc.ReplyListener.on_consume_ready', 'nameko.messaging.QueueConsumer', 'nameko.testing.pytest.pytest_addoption', 'nameko.rpc.Responder', 'nameko.cli.main._replace_env_var', 'nameko.amqp.publish.get_connection', 'nameko.standalone.rpc.PollingQueueConsumer.get_message', 'nameko.amqp.publish.Publisher.publish', 'nameko.rpc.ReplyListener.setup', 'nameko.containers.ServiceContainer', 'nameko.exceptions.ReplyQueueExpiredWithPendingReplies', 'nameko.standalone.rpc.PollingQueueConsumer.register_provider', 'nameko.rpc.Responder.__init__', 'nameko.messaging.QueueConsumer.setup', 'nameko.rpc.MethodProxy.ssl', 'nameko.messaging.QueueConsumer.on_consume_ready', 'nameko.rpc.MethodProxy', 'nameko.rpc.ReplyListener', 'nameko.rpc.RpcConsumer.handle_result', 'nameko.testing.pytest.rabbit_ssl_config', 'nameko.standalone.rpc.ConsumeEvent.wait', 'nameko.standalone.events.event_dispatcher', 'nameko.standalone.rpc.ConsumeEvent', 'nameko.amqp.utils.verify_amqp_uri', 'nameko.amqp.publish.Publisher.__init__', 'nameko.standalone.rpc.PollingQueueConsumer', 'nameko.testing.pytest.parse_config_option', 'nameko.amqp.publish.Publisher']

diff: 2.8.5(original) 2.9.1-rc0
['nameko.rpc.RpcConsumer', 'nameko.messaging.QueueConsumer.on_connection_error', 'nameko.messaging.Publisher.setup', 'nameko.containers.ServiceContainer.__init__', 'nameko.messaging.Publisher.serializer', 'nameko.messaging.QueueConsumer.connection', 'nameko.exceptions.RpcConnectionError', 'nameko.rpc.Responder.send_response', 'nameko.serialization.setup', 'nameko.amqp.publish.get_producer', 'nameko.messaging.Publisher', 'nameko.rpc.ReplyListener.on_consume_ready', 'nameko.messaging.QueueConsumer', 'nameko.testing.pytest.pytest_addoption', 'nameko.rpc.Responder', 'nameko.cli.main._replace_env_var', 'nameko.amqp.publish.get_connection', 'nameko.standalone.rpc.PollingQueueConsumer.get_message', 'nameko.amqp.publish.Publisher.publish', 'nameko.rpc.ReplyListener.setup', 'nameko.containers.ServiceContainer', 'nameko.exceptions.ReplyQueueExpiredWithPendingReplies', 'nameko.standalone.rpc.PollingQueueConsumer.register_provider', 'nameko.rpc.Responder.__init__', 'nameko.messaging.QueueConsumer.setup', 'nameko.rpc.MethodProxy.ssl', 'nameko.messaging.QueueConsumer.on_consume_ready', 'nameko.rpc.MethodProxy', 'nameko.rpc.ReplyListener', 'nameko.rpc.RpcConsumer.handle_result', 'nameko.testing.pytest.rabbit_ssl_config', 'nameko.standalone.rpc.ConsumeEvent.wait', 'nameko.standalone.events.event_dispatcher', 'nameko.standalone.rpc.ConsumeEvent', 'nameko.amqp.utils.verify_amqp_uri', 'nameko.amqp.publish.Publisher.__init__', 'nameko.standalone.rpc.PollingQueueConsumer', 'nameko.testing.pytest.parse_config_option', 'nameko.amqp.publish.Publisher']

As for other packages, the APIs of warnings and eventlet are called by nameko in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on nameko from "nameko==2.8.5" to "nameko>=2.8.3,<=2.8.5". This will improve the applicability of nameko-odoo and reduce the possibility of any further dependency conflict with other projects.