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

Suggest to loosen the dependency on notion #4

Open
Agnes-U opened this issue Nov 23, 2022 · 0 comments
Open

Suggest to loosen the dependency on notion #4

Agnes-U opened this issue Nov 23, 2022 · 0 comments

Comments

@Agnes-U
Copy link

Agnes-U commented Nov 23, 2022

Hi, your project nerc requires "notion==0.0.23" in its dependency. After analyzing the source code, we found that some other versions of notion can also be suitable without affecting your project, i.e., notion 0.0.22. Therefore, we suggest to loosen the dependency on notion from "notion==0.0.23" to "notion>=0.0.22,<=0.0.23" to avoid any possible conflict for importing more packages or for downstream projects that may use nerc.

May I pull a request to loosen the dependency on notion?

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



For your reference, here are details in our analysis.

Your project nerc(commit id: 56729b0) directly uses 2 APIs from package notion.

notion.client.NotionClient.get_block, notion.client.NotionClient.__init__

From which, 47 functions are then indirectly called, including 28 notion's internal APIs and 19 outsider APIs, as follows (neglecting some repeated function occurrences).

[/vazrupe/nerc]
+--notion.client.NotionClient.get_block
|      +--notion.utils.extract_id
|      |      +--uuid.UUID
|      +--notion.client.NotionClient.get_record_data
|      |      +--notion.store.RecordStore.get
|      |      |      +--notion.utils.extract_id
|      |      |      +--notion.store.RecordStore._get
|      |      |      +--notion.store.RecordStore.call_load_page_chunk
|      |      |      |      +--notion.store.RecordStore.store_recordmap
|      |      |      |      |      +--notion.store.RecordStore._update_record
|      |      |      |      |      |      +--notion.store.RecordStore._save_cache
|      |      |      |      |      |      |      +--json.dump
|      |      |      |      |      |      |      +--notion.store.RecordStore._get_cache_path
|      |      |      |      |      |      |      |      +--pathlib.Path
|      |      |      |      |      |      +--dictdiffer.diff
|      |      |      |      |      |      +--notion.store.RecordStore._trigger_callbacks
|      |      |      +--notion.store.RecordStore.call_get_record_values
|      |      |      |      +--notion.utils.extract_id
|      |      |      |      +--notion.store.RecordStore._update_record
+--notion.client.NotionClient.__init__
|      +--requests.Session
|      +--requests.cookies.cookiejar_from_dict
|      +--hashlib.sha256
|      +--notion.store.RecordStore.__init__
|      |      +--multiprocessing.Lock
|      |      +--datetime.datetime.now
|      |      +--collections.defaultdict
|      |      +--notion.store.RecordStore._load_cache
|      |      |      +--notion.store.RecordStore._get_cache_path
|      |      |      +--json.load
|      +--notion.monitor.Monitor.__init__
|      |      +--uuid.uuid4
|      |      +--notion.monitor.Monitor.initialize
|      |      |      +--notion.monitor.Monitor._decode_numbered_json_thing
|      |      |      |      +--re.findall
|      |      |      |      +--notion.monitor.Monitor.post_data
|      |      |      |      +--json.loads
|      |      |      +--notion.monitor.Monitor.subscribe
|      |      |      |      +--uuid.uuid4
|      |      |      |      +--notion.monitor.Monitor._encode_numbered_json_thing
|      |      |      |      |      +--json.dumps
|      |      |      |      +--notion.monitor.Monitor.post_data
|      +--notion.client.NotionClient.start_monitoring
|      |      +--notion.monitor.Monitor.poll_async
|      |      |      +--threading.Thread
|      +--notion.client.NotionClient._update_user_info
|      |      +--notion.client.NotionClient.post
|      |      |      +--urllib.parse.urljoin
|      |      |      +--requests.Session.post
|      |      |      +--requests.HTTPError
|      |      |      +--json.dumps
|      |      +--notion.store.RecordStore.store_recordmap
|      |      +--notion.client.NotionClient.get_user
|      |      |      +--notion.client.NotionClient.get_record_data
|      |      |      +--notion.user.User.__init__
|      |      |      |      +--notion.records.Record.__init__
|      |      |      |      |      +--notion.utils.extract_id
|      |      +--notion.client.NotionClient.get_space
|      |      |      +--notion.client.NotionClient.get_record_data
|      |      |      +--notion.space.Space.__init__
|      |      |      |      +--notion.records.Record.__init__

We scan notion's versions among [0.0.22] and 0.0.23, 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: 0.0.23(original) 0.0.22
[](no clear difference between the source codes of two versions)

As for other packages, the APIs of @outside_package_name are called by notion 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 notion from "notion==0.0.23" to "notion>=0.0.22,<=0.0.23". This will improve the applicability of nerc and reduce the possibility of any further dependency conflict with other projects/packages.

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

No branches or pull requests

1 participant