Giter VIP home page Giter VIP logo

reloadium's Introduction

Logo

Advanced Hot Reloading & Profiling

Example

Profiling

Examples above are run in debug mode with added breakpoint.

Details

image

image

image

image

Reloadium adds hot reloading, profiling and AI features to your IDE

Installing

If you are a PyCharm user please check out Reloadium plugin
Plugins for other IDEs are coming soon.
Reloadium can be also used as a standalone library by installing it manually with pip:
pip install reloadium

Using

Running python files:

reloadium run example.py

Running modules:

reloadium run -m my_module
To apply your changes simply save a file

AI

Reloadium integrates with ChatGpt seamlessly providing additional context to your conversations resulting in much better replies.

ChatGpt

General Python Features

When altered, Reloadium will execute the current function again, providing developers with immediate feedback on the functionality of their code.

Frame Reloading

Reloadium manages errors that occur while reloading functions, allowing you to correct any mistakes seamlessly.

Frame Reloading

Reloadium has the ability to refresh files throughout the entire project by tracking dependencies.

Frame Reloading

Django

Upon saving, Reloadium performs hot reloading of views and automatically refreshes the page.

Page Refreshing

To avoid generating undesired objects after reloading the current function, Reloadium reverts any database modifications.

Rolling back db

Flask

Reloadium hot reloads Flask apps and automatically refreshes the page upon saving.
This enables real-time content updates, significantly streamlining web development.

Flask

SqlAlchemy

Reloadium will rollback database changes to prevent creating unwanted objects after reloading current function.

SqlAlchemy

Pandas

Reloadium facilitates hot reloading of Pandas objects, making the manipulation of intricate dataframes for data science remarkably simple.

Pandas

reloadium's People

Contributors

dkrystki avatar siilats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reloadium's Issues

multiprocessing processes fail to launch when debug is started with Reloadium

Describe the bug

I have functions I want to launch in parallel using python's multiprocessing.
I want to be able to set breakpoints inside these parallel processes like I can with the normal debugger and hot reload modifications of my code in them.

To Reproduce
I have created this minimum example to showcase the error:

import time
import multiprocessing as mp

def foo(i,_lock):
    print(f"Running Foo[{i}]")
    time.sleep(2)
    with _lock:
        print(f"finished Foo[{i}]")


def main(number_of_parallel_processes):
    ps = []
    _lock = mp.Lock()
    print("main is ready to launch")
    for i in range(number_of_parallel_processes):
        p = mp.Process(target=foo,args=(i,_lock))
        p.start()
        ps.append(p)

    [p.join() for p in ps]

if __name__ == '__main__':
    mp.set_start_method('spawn',force=True)
    main(number_of_parallel_processes=2)

When I run this with reloadium's debug (orange Debug icon), it crashes when trying to launch the processes:

D:\Users\agimg\Miniconda3\envs\clockwork_mind\python.exe -m reloadium pydev_proxy "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev\pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 51971 --file D:/projects/fastpbrl-main/scripts/scratchpads/hot_reload_multiproc.py
Connected to pydev debugger (build 221.5080.212)
■■■■■■■■■■■■■■■
Reloadium 0.9.2
■■■■■■■■■■■■■■■
If you like this project consider becoming a sponsor or giving a star at https://github.com/reloadware/reloadium
main is ready to launch
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py", line 197, in patch_args
host, port = _get_host_port()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py", line 47, in _get_host_port
host, port = pydevd.dispatch()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1875, in dispatch
host = setup['client']
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py", line 197, in patch_args
host, port = _get_host_port()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py", line 47, in _get_host_port
host, port = pydevd.dispatch()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1875, in dispatch
host = setup['client']
TypeError: 'NoneType' object is not subscriptable
File "", line 1
from
^
SyntaxError: invalid syntax
File "", line 1
from
^
SyntaxError: invalid syntax

Process finished with exit code 0

Expected behavior
When I run this with the normal pycharm debugger (pressing the green Debug icon), I get the expected output:

D:\Users\agimg\Miniconda3\envs\clockwork_mind\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev\pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 51960 --file D:/projects/fastpbrl-main/scripts/scratchpads/hot_reload_multiproc.py
Connected to pydev debugger (build 221.5080.212)
main is ready to launch
Running Foo[1]
Running Foo[0]
finished Foo[0]
finished Foo[1]

Process finished with exit code 0

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 10
  • Reloadium package version: 0.8.5 0.9.2 (*edit: thought this was same as pycharm plugin version.)
  • PyCharm plugin version: 0.8.5
  • Editor: Pycharm 2022.1
  • Run mode: Debug

Additional context
Using Python 3.10.2

Add all python files in multiple nesting directories

Loaded 0 watched modules so far from paths:
projects/

there are at least 3 directories between projects/ and my python files.
It works when I add each module directory to the re-loadable paths.
maybe the issue is that there are over 800 python files in the folder?

Won't work with remote developing.

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. Meau -> Tools -> Deployment -> Configuration, add a configuration to connect your server, map the project folder on the local disk and the server.
  2. Meau -> File -> Setting -> Project: Name -> Python Interpreter -> Add Interpreter, add a python Interpreter on the server.
  3. Meau -> Tools -> Deployment -> Download from default server, download the code from the server to local disk.
  4. Open a *.py file, add a breakpoint, click 'Debug with Relodium'.
  5. The thread stop on the breakpoint, modify the code, ctrl+s to upload the code to the server, but nothing changes.

Expected behavior
What I hope: When I modify the code, ctrl+s to upload the code to the server, the value of a variable should change.

Screenshots
Imgur

Desktop (please complete the following information):

  • OS: PyCharm on Windows 10 and python 3.10 on Ubuntu 20.0.4
  • OS version: 10
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: PyCharm 2022.2.3
  • Run mode: Debug

Error running 'my_project'

Error running 'my_project': Cannot invoke "com.intellij.ide.projectView.impl.AbstractProjectViewPane.updateFromRoot(boolean)" because "viewPane" is null

Plugin 0.8.6 (with Relodium 0.9.3) breaks with PyCharm 2022.2.3

Describe the bug
Relodium breaks.
I had relodium installed and upgraded both PyCharm and Relodium versions.
After the upgrade, the plugin fails when running. Because code is obfuscated I cannot see where it breaks, but I attached the log console.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Reloadium package version: 0.8.6
  • Editor: PyCharm 2022.2.3 (Professional Edition) Build #PY-222.4345.23, built on October 10, 2022
  • Run mode: Run

Additional context
Add any other context about the problem here.

remote interpreter hangs on kill command (red square), and shows no profile information

Describe the bug
When running the plugin locally, (Windows) everything is fine.
When running using remote interpreter (on a remote Ubuntu), no profile information is displayed.

To Reproduce
Create a remote interpreter configuration
Debug using the plugin
See no profiling info

Also killing the (remote) debugger hangs if started from the plugin, which doesn't happen with regular debug.

Expected behavior

  1. Ability to kill the remote interpreter
  2. Ability to see profiling information.

Screenshots
image

Desktop (please complete the following information):

  • OS: [Windows]
  • OS version: [10]
  • M1 chip: [yes/no] don't know
  • Reloadium package version: 0.9.5
  • PyCharm plugin version: [e.g 0.8.0 or None] 0.9
  • Editor: [e.g PyCharm] Pycharm
  • Python Version: [eg. 3.9] 3.8.10
  • Python Architecture: [eg. 32bit, 64bit]64
  • Run mode: [e.g Run/Debug] Debug

Question about logging and telemetry

Hi - why does this software connect to "depot.reloadware.com" when it runs? Worryingly, I don't see any source code in this repository that would make such a connection. How did this behavior make it into the PyPI wheel?

Also, I see it's trying to upload logs to sentry.io from my machine. Why? What information is being sent from my machine? How is it stored? Is it anonymized?

This is with Python 3.10.6, Reloadium 0.9.1, on Linux, installed via the PyPI manylinux wheel.

[Feature request] hidden decorators

In some cases I'd like the reloadium decorators to be outside of my source code, and it will be nice if there was a way to save it inside the plugin settings\ config file.

Advanced feature will be an indicator in the IDE of this, but not as important.

Too many open files OSError during initialisation

Describe the bug
For the Django project I work on, I would like to use reloadium with the python repl.
Usually to run the repl, I would type on the commandline python manage.py shell
But when using reloadium: reloadium run manage.py shell I get the following traceback

Traceback (most recent call last):
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/ll1l1lll1l1lll1lIl1l1.py", line 138, in l11l1llll1llll11Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1111l1l111ll1llIl1l1.py", line 326, in llllll1111llll11Il1l1
  File "<string>", line 4, in __init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1111l1l111ll1llIl1l1.py", line 242, in __post_init__
  File "<string>", line 5, in __init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1l1l1llll11lll1Il1l1.py", line 170, in __post_init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1l1l1llll11lll1Il1l1.py", line 248, in l1lll1llllll11l1Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/lllllll111l1l1llIl1l1.py", line 389, in l11l1llll1lll111Il1l1
  File "<string>", line 12, in __init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/lllllll111l1l1llIl1l1.py", line 332, in __post_init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/observers/api.py", line 291, in schedule
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/observers/kqueue.py", line 450, in __init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/utils/dirsnapshot.py", line 251, in __init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/utils/dirsnapshot.py", line 283, in walk
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/utils/dirsnapshot.py", line 283, in walk
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/utils/dirsnapshot.py", line 283, in walk
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/watchdog/utils/dirsnapshot.py", line 259, in walk
OSError: [Errno 24] Too many open files: '/Users/me/Work/code/project/node_modules/queue-microtask'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/.virtualenvs/python/bin/reloadium", line 8, in <module>
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/__init__.py", line 20, in start
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1111l1l111ll1llIl1l1.py", line 612, in start
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1111l1l111ll1llIl1l1.py", line 596, in l1llll11ll11ll1lIl1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1111l1l111ll1llIl1l1.py", line 502, in l1l1lll11ll1ll1lIl1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1111l1l111ll1llIl1l1.py", line 325, in llllll1111llll11Il1l1
  File "/Users/me/.pyenv/versions/3.10.1/lib/python3.10/contextlib.py", line 153, in __exit__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/ll1l1lll1l1lll1lIl1l1.py", line 143, in l11l1llll1llll11Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/ll1l1lll1l1lll1lIl1l1.py", line 107, in l11ll1111lll11llIl1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1l1l111l1l111l1Il1l1.py", line 15, in l111ll11lll11l11Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1l1l111l1l111l1Il1l1.py", line 43, in ll1ll1l1111l1ll1Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1l1l111l1l111l1Il1l1.py", line 15, in l111ll11lll11l11Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/corium/l1l1l111l1l111l1Il1l1.py", line 24, in lll11ll1l1l111l1Il1l1
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/sentry_sdk/hub.py", line 105, in _init
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/sentry_sdk/client.py", line 85, in __init__
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/sentry_sdk/client.py", line 119, in _init_impl
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/sentry_sdk/integrations/__init__.py", line 93, in setup_integrations
  File "/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/sentry_sdk/integrations/__init__.py", line 41, in iter_default_integrations
  File "/Users/me/.pyenv/versions/3.10.1/lib/python3.10/importlib/__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 945, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1430, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1402, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1539, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1582, in _fill_cache
OSError: [Errno 24] Too many open files: '/Users/me/.virtualenvs/python/lib/python3.10/site-packages/reloadium/vendored/sentry_sdk/integrations'

Desktop (please complete the following information):

  • OS: MacOS
  • OS version: 12.6 (Monterey)
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: None
  • Editor: commandline
  • Run mode: reloadium run

Additional context
It appears that reloadium (through watchdog) is not only scanning all my node_modules but opening the files too.
This is happening regardless if I set either the RELOADIUMPATH or RELOADIUMIGNORE environment variables.
I assumed I could configure it via reloadium_config.py since the Config object has ignored_paths and watched_paths but I think this scanning occurs prior to the config being loaded(?).

I believe this is more a problem with the vendored watchdog library, which also seems to also try limit you to 300 files in the pycharm plugin. This would be a problem for me since the django project I have as several thousand files.

Maybe you could use an alternate filesystem watcher like: https://pypi.org/project/watchfiles/

Very unusual cli interface

Not precisely a bug, but running

reloadium --help

Just gives

Invalid command --help

instead of actually printing the help. You seem to have implemented a very custom CLI interface. I would suggest switching to click or typer. Would make it more standard to use.

[Feature Request] Need reloadium to work without manually adding breakpoints

Describe the bug

Suppose there's some bug in my code. I don't know where and I don't know why. I only know this by running code for 4 hours and I need reloadium to pinpoint its location for me to edit and reload the code without restarting. Exceptions wrapped in try...except are ignored. Only those raised without being caught will trigger this behavior. The breakpoint should not go beyond the scope if configured. If the scope is limited to current folder, files outside this folder shall not be traced and breakpoint level is limited to the root cause of the exception in this folder.

To Reproduce

Steps to reproduce the behavior:

  1. Run a program with reloadium without adding breakpoints
  2. Reloadium raises an exception
  3. Program exits

Expected behavior

Reloadium will not exit, automatically generate breakpoint at the location where exception is raised, letting me to fix it.

Desktop (please complete the following information):

  • OS: macOS
  • OS version: 12.5
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: None
  • Editor: PyCharm CE
  • Run mode: Debug

Additional context

Example scenario:

def trouble():
    raise Exception('error!') # reloadium should automatically add a breakpoint here after running without exiting.

if __name__ == "__main__":
    # long and tedious startup omitted.
    trouble()

Create Wheels for 32bit Python on Windows

I'm stuck in a 32bit Python environment (3.7), and would love to use Reloadium, but there are no wheels available for that architecture. Upon installing the IntelliJ plugin, the 0.0.1 version of from pypi was installed for my environment, but this lacks the necessary imports and did not work.

Working with multiple virtual environments

$ reloadium run ./myscript.py
■■■■■■■■■■■■■■■
Reloadium 0.8.6
■■■■■■■■■■■■■■■
If you like this project please support it by giving a star at https://github.com/reloadware/reloadium

Watching paths:
‣ /home/.../Code/<snip>/**/*.py

Traceback (most recent call last):
<snip>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

This otherwise works fine when launched from command line.

Originally posted by @NekiMedo in #8

Multiple issues with Reloadium 0.9.3

  1. Debug with Reloadium does not work after upgrading to 0.9.3. It results in the following trace:
Traceback (most recent call last):
  File "C:\Users\user\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\user\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\user\.reloadium\package\3.9\reloadium\__main__.py", line 5, in <module>
    start(sys.argv)
  File "C:\Users\user\.reloadium\package\3.9\reloadium\corium\l1l1llll1llll1l1Il1l1.py", line 627, in start
  File "C:\Users\user\.reloadium\package\3.9\reloadium\corium\l1l1llll1llll1l1Il1l1.py", line 102, in l1l1ll1ll1lllll1Il1l1
  File "C:\Users\user\.reloadium\package\3.9\reloadium\corium\l1l1llll1llll1l1Il1l1.py", line 81, in l11l111l11ll11llIl1l1
  File "C:\Users\user\Anaconda3\lib\pathlib.py", line 1285, in write_text
    with self.open(mode='w', encoding=encoding, errors=errors) as f:
  File "C:\Users\user\Anaconda3\lib\pathlib.py", line 1252, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "C:\Users\user\Anaconda3\lib\pathlib.py", line 1120, in _opener
    return self._accessor.open(self, flags, mode)
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\JetBrains\\PyCharm 2022.2.2\\plugins\\python\\helpers\\pydev\\_pydevd_frame_eval\\pydevd_frame_eval_main.py.tmp'

I think I found a workaround: running PyCharm as administrator allows debugging with Reloadium to work, and then it works even if running normally when restarted subsequently.

  1. Files and modules in the project are decorated with orange squares when running or debugging with Reloadium. I assume this is to indicate that these files are being watched for changes. However, these squares do not go away even after the program is stopped. Don't know if it's intentional, but all these orange marks are a bit intense, and they become quite distracting when they are permanent. I would suggest making these marks optional in preferences.

  2. After working with Reloadium run or debug, attempting to close PyCharm results in a "Background Tasks are Running" dialog. No background tasks are indicated in the task list.

To Reproduce
Steps to reproduce the behavior:
Behavior occurs immediately when trying to debug after upgrading the PyCharm plugin to 0.8.6 with Reloadium 0.9.3.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Reloadium package version: [e.g 0.8.6]
  • PyCharm plugin version: 0.9.3
  • Editor: PyCharm
  • Run mode: Debug and Run

Reloadium on pycharm won't load Flask templates

Describe the bug
I tried the reloadium plugin for PyCharm for my Flask project. The problem is reloadium cannot found the index.html template used in my project.

Here is the error :

C:\Users\tom52\Desktop\projet>reloadium run app.py
■■■■■■■■■■■■■■■
Reloadium 0.8.8
■■■■■■■■■■■■■■■
If you like this project consider becoming a sponsor or giving a start at https://github.com/reloadware/reloadium
 * Serving Flask app '__main__' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
INFO:werkzeug: * Running on http://127.0.0.1:5000 (Press CTRL+C to quit)

Loaded 3 watched modules so far from paths:
 - \C:\Users\tom52\Desktop\projet\**\*.html
 - \C:\Users\tom52\Desktop\projet\**\*.py

ERROR:__main__:Exception on / [GET]
Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\flask\app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Python310\lib\site-packages\flask\app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Python310\lib\site-packages\flask\app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Python310\lib\site-packages\reloadium\reloader\llll11l1l1l1l1llIl1l1\llllll1l1ll111l1Il1l1.py", line 165, in ll11ll1ll11ll111Il1l1
  File "C:\Python310\lib\site-packages\flask\app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "C:\Users\tom52\Desktop\projet\app.py", line 28, in index
    return render_template('index.html', history=history)
  File "C:\Python310\lib\site-packages\flask\templating.py", line 149, in render_template
    ctx.app.jinja_env.get_or_select_template(template_name_or_list),
  File "C:\Python310\lib\site-packages\jinja2\environment.py", line 1081, in get_or_select_template
    return self.get_template(template_name_or_list, parent, globals)
  File "C:\Python310\lib\site-packages\jinja2\environment.py", line 1010, in get_template
    return self._load_template(name, globals)
  File "C:\Python310\lib\site-packages\jinja2\environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "C:\Python310\lib\site-packages\jinja2\loaders.py", line 126, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "C:\Python310\lib\site-packages\flask\templating.py", line 59, in get_source
    return self._get_source_fast(environment, template)
  File "C:\Python310\lib\site-packages\flask\templating.py", line 95, in _get_source_fast
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html
INFO:werkzeug:127.0.0.1 - - [06/Jun/2022 22:24:08] "GET / HTTP/1.1" 500 -

To Reproduce
Steps to reproduce the behavior:

  1. Create a python flask project with the following files tree:
project/
      | app.py
      | templates/
          | index.html
  1. Create a templates directory and add index.html
  2. create the app in python with app = Flask(__name__, template_folder='templates') and app.run()
  3. run reloadium run app.py

Expected behavior
As the Flask constructor specifies the template folder, the flask app should run correctly

Screenshots

  • Running the code by python app.py or PyCharm (same result)
    image

  • Running the code with console reloadium or pycharm reloadium (same result)
    image

Desktop (please complete the following information):

  • OS: Windows
  • OS version: Windows 11 Professional - Version 21H2 - build 22000.675
  • Reloadium package version: 0.8.8
  • PyCharm plugin version: 0.8.2
  • Editor: PyCharm
  • Run mode: Run & Debug

Additional context
Add any other context about the problem here.

async functions not reloading

Plugin seems to ignore functions marked async. Are they not meant to be reloadable?

Desktop (please complete the following information):

  • OS: Windows 10
  • Reloadium package version: 0.9.0
  • PyCharm plugin version: 0.8.3
  • Editor: PyCharm 2022.1.3 (Pro Edition)
  • Run mode: Both

[Feature Request] Enable changing breakpoints during debugging

Describe the bug

Reloadium is not sensitive to runtime changes to breakpoints.

To Reproduce

Steps to reproduce the behavior:

  1. Set breakpoints
  2. Run debug with reloadium
  3. Add/remove breakpoints
  4. Reloadium is insensitive to breakpoint changes

Expected behavior

Reloadium should respond to runtime breakpoint changes

Desktop (please complete the following information):

  • OS: macOS
  • OS version: 12.5
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: None
  • Editor: PyCharm CE
  • Run mode: Debug

Additional context

If every execution frame is hooked by reloadium, we can decide whether to reload or not with latest breakpoints.

C:\Python310\python.exe: No module named reloadium.flask_test

Describe the bug
Trying to run flask hello world app with reloadium gives error.

To Reproduce
Steps to reproduce the behavior:

  1. pip install reloadium --user
  2. python -m reloadium run .\flask_test.py

Expected behavior
Ideally it should start tracking files and reload app based on changes.

Screenshots
If applicable, add screenshots to help explain your problem.
Capture

Desktop (please complete the following information):

  • OS: [Windows]
  • Reloadium package version: [0.8.7]
  • Editor: [Vscode]
  • Run mode: [Run/Debug]

Question about Decorators

Describe the bug
The decorators seem not working properly, so I'm wondering if I'm missing out something here. When I add a comment like "# reloadium: no_reload", it does not prevent reloadium from reloading the code.

To Reproduce
Here is a simple python file:

print(3)  # reloadium: no_reload
print(4)

And toggle a breakpoint in the second line in PyCharm app(Mac). Run "Debug with Reloadium", the pycharm debugger stops at the second line.

Expected behavior
When changing the first line into print(5) # reloadium: no_reload, it should not reload this line. So when pressing "cmd+S", the python debug console should not print anything.

Screenshots
However, reloadium seems to ignore the comment and still reloaded the first line of code. So the python debug console print 5:
image

Desktop (please complete the following information):

  • OS: MacOS Monterey
  • OS version: 12.1
  • Reloadium package version: 0.8.3
  • PyCharm plugin version: 2021.2
  • Editor: PyCharm
  • Run mode: Debug

Python 3.11 Support

Describe the bug
Not working on Python 3.11

To Reproduce
Steps to reproduce the behavior:

  1. Install Python 3.11
  2. Run Reloadium
  3. It prints

It seems like your platform or Python version are not supported yet.
Windows, Linux, macOS and Python >= 3.7 (3.9 for M1) are currently supported.
Please submit a github issue if you believe Reloadium should be working on your system at
https://github.com/reloadware/reloadium

Expected behavior
Working

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: PyCharm
  • Run mode: Run and Debug

Additional context
Add any other context about the problem here.

[M1 Chip, macos] It seems like your platform or Python version are not supported yet.

I Get this:
(venv) xxx/venv/bin/python -m reloadium pydev_proxy /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --multiprocess --save-signatures --qt-support=auto --client 127.0.0.1 --port 55863 --file xx/init.py --infer_schema

It seems like your platform or Python version are not supported yet.
Please submit a github issue to let us know at https://github.com/reloadware/reloadium

im trying to debug a module

Segmentation fault while using Django with python-devtools

Describe the bug

Using Django==3.2.13 this is a massive project in general.
Loaded 416 watched modules so far from paths.

When I used python-devtools got a segfault with:

Thread 44 "python" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffa1329700 (LWP 13697)]
_PyMem_DebugMalloc (ctx=0x555555b59380 <_PyMem_Debug+96>, nbytes=40) at Objects/obmalloc.c:2329
warning: Source file is more recent than executable.
2329        _PyMem_DebugCheckGIL(__func__);

bt output:

(gdb) bt
#0  _PyMem_DebugMalloc (ctx=0x555555b59380 <_PyMem_Debug+96>, nbytes=40) at Objects/obmalloc.c:2329
#1  0x00005555556029a6 in PyObject_Malloc (size=<optimized out>) at Objects/obmalloc.c:685
#2  0x00005555556ed825 in _PyObject_GC_Alloc (use_calloc=use_calloc@entry=0, basicsize=<optimized out>) at Modules/gcmodule.c:2225
#3  0x00005555556ee7be in _PyObject_GC_Malloc (basicsize=<optimized out>) at Modules/gcmodule.c:2252
#4  0x00005555556ee7eb in _PyObject_GC_New (tp=0x7ffff6e893c0) at Modules/gcmodule.c:2264
...
#56155 0x00005555555bec20 in PyVectorcall_Call (callable=callable@entry=0x7fffa2563ef0, tuple=tuple@entry=0x7ffff73e3050, kwargs=kwargs@entry=0x7fffa24d6a10) at Objects/call.c:230
#56156 0x00005555555bef65 in _PyObject_Call (tstate=0x7fffbc002c30, callable=callable@entry=0x7fffa2563ef0, args=args@entry=0x7ffff73e3050, kwargs=kwargs@entry=0x7fffa24d6a10) at Objects/call.c:265
#56157 0x00005555555befe3 in PyObject_Call (callable=callable@entry=0x7fffa2563ef0, args=args@entry=0x7ffff73e3050, kwargs=kwargs@entry=0x7fffa24d6a10) at Objects/call.c:292
--Type <RET> for more, q to quit, c to continue without paging--
#56158 0x000055555567ccea in do_call_core (tstate=tstate@entry=0x7fffbc002c30, func=func@entry=0x7fffa2563ef0, callargs=callargs@entry=0x7ffff73e3050, kwdict=kwdict@entry=0x7fffa24d6a10) at Python/ceval.c:5092
#56159 0x0000555555687562 in _PyEval_EvalFrameDefault (tstate=0x7fffbc002c30, f=0x7fffcc1e3990, throwflag=<optimized out>) at Python/ceval.c:3552
#56160 0x00005555555be8db in _PyEval_EvalFrame (throwflag=0, f=0x7fffcc1e3990, tstate=0x7fffbc002c30) at ./Include/internal/pycore_ceval.h:40
#56161 function_code_fastcall (tstate=0x7fffbc002c30, co=<optimized out>, args=0x7fffe013eec0, args@entry=0x7fffe013eeb8, nargs=1, globals=<optimized out>) at Objects/call.c:329
#56162 0x00005555555bf232 in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7fffe013eeb8, nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:366
#56163 0x000055555567caff in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775809, args=0x7fffe013eeb8, callable=0x7ffff5d2beb0, tstate=0x7fffbc002c30) at ./Include/cpython/abstract.h:118
#56164 PyObject_Vectorcall (kwnames=0x0, nargsf=9223372036854775809, args=0x7fffe013eeb8, callable=0x7ffff5d2beb0) at ./Include/cpython/abstract.h:127
#56165 call_function (tstate=tstate@entry=0x7fffbc002c30, pp_stack=pp_stack@entry=0x7fffa1328a60, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:5044
#56166 0x0000555555687052 in _PyEval_EvalFrameDefault (tstate=0x7fffbc002c30, f=0x7fffe013ed40, throwflag=<optimized out>) at Python/ceval.c:3476
#56167 0x00005555555be8db in _PyEval_EvalFrame (throwflag=0, f=0x7fffe013ed40, tstate=0x7fffbc002c30) at ./Include/internal/pycore_ceval.h:40
#56168 function_code_fastcall (tstate=0x7fffbc002c30, co=<optimized out>, args=0x7fffcc01b260, args@entry=0x7fffcc01b258, nargs=1, globals=<optimized out>) at Objects/call.c:329
#56169 0x00005555555bf232 in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7fffcc01b258, nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:366
#56170 0x000055555567caff in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775809, args=0x7fffcc01b258, callable=0x7ffff5d2e230, tstate=0x7fffbc002c30) at ./Include/cpython/abstract.h:118
#56171 PyObject_Vectorcall (kwnames=0x0, nargsf=9223372036854775809, args=0x7fffcc01b258, callable=0x7ffff5d2e230) at ./Include/cpython/abstract.h:127
#56172 call_function (tstate=tstate@entry=0x7fffbc002c30, pp_stack=pp_stack@entry=0x7fffa1328c80, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:5044
#56173 0x0000555555687052 in _PyEval_EvalFrameDefault (tstate=0x7fffbc002c30, f=0x7fffcc01b0e0, throwflag=<optimized out>) at Python/ceval.c:3476
#56174 0x00005555555be8db in _PyEval_EvalFrame (throwflag=0, f=0x7fffcc01b0e0, tstate=0x7fffbc002c30) at ./Include/internal/pycore_ceval.h:40
#56175 function_code_fastcall (tstate=0x7fffbc002c30, co=<optimized out>, args=0x7fffa1328dc0, args@entry=0x7fffa1328db8, nargs=1, globals=<optimized out>) at Objects/call.c:329
#56176 0x00005555555bf232 in _PyFunction_Vectorcall (func=<optimized out>, stack=0x7fffa1328db8, nargsf=<optimized out>, kwnames=<optimized out>) at Objects/call.c:366
#56177 0x0000555555783cdd in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=1, args=0x7fffa1328db8, callable=0x7ffff5d2bf50, tstate=0x7fffbc002c30) at ./Include/cpython/abstract.h:118
#56178 method_vectorcall (method=<optimized out>, args=0x7ffff73e3068, nargsf=<optimized out>, kwnames=0x0) at Objects/classobject.c:61
#56179 0x00005555555bec20 in PyVectorcall_Call (callable=callable@entry=0x7fffa145bef0, tuple=tuple@entry=0x7ffff73e3050, kwargs=kwargs@entry=0x0) at Objects/call.c:230
#56180 0x00005555555bef65 in _PyObject_Call (tstate=0x7fffbc002c30, callable=0x7fffa145bef0, args=0x7ffff73e3050, kwargs=0x0) at Objects/call.c:265
#56181 0x00005555555befe3 in PyObject_Call (callable=<optimized out>, args=<optimized out>, kwargs=<optimized out>) at Objects/call.c:292
#56182 0x000055555574238b in t_bootstrap (boot_raw=boot_raw@entry=0x7fffa249c9a0) at ./Modules/_threadmodule.c:1040
#56183 0x00005555556da7ec in pythread_wrapper (arg=<optimized out>) at Python/thread_pthread.h:236
#56184 0x00007ffff7f91609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#56185 0x00007ffff7d5c133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

bt full:

(gdb) bt full
#0  _PyMem_DebugMalloc (ctx=0x555555b59380 <_PyMem_Debug+96>, nbytes=40) at Objects/obmalloc.c:2329
        __func__ = "_PyMem_DebugMalloc"
#1  0x00005555556029a6 in PyObject_Malloc (size=<optimized out>) at Objects/obmalloc.c:685
No locals.
#2  0x00005555556ed825 in _PyObject_GC_Alloc (use_calloc=use_calloc@entry=0, basicsize=<optimized out>) at Modules/gcmodule.c:2225
        tstate = <optimized out>
        gcstate = 0x555555baa118
        size = <optimized out>
        g = <optimized out>
        __PRETTY_FUNCTION__ = "_PyObject_GC_Alloc"
        op = <optimized out>
#3  0x00005555556ee7be in _PyObject_GC_Malloc (basicsize=<optimized out>) at Modules/gcmodule.c:2252
No locals.
#4  0x00005555556ee7eb in _PyObject_GC_New (tp=0x7ffff6e893c0) at Modules/gcmodule.c:2264
        op = <optimized out>

No syms for reloader:

objdump --syms /home/shako/REPOS/.../env/lib/python3.9/site-packages/reloadium/reloader.cpython-39-x86_64-linux-gnu.so

/home/shako/REPOS/.../env/lib/python3.9/site-packages/reloadium/reloader.cpython-39-x86_64-linux-gnu.so:     file format elf64-x86-64

SYMBOL TABLE:
no symbols
nm /home/shako/REPOS/.../env/lib/python3.9/site-packages/reloadium/reloader.cpython-39-x86_64-linux-gnu.so
nm: /home/shako/REPOS/.../env/lib/python3.9/site-packages/reloadium/reloader.cpython-39-x86_64-linux-gnu.so: no symbols

To Reproduce
Steps to reproduce the behavior:

  1. enable python-devtools by following this:
    https://python-devtools.helpmanual.io/usage/#manual-install
    My sitecustomize.py path: /usr/local/lib/python3.9/sitecustomize.py

  2. Fire up django with given version

  3. add sum dummy simple view

  4. add debug() statements as in:
    https://python-devtools.helpmanual.io/usage/#debug

  5. make it to reload

  6. then remove debug() statements

  7. make it to reload

  8. expect segfault

Expected behavior
No segfault obviously

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu
  • OS version: 20.04.4 LTS
  • Reloadium package version: 0.9.0
  • PyCharm plugin version: No plugin running from terminal
  • Editor: PyCharm
  • Run mode: run

Additional context
Add any other context about the problem here.

Reloadium exit instantly and Variable inspections are not shown.

Describe the bug

  1. When I click orange debug button, reloadium process exits instantly.
  2. In the official Futures Page, it says Reloadium shows variable inspection on the right of assignment. But nothing is shown after I cilck run button or debug button.

To Reproduce
Steps to reproduce the behavior:

  1. Install Reloadium from the PyCharm plugin store.
  2. Write your code.
  3. Click orange debug button or run button.
  4. step4 opens console and it says process is exited.

Expected behavior
Show variable inspection on the right of variable.

Screenshots
image
In the console

connected to pydev debugger (build 222.4345.23)
■■■■■■■■■■■■■■■
Reloadium 0.9.4
■■■■■■■■■■■■■■■
If you like this project consider becoming a sponsor or giving a star at https://github.com/reloadware/reloadium
(5 + 9) = 14

process exited with exit code 0

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: PyCharm 2022.2.3
  • Run mode: Run and Debug

Pickle fails in Reloadium (at least from within PyCharm plugin)

Describe the bug
Pickling fails when Reloadium is used to run the following code. Non-reloadium runs fine.

To Reproduce

from builtins import *
import pickle
import jsonpickle

class A:
  def __init__(self, *args, **kwargs):
    self.b = None


def test_serializer(obj, pickler):
  pickled_doc = pickler.dumps(obj)
  new_doc = pickler.loads(pickled_doc)
  if type(obj) != type(new_doc):
    print('ERROR: Serialization changed object type.')
    print(f'  type: {type(new_doc)} does not match original type: {type(obj)}')
    print('  ', pickler)
  else:
    print('GOOD:  Serialization preserved object type.')
    print(f'  type: {type(new_doc)} matches original type: {type(obj)}')
    print('  ', pickler)


# As of 2022-06-05 Reloadium plugin ver. 0.8.2 (shows Reloadium 0.8.8 when running) fails, but non-Reloadium works.
# Running PyCharm 2021.3.1 Community Edition.
if __name__ == '__main__':
  # Try JSON first.
  json_orig = A()
  test_serializer(json_orig, jsonpickle)
  # Second, try plain pickle.
  py_orig = A()
  test_serializer(py_orig, pickle)

Expected behavior
Unpickled type changes from original type pickled. Tested both normal 'pickle' and 'jsonpickle'. Running normal, works, but running through Reloadium fails.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 10
  • Reloadium package version: 0.8.8
  • PyCharm plugin version: 0.8.2
  • Editor: PyCharm
  • Run mode: Run & Debug

Syntax error when imports are not on first line

Describe the bug
I have a number of files that contain preambles before the code (eg copyright notices, file description, etc).
All my python files then contain from __future__ import annotations for typing purposes.
When using reloadium with debug, I get the following SyntaxError:

Traceback (most recent call last):
  File "one.py", line 4
    from __future__ import annotations
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: from __future__ imports must occur at the beginning of the file

To Reproduce
Steps to reproduce the behavior:

  1. create 2 files: one.py and two.py
  2. contents of one.py
"""
Docstring
"""
from __future__ import annotations
  1. contents of two.py
import two
  1. In pycharm, add the directory containing the two files to reloadable paths
  2. Run and see error

Expected behavior
No error occurs

Desktop:

  • OS: MacOS
  • OS version: 12.6 (Monterey)
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: Pycharm
  • Run mode: Debug

Additional context
Unfortunately, this is blocking me trying to debug why the Run configuration doesn't work for my project (for some reason docstrings on __init__ functions are being stripped when using reloadium)

Debug with Reloadium does not work with the threading module

Code which uses the threading module and works when running with reloadium does not work when debugging with reloadium.

Reproduced with the following code:

import threading

def work():
    print("something")

class tt:
    def __init__(self):

        t1 = threading.Thread(target=work)
        t2 = threading.Thread(target=work)

        t1.start()
        t2.start()

        t1.join()
        t2.join()

test = tt()

This fails with UnboundLocalError: local variable 'threading' referenced before assignment.

A workaround can be made by using from threading import Thread instead of import threading. However, a lot of existing code can't be conveniently debugged.

  • OS: Windows
  • OS version: 11
  • Reloadium package version: 0.9.2
  • PyCharm plugin version: 0.8.5
  • Editor: PyCharm
  • Run mode: Debug

Additional context
Add any other context about the problem here.

Reloadium fails to start: Too many open files

Describe the bug
When using the Reloadium plugin for PyCharm with the runserver command (both run and debug from the plugin fail), PyCharm hangs for a while and then fails on "Too many open files".

To Reproduce
Steps to reproduce the behavior:

  1. Start with an baseline Django project (I used PyCharm's built-in "New Project" > "Django" for testing the reproducer)
  2. Add a package.json file to define a whole bunch of NodeJS dependencies (here's a sample one that I was able to get this to recreate with: https://gist.github.com/wgordon17/3d3f6bbffc69addc690a6e984e043c3a)
  3. Run npm installl, which creates a local node_modules directory
  4. Add node_modules to the exclusion list
    image
  5. Attempt to Run/Debug the Django runserver with Reloadium

Expected behavior
Reloadium should run as expected

Desktop (please complete the following information):

  • OS: MacOS Monteray
  • OS version: 12.5
  • Reloadium package version: 0.9.2
  • PyCharm plugin version: 0.8.5
  • Editor: PyCharm 2022.2.1 Professional
  • Run mode: This happens regardless of run mode

Additional context
Having a node_modules directory and running NodeJS packages alongside Django is a common pattern. Since Reloadium focuses on Python, it would probably make sense to include a hard coded node_modules exclusion somewhere.

Although, I also suspect this problem isn't limited to just node_modules, I would expect the exclusion configuration to prevent dirsnapshot.py from doing whatever it's doing (the error code mentioned errors on line 283 in walk, so that's why I'm guessing that's where this occurs). That way, this could prevent other issues similar to this.

Issues with exceptions

Describe the bug
Reloadium does not handle correctly methods that raise exceptions.

To Reproduce
Steps to reproduce the behavior:

  1. Create a module with the following content
def bar():
    raise Exception('Some exception')


def foo():
    try:
        bar()
    except Exception as e:
        pass


foo()
pass
  1. Place a breakpoint at the end of the module.
  2. Debug the code using reloadium

Expected behavior
Application stops at the set breakpoint

Actual behavior
The message "An exception occurred during reloading current frame. Fix your changes and save to reload" appears. Reloadium waits for the user to fix the bar() method.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 10
  • Reloadium package version: 0.8.7
  • PyCharm plugin version: 0.8.1
  • Editor: PyCharm
  • Run mode: Debug

Additional context
No problems will appear if you catch the exception in the method where the exception occurs. The following snippet will work:

def bar():
    try:
        raise Exception('Some exception')
    except Exception:
        pass

Previous versions of Reloadium handled such situations without any problems.

Reloadium randomly breaks itself on PyCharm Manjaro

Describe the bug
Reloadium nuked itself and now throws a stack trace whenever launching PyCharm.

To Reproduce
Steps to reproduce the behavior:

  1. Launch IDE
  2. Reloadium Fails to load. Worked earlier on this exact system.

Expected behavior
Reloadium to work.

Desktop (please complete the following information):

  • OS: Manjaro
  • OS version: 21.3.1 Ruah
  • Reloadium package version: Can't tell, Reloadium doesn't work.
  • PyCharm plugin version: 0.8.3
  • Editor: PyCharm
  • Run mode: No Reloadium Option

Additional context
https://pastebin.com/aDtdGsXw

Can't get memory line profiler in PyCharm

Describe the bug
I just downloaded the pycharm plugin for reloadium after seeing it on reddit. Looks like a very useful tool, but I am having trouble replicating the memory line profiling shown in this post (and README doesn't include info on memory profiling yet): https://www.reddit.com/r/pycharm/comments/z0x4gu/memory_profiling_for_pycharm/

Apologies if I am just doing something wrong!

To Reproduce
Steps to reproduce the behavior:

  1. Use my code below with breakpoints on each pass
  2. Debug using reloadium
  3. Open profiling details in the margin
  4. Details are in units of time, not memory
  5. In the Debug tab of pycharm, open the Reloadium sub-tab, change the profiler to "Memory"
  6. Nothing changes
  7. Repeat steps 2-3, but profiler setting from step 5 resets to Time and details are still in units of time

Expected behavior
Should be able to easily switch between units of time/memory, possibly having to rerun the debugger if technically necessary

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Pop OS (Ubuntu)
  • OS version: 22.04 LTS
  • M1 chip: No
  • Reloadium package version: 0.9.5
  • PyCharm plugin version: 0.9.0
  • Editor: PyCharm
  • Python Version: 2022.2.2 Professional
  • Python Architecture: 64bit
  • Run mode: Debug

Additional context
My code:

import numpy as np
import pandas as pd


def foo():
    data = np.random.randint(0, 100, size=(10, 1000))
    df = pd.DataFrame(data)
    df = pd.concat([df, df])
    pass


def bar():
    a = b"r" * 10_000
    pass


if __name__ == '__main__':
    foo()
    bar()
reloadium_memory_profiler_issue.mov

Error occurs when Python file path contains Non-ASCII characters

Describe the bug
Error occurs when Python file path contains Non-ASCII characters.
Hot Reload don't work

To Reproduce
Steps to reproduce the behavior:

  1. Create a Python file named "😊.py" in PyCharm
  2. Write some code
  3. Run
  4. Change some code and save
  5. See error

Expected behavior
Works

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: PyCharm
  • Run mode: Run and Debug

Additional context
Add any other context about the problem here.

Reloadium not installing

Pycharm Version:
PyCharm 2021.3.1 (Community Edition)

After installation bar completion, pycharm doesn't show that it is installed when plugin dialog is reopened.

Not working with Python 32 bit (x86)

Describe the bug
A clear and concise description of what the bug is.
I installed the Reloadium plugin version 0.8.8, then tried to debug my code, and I got an error:
It seems like your platform or Python version are not supported yet.
Windows, Linux, macOS and Python >= 3.7 (3.9 for M1) are currently supported.

To Reproduce
Steps to reproduce the behavior:

  1. Installed lates plugin (0.8.8) from this URL:
    https://plugins.jetbrains.com/plugin/18509-reloadium--hot-reloading--profiling-for-python/versions
    (File > Settings > Plugins - clicked the cogwheel icon and chose Install plugin from disk, installed from downloaded zip file)
  2. Run or debug code with the orange icons
  3. See error

Expected behavior
Debug without error

Screenshots
NA

Desktop (please complete the following information):

  • OS: Windows 10 Pro 64 bit (running on a VM on Hyper-V)
  • OS version: 10.0.19044.2251
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: PyCharm 2022.02.03
  • Run mode: Either Run or Debug

Additional context
I didn't understand, do we need to install both the Reloadium package and the Reloadium plugin for PyCharm too?
I thought I would just install the plugin and it would work. But I have installed the package too via pip, using this command below, and it's still not working:
pip install reloadium

[Feature Request] Pop an extra frame

It will be useful if there was a way to pop additional frames after reloading, for example when changing the current function's signature, or when a break-point is inside a loop.
And sense you already implemented frame restart, maybe add it as a button so when debugging we could trigger it without adding "pass" to the start of the function.

No files are watched.

Describe the bug
When I try to debug the python file, I get an error and can not hot reload the file. It tells me that I do not watch this file. The details could be found in the picture.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: [Windows]
  • OS version: [22]
  • Reloadium package version: [0.8.8]
  • PyCharm plugin version: [ 0.8.2 ]
  • Editor: [PyCharm]
  • Run mode: [Debug]

Additional context
Add any other context about the problem here.

PYENV not recognized as current Python Version

Describe the bug
I have the PyCharm interpreter pointing to /pyenv/versions/3.10.6/bin/python3.10, but when I try to run Reloadium it tells me that my version of Python is not yet supported:

/Users/mikrubin/.pyenv/versions/3.10.6/bin/python3.10 -m reloadium pydev_proxy /Applications/Tools/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py --multiprocess --save-signatures --qt-support=auto --client 127.0.0.1 --port 52169 --file /Users/mikrubin/My Drive/Python/MapTasker.py
It seems like your platform or Python version are not supported yet.
Windows, Linux, macOS and Python >= 3.7 (3.9 for M1) are currently supported.
Please submit a github issue if you believe Reloadium should be working on your system at

To Reproduce
Steps to reproduce the behavior:

  1. Use Pyenv to manage Python 3.10
  2. Bring up Pycharm and point its interpreter to the above.
  3. Run reloadium plugin
  4. See error

Expected behavior
Normal reloadium debugging.

Screenshots
See above, under '... is not yet supported:'

Desktop (please complete the following information):

  • OS: OS X
  • OS version: 12.6
  • Reloadium package version: None
  • PyCharm plugin version: 0.8.5
  • Editor: PyCharm
  • Run mode: Debug via Reloadium

Additional context
Add any other context about the problem here.

not reloading on `input()`

Describe the bug
Using a simple script that accepts user input via input() in a loop, the code changes are not reloaded as would be expected.

To Reproduce

  1. write a script with:
s = ''
while s != 'exit':
    s = input('> ')
    print(f'you entered: {s}')
  1. run script with reloadium
  2. enter some text on input, e.g. "hi" which will produce the expected output "you entered: hi"
  3. change line 4 in the script to print(f'USER entered: {s}')
  4. enter some text on input, e.g. "hi"

Expected behavior

The code should be reloaded during execution and the output should be "USER entered: hi". Instead, the output is still "you entered: hi". Subsequent inputs produce the same output (i.e. no change is applied). See this log:

/usr/bin/python3.10 -m reloadium run <CENSORED>/reloadiumtest/reloadiumtest.py
■■■■■■■■■■■■■■■
Reloadium 0.9.0
■■■■■■■■■■■■■■■
If you like this project consider becoming a sponsor or giving a star at https://github.com/reloadware/reloadium
> 
Loaded 1 watched modules so far from paths:
 -  <CENSORED>/reloadiumtest/**/*.py

hi
you entered: hi
> Update Module: __main__

hi again
you entered: hi again

Desktop (please complete the following information):

  • OS: Linux
  • OS version: Ubuntu 22.04
  • Reloadium package version: 0.9.0
  • PyCharm plugin version: 0.8.3
  • Editor: PyCharm
  • Run mode: Run

Additional context

Also tried to disable reloadium cache, but problem remains.

Cannot get `RELOADIUMPATH` to be picked up by PyCharm

Describe the bug
I am trying to set up RELOADIUMPATH env variable in Pycharm, but consistently am getting the "No files are watched."

Tried:

  • adding it in Run/Debug Configuration
  • adding it in Preferences -> Build, Execution, Deployment -> Console -> Python Console and editing Run/Debug Configuration to Run with Python Console
    • confirmed with os.environ in Python Console window that the variable is set up as expected

I would suggest that you improve the error message's verbosity to actually inform whether RELOADIUMPATH was set and if so, to which value. Right now it's hard to tell where to look for the cause.

Expected behavior
RELOADIUMPATH set in Run/Debug Configuration should be picked up.
Error message should be more verbose.

Desktop (please complete the following information):

  • OS: macOS
  • OS version: 12.6
  • Reloadium package version: 0.9.3
  • PyCharm plugin version: 0.8.6
  • Editor: PyCharm
  • Run mode: Run/Debug

Actual console log output:

Loaded 0 watched modules so far from paths:
 - /Users/cromo/Documents/Sourcecode/woob/venv/bin/**/*.py

No files are watched.
Editing files will have no effect!
Only files inside current working directory or directories specified in RELOADIUMPATH environmental variable are watched.

Reload is not triggered when switching Git branches

In the new version of Reloadium/PyCharm (fixed 0.9.3 with a "reload file" button), reloads are not triggered on

  1. External changes to files (editing the file in an editor outside of PyCharm and saving it): PyCharm picks up the changes, but Reloadium is not triggered until the "reload file" button is pressed.
    2. Any Git operations (stashing/unstashing, switching branches, etc.).

Now 1. is not a big deal, since I don't edit files outside of PyCharm while developing with PyCharm. However, 2. is a problem, since my major use case for Reloadium was making a bunch of cosmetic changes in the program and switching between a version with them and without them while it's running. And I think this used to work before.

The workaround of going to every changed file and clicking "reload file" is not only inconvenient, but I think it may even be incorrect since you would leave the program in an invalid state, as some of the changes are dependent on one another.

My suggestion would either be to detect Git operations within PyCharm itself (such as switching a branch) and reloading all changed files, or have a button which checks for changes in all tracked files and reloads them together if it finds changes. In other words, "reload all changed files" button instead of a "reload file" button.

To Reproduce
Steps to reproduce the behavior:
Switch Git branches within PyCharm while the program is running with Reloadium. No reload is triggered. Going to individual changed files and pressing the "reload file" button does trigger reloads.

Expected behavior
All changes from the new branch should be loaded in a single batch, so as to maintain consistent code state.

Desktop (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Reloadium package version: 0.9.3 with fix for previous issues
  • PyCharm plugin version: 0.8.6 with fix
  • Editor: PyCharm
  • Run mode: Run and Debug

PYTHONPATH didn't take into account by the plugin

I have in my PYTHONPATH a folder containing several lib that I use in different python project.
When I run my script without Reloadium every thing is fine.
But with Reloadium I have :

Traceback (most recent call last):
File "C:\Users\stamza\PyCharmProjectLocal\Support\Ioda-MedEco\Ioda_test.py", line 1, in
import ioda
ModuleNotFoundError: No module named 'ioda'

Pycharm plugin 0.9.4 not supported for Python 3.10.6

Describe the bug
I'm getting the It seems like your platform or Python version are not supported yet. message when running the PyCharm plugin.

To Reproduce
Steps to reproduce the behavior:

  1. Click on the run or debug buttons.
  2. See error

Expected behavior
Run.

Screenshots
NA

Desktop (please complete the following information):

  • OS: MacOS
  • OS version: 11.5.2 (20G95)
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: 0.8.8
  • Editor: PyCharm 2022.2.3 (Professional Edition) Build #PY-222.4345.23
  • Run mode: Either Run or Debug

Additional context
Running from the command line seems fine.

[Feature Request] Enable changing breakpoints during debugging

Describe the bug

Reloadium is not sensitive to runtime changes to breakpoints.

To Reproduce

Steps to reproduce the behavior:

  1. Set breakpoints
  2. Run debug with reloadium
  3. Add/remove breakpoints
  4. Reloadium insensitive to breakpoint changes

Expected behavior

Reloadium should respond to runtime breakpoint changes

Desktop (please complete the following information):

  • OS: macOS
  • OS version: 12.5
  • Reloadium package version: 0.9.4
  • PyCharm plugin version: None
  • Editor: PyCharm CE
  • Run mode: Debug

Additional context

If every execution frame is hooked by reloadium, we can decide whether to reload or not with latest breakpoints.

PyCharm plugin build fails

I'm trying to build the plugin myself from the main branch on a MacBook Pro M1, but it fails.

First I need to remove some misplaced changelog text from pycharm/src/main/java/rw/profile/ProfileResultToggle.java.

After that, I get this message:

❯ gradle buildPlugin

> Task :compileJava FAILED
/Users/dagh/programs/reloadium/pycharm/src/main/java/rw/handler/sdk/BaseSdkHandler.java:6: error: cannot find symbol
import rw.consts.Const;
                ^
  symbol:   class Const
  location: package rw.consts

  [same error is repeated for a bunch of locations]

Originally posted by @daghoidahl in #3 (comment)

Limit files watched

Is there anyway to limit what is watched? It's watching even the .git directory.

Segmentation fault for python 3.7.3?

I know it's a long stretch since it is so old, but if python 3.7.3 loads the cpython it simply gives up:
image

Not sure if there is an easy fix for this? 3.7.9 seems to work, but sadly enough I can't upgrade to it easily.

I also straced the fault (not sure if helpful):
image

Incompatibility with pydash library

pydash is a library to facilitate the work with data structures.

Reloadium library craches when importing pydash module.

This code: import pydash

raises this error when running or debugging:

Traceback (most recent call last):
  File "C:\Users\ludovic.marce\Documents\Lancaster\auto\bacasable\nested_dicts.py", line 5, in <module>
    import pydash
  File "C:\Users\ludovic.marce\Documents\Lancaster\auto\bacasable\venv\lib\site-packages\pydash\__init__.py", line 5, in <module>
    from .arrays import (
  File "C:\Users\ludovic.marce\Documents\Lancaster\auto\bacasable\venv\lib\site-packages\pydash\arrays.py", line 13, in <module>
    from .helpers import base_get, iteriteratee, parse_iteratee
  File "C:\Users\ludovic.marce\Documents\Lancaster\auto\bacasable\venv\lib\site-packages\pydash\helpers.py", line 21, in <module>
    BUILTINS = {value: key for key, value in builtins.__dict__.items() if isinstance(value, Hashable)}
  File "C:\Users\ludovic.marce\Documents\Lancaster\auto\bacasable\venv\lib\site-packages\pydash\helpers.py", line 21, in <dictcomp>
    BUILTINS = {value: key for key, value in builtins.__dict__.items() if isinstance(value, Hashable)}
  File "<string>", line 2, in __hash__
TypeError: unhashable type: 'lll11ll111111lllIl1l1'

Versions:

Python:3.6 & 3.9
Pycharm: 2022.1
reloadium plugin: 0.8.0
pydash: 5.1.0

Mac 13 M1 and reloadium 9.0 installs x64 version

file ~/.reloadium/package/3.10/reloadium/corium.cpython-310-darwin.so
~/.reloadium/package/3.10/reloadium/corium.cpython-310-darwin.so: Mach-O 64-bit dynamically linked shared library x86_64
file ~/Downloads/reloadium4/lib/reloadium-0.9.0/META-INF/wheels/reloadium-0.9.5-cp310-cp310-macosx_12_0_arm64/reloadium/corium.cpython-310-darwin.so
~/Downloads/reloadium4/lib/reloadium-0.9.0/META-INF/wheels/reloadium-0.9.5-cp310-cp310-macosx_12_0_arm64/reloadium/corium.cpython-310-darwin.so: Mach-O 64-bit dynamically linked shared library arm64

I tried to manually install with
pip install ~/Downloads/reloadium/lib/reloadium-0.9.0/META-INF/wheels/reloadium-0.9.5-cp310-cp310-macosx_12_0_arm64.whl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.