question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not all module statically reachable from package root

See original GitHub issue

By that I mean, if you run certain static analyzers on boxsdk, they might tell you that some modules are never used.

For example, import boxsdk will run from .object import *, and boxsdk.object has folder in its __all__. So at runtime, import boxsdk should import boxsdk.object.folder and include it in sys.modules.

However, some static analyzers aren’t smart enough to realize that folder is imported this way, and may assume that folder is not used somewhere. We’ve found that py2app and pyinstaller both make this assumption, and will optimize boxsdk.object.folder out of the build, along with some other modules.

We should:

  • Make sure that all modules are included at least once in a very explicit way.
  • Write a test to assert this.

I’ve started working on this.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
eliasyishakcommented, Apr 22, 2020

Hi, I had to specifically import each module for it to work, ie. collaboration_whitelist_entry is a specific import line for me.

         hiddenimports=[
            'boxsdk.object.collaboration',
            'boxsdk.object.collaboration_whitelist',
            'boxsdk.object.collaboration_whitelist_entry',
            'boxsdk.object.collaboration_whitelist_exempt_target',
            'boxsdk.object.collection',
            'boxsdk.object.comment',
            'boxsdk.object.device_pinner',
            'boxsdk.object.enterprise',
            'boxsdk.object.events',
            'boxsdk.object.event',
            'boxsdk.object.file',
            'boxsdk.object.file_version',
            'boxsdk.object.file_version_retention',
            'boxsdk.object.folder',
            'boxsdk.object.group',
            'boxsdk.object.group_membership',
            'boxsdk.object.legal_hold',
            'boxsdk.object.legal_hold_policy',
            'boxsdk.object.legal_hold_policy_assignment',
            'boxsdk.object.metadata_cascade_policy',
            'boxsdk.object.metadata_template',
            'boxsdk.object.recent_item',
            'boxsdk.object.retention_policy',
            'boxsdk.object.retention_policy_assignment',
            'boxsdk.object.search',
            'boxsdk.object.storage_policy',
            'boxsdk.object.storage_policy_assignment',
            'boxsdk.object.terms_of_service',
            'boxsdk.object.terms_of_service_user_status',
            'boxsdk.object.trash',
            'boxsdk.object.task',
            'boxsdk.object.task_assignment',
            'boxsdk.object.user',
            'boxsdk.object.upload_session',
            'boxsdk.object.webhook',
            'boxsdk.object.watermark',
            'boxsdk.object.web_link']
0reactions
stale[bot]commented, Dec 19, 2022

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I define a Java 9 module inside both a source and ...
The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml. I don't fully understand why it's causing the problem, ...
Read more >
`no_mangle`/`used` static is only present in output ... - GitHub
The fix is to add an EXTERN(STATIC); declaration to the linker script, which tells the linker to keep looking for a STATIC symbol,...
Read more >
Chapter 7. Packages and Modules - Oracle Help Center
If a set of packages is sufficiently cohesive, then the packages may be grouped into a module. A module categorizes some or all...
Read more >
1.2. Declare modules and enable access between modules
Special module-info.java file must be at the root of Java class packages. ... If the dependencies are not static, users of the library...
Read more >
[GWT] Documentation - Organize Projects
A host HTML page does not have to be static content. It could also be generated ... Within the project root package, place...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found