Live data from Hacker News

Reloadr – Hot code reloading tool for Python

github.com

21–30 of 58 posts

Re: Reloadr – Hot code reloading tool for Python

#23
post #9

Having a hot reloaded set up for both my django (It's built in) environment and Web app environment is such a force multiplier. It's not about simply saving time doing it manually. It fundamentally changes my dev-test/experiment workflow. I love being able to tab to a server file, make a change, tab to a client file, make another change, and instantly test it in a browser.

Have you tried PHP? :) I jest, but really I feel like we've made things so complicated it just gets in our way. Our Javascript pipeline is huge, complicated, and requires you to sit down and wrap your head around it every time you want to modify it. If I get to greenfield another project, it's going to be so bloody simple.

> If I get to greenfield another project, it's going to be so bloody simple.

It's always simple when it starts up. It's after months/years of iterating without having a decent battle plan that it becomes complicated.

Re: Reloadr – Hot code reloading tool for Python

#24
post #9

Having a hot reloaded set up for both my django (It's built in) environment and Web app environment is such a force multiplier. It's not about simply saving time doing it manually. It fundamentally changes my dev-test/experiment workflow. I love being able to tab to a server file, make a change, tab to a client file, make another change, and instantly test it in a browser.

Have you tried PHP? :) I jest, but really I feel like we've made things so complicated it just gets in our way. Our Javascript pipeline is huge, complicated, and requires you to sit down and wrap your head around it every time you want to modify it. If I get to greenfield another project, it's going to be so bloody simple.

PHP has to bootstrap everything on every single request. It is definitely great for reloadability and local development but terrible for production performance. Most teams that do not need PHP or love it (Laravel is great I know) have moved to using languages and frameworks that provide a long running application server.

Re: Reloadr – Hot code reloading tool for Python

#25
For reloading from within the repl

    from importlib import reload as r
Then in the ipython shell you can type r(module) to reload the entire thing.

So I'll often have the editor in one terminal window, and ipython in the other one, save the code and switch back the repl, and type r(t)

    import mymodule as t
Now tie in some ipdb [1] and you have a pretty sweet setup. Also depending on your serving framework it might also have hot reloading as well, tornado, flask, etc.

[1] https://github.com/gotcha/ipdb

[2] https://www.tornadoweb.org/en/stable/autoreload.html https://werkzeug.palletsprojects.com/en/0.14.x/serving/

Re: Reloadr – Hot code reloading tool for Python

#28
post #3

What are some simple use cases for this?

I imagine it can be very useful if you want to debug and fix a problem in a contained area of the code where it can take a significant effort to get the program in a state which can trigger the bug, but once in that state it's easy to trigger repeatedly.

Say you have to load a lot of data, but once loaded you can trigger the issue by just hitting a button.

With hot code reloading you could incrementally add debugging code and try your fix, without having to restart the program and wait for the data to reload each time.

Re: Reloadr – Hot code reloading tool for Python

#29
That's a bit awkward, I'm currently working on a package[1] that does more or less the same thing in more or less the same way (I think), except you don't need to decorate anything. Just run `python -m jurigged script.py` or `jurigged script.py` instead of `python script.py` and it will watch everything in the current working directory.

There's still some bugs I have to iron out, though, it should be better in a month or so. Still, you can pip install it if you want.

[1] https://github.com/breuleux/jurigged

Re: Reloadr – Hot code reloading tool for Python

#30
post #27

Last commit in Jan 2020. Is this project still active? Also ideally, not needing to decorate would be nice.

For what it's worth, I'm working on my own reloader which does not require decorating anything: https://github.com/breuleux/jurigged (still a WIP, but it works well enough).
Post reply on HN