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

Reload a specific module #22

Open
matt-bernstein opened this issue Feb 16, 2023 · 1 comment
Open

Reload a specific module #22

matt-bernstein opened this issue Feb 16, 2023 · 1 comment

Comments

@matt-bernstein
Copy link

Hi! I'm interested in a use case where I only want to reload a particular library that I am developing, but I could change any function or file within that library. Would one of the following snippets achieve this, inside of IPython for example?

import jurigged
jurigged.watch(mymodule.__file__)
import pathlib
import jurigged
mydir = str(pathlib.Path(mymodule.__file__).parent)
jurigged.watch(mydir)

And if so would it make sense to add jurigged.watch(mymodule) as syntactic sugar?

@breuleux
Copy link
Owner

breuleux commented Feb 23, 2023

That should work, yes. I haven't paid much heed to the jurigged.watch interface since I rarely use it, but I like your suggestion, it is good sugar. I would only use the .parent if the module's filename is __init__.py, though.

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