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

Improve reloading #28

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open

Improve reloading #28

wants to merge 74 commits into from

Conversation

nneskildsf
Copy link

@nneskildsf nneskildsf commented Dec 14, 2024

This pull request:

  1. Supports while loop.
  2. Works in Jupyter Notebook.
  3. Supports break and continue in reloaded loops.
  4. Supports multiple uses of reloading in one python file.
  5. Supports import reloading.
  6. Supports importing reloaded functions, iterators and conditions.
  7. Supports marking functions as reloading after definition.
  8. Only reloads python file if it has changed.
  9. Exports locals of loops to parent locals. (And gives warnings when not possible)
  10. Is pyright, mypy, flake8 and ruff compliant.
  11. Adds heaps of tests which pass on Python 3.6 and newer.

The fork is equipped with a new readme and Github Actions. Check it out here: https://github.com/nneskildsf/reloading.

I hope at least some of these improvements can be merged.

Fixes: #13, #17, #25, #26, #27.

Br Eskild

kirle and others added 4 commits June 15, 2024 20:32
Resolved a bug where only the first function decorated with  would be reloaded on subsequent invocations. Also, enhanced exception handling to better manage specific cases, such as operating in non-interactive environments
nneskildsf and others added 25 commits December 15, 2024 13:48
Fix reloading issue with multiple decorated functions
…ython versions. Update readme to reflect API change.
…ython versions. Update readme to reflect API change.
Bump version number reflecting API change. Upadte list of supported p…
Allow 'continue' in loop.
Support while loop.
Support multiple uses of reloading in a single source code file.
Add tests.
Satisfy pyright.
Satisfy flake8.
Properly export local variables from loop.
Fix tests on Python versions < 3.13.
Improve tests.
Raise exception when reloading is not used as decorator or used outside of the context of a loop.
Handle rename/remove of reloaded code.
@nneskildsf nneskildsf changed the title Preserve function signature of decorated function Improve reloading Dec 22, 2024
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

Successfully merging this pull request may close these issues.

improvement: check file change date/hash and only reload if changed
3 participants