-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Allow for reloading of python code changes in a repl or development session #9462
Comments
Thanks for opening this, @rmangi. We're actively working on speeding up the performance of Right now, the biggest issue is that a change to your source file will mean that we re-resolve all your 3rd party requirements, even though that's not necessary. This is our first priority to fix. As mentioned on Slack, it's possible to have this auto-reload mechanism via the option |
Hi @rmangi, update that we made the first major performance enhancement in 1.27.0rc0 for the V2 implementation of We don't have hot reloading working quite yet. If you make a change, you'll still need to close out of the REPL and restart it with We do plan to put some time into getting hot reloading working properly. It's not an immediate priority, but it's something we're thinking about. -- Let us know either on this issue or on Slack if you run into any issues with this! I don't recall if you were using the V2 implementation of REPL before? If not, we'd love to help you get that set up. |
Geraet, we're using the v2 repl. We'll upgrade and see how it goes. |
Hey Eric, we're actually not using the v2 repl yet, we'll get that going. I'm not on the pants slack but the rest of my team is and they say I should be too so I'll get on that. Thanks! |
We'd love to have you join Slack! See https://pants.readme.io/docs/getting-help-1 for instructions on how to join. |
This also applies to Django runserver, and possibly also to jupyter. cc @benjyw
It's also possible that this is a user-by-user decision, rather than being goal/tool specific, such that we would have |
👍 Just ran into this testing out pantsv2. Our use case is as follows: Developers want to run a local django server locally with pants run command which ultimatley calls django's runserver command. They want to make code changes and have the server restart automatically on detected code changes. |
That is likely an extremely common use-case, and one we should definitely be able to support. |
Sketching this out a bit, my thinking is that it is completely fine to interrupt a That leaves only the problem of determining whether individual pex_binary(
..,
interruptible=True,
) ...to indicate that it is safe to interrupt the process. This would be propagated into a flag on Usecases like Thoughts? |
I think that sounds right. So the |
…d lift `SideEffecting` to an abstract class (#13199) To prepare to support restarting `Graph` `Node`s up until they have had a side-effect (for #9462), this change: * Splits the `Node::restartable` property out from `Node::cacheable`, to allow for dynamically indicating whether a `Node` can be restarted. * Renames `engine::core` to `engine::python`, both for clarity, and to avoid collisions in poorly behaved macros like `derivative`. * Converts `SideEffecting` into an abstract class to help track when side-effects have been triggered.
…change (#13178) Adds `pex_binary(.., restartable=True)` and `repl --restartable` to optionally allow user processes to be restarted when files change. See `run_integration_test.py` for an example. `InteractiveProcess` is used for any process that needs to run in the foreground, including those for `run`, and `repl`. To support restarting those processes, we make invoking an `InteractiveProcess` async, which allows it to (optionally) be restarted when files change. To make `InteractiveProcess` async, we convert it into a rust-side `Intrinsic`, and introduce a new `Effect` awaitable type, which is used in place of `Get` when a type is `SideEffecting`. This also prepares the other `SideEffecting` param types to be converted to `Effect`s as well (in order to accomplish #10542). Fixes #9462.
One of the frequent complaints we get from developers in our pants environment is how long it takes to reload a repl or restart a service they're working on due to the chroot creation overhead. In a non-pants world we could use
imp
or ipythonautoreload
in a repl and the restart time for an api-server outside of pants is usually negligible. The feedback loop time is challenging.Would it be possible to sync local code changes or even symlink to it from the chroot to enable something like this?
If this is actually something that's possible today and we're not aware of it that would be great too :)
Thanks!
The text was updated successfully, but these errors were encountered: