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

dependencies in jupyter notebooks go unchecked? #492

Open
gwdekker opened this issue Dec 21, 2024 · 2 comments
Open

dependencies in jupyter notebooks go unchecked? #492

gwdekker opened this issue Dec 21, 2024 · 2 comments

Comments

@gwdekker
Copy link

Hey, it seems that dependencies in jupyter notebooks do not get checked by tach, is that correct? Seems like a bug if this is correct.

@emdoyle
Copy link
Member

emdoyle commented Dec 23, 2024

@gwdekker This is correct. Right now, Tach expects that it will be checking imports in Python source files only, and this assumption exists throughout our other commands.

The core use case we have built Tach for is Python application development, and we have relatively little visibility into how folks might use it with Jupyter Notebooks. Could you say more about your use case?

Functionally, it seems like we should be able to support most of Tach's functionality on notebooks by just condensing all of the Python code, but AFAIK features like interfaces wouldn't make sense since you cannot import from a notebook. There might also be complexity when we translate the filesystem path to a module path (naming conflicts seem possible if a sibling Python file shares the name of a notebook), but this seems solvable too.

@gwdekker
Copy link
Author

Sure! My code base is a monorepo which hosts several applications. It als contains a few jupyter notebooks, some of them for ad-hoc analysis, some of them we use through Voila as an ad-hoc dashboard, some of them on Voila even work as a very basic UI to our application. So the notebooks are just as much part of my modules as plain python files are. Therefore, the expected behavior for me would be that import statements in jupyter notebooks would be treated the same way as import statements in plain python files.

Potentially an easy way to achieve this would be to hook in nbconvert --to script into your system somehow?

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

2 participants