-
Notifications
You must be signed in to change notification settings - Fork 10
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
Potential data model change #53
Comments
My impression is that your (1) is the change to the data model and (2) - (6) are downstream functions that take in the new data model and return those things. Regarding what that data model looks like, in my head it's something like this: {
"stdlib_list": {
"occurances": {
("depfinder/main.py", 41): {
"try": false,
"if": false,
"class": false,
"function": false,
"exact_line": "from stdlib_list import stdlib_list"
},
}
"conda": "stdlib-list",
"pypi": "stdlib-list",
}
"requests": {
"occurances": {
("depfinder/main.py", 44): {
"try": false,
"if": false,
"class": false,
"function": false,
"exact_line": "import requests"
},
}
"conda": "requests",
"pypi": "requests",
}
} Then you can take that data structure and do whatever you want with it downstream after the code parsing has completed. I imagine that every time an import is encountered you could add it to the Not sure if Anyway, thoughts? |
Yeah, sorry markdown didn't render the tabs properly. |
I would have the conda/pypi part done independently, since a 3rd party may want to use their own mappings. One of my concerns is how to get enough detail into the questionable imports piece (try, if, etc.). I would want to know which libs are part of a "pick one" set (for instance |
Agreed on the conda/pypi part. Regarding the "pick one" set stuff, I'm pretty sure you could do that via ast. Not exactly sure how, but I don't imagine it would take too much poking around. Would probably require some reworking of how the ImportFinder works. Might need to consider designing a state machine to track where we are in the hierarchy. On second thought, this is probably a bit trickier than I originally thought |
Right, I'm hopeful that we could do it in the code, but I'm not certain what the data model would be that supports it. Maybe we associate shielded imports with an ID, so that all imports with (or within) that ID are associated together. |
It might be good to change the depfinder data model so better reflect a data-report relationship.
This could include:
thoughts @ericdill @ocefpaf @jkarp314
The text was updated successfully, but these errors were encountered: