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

Support pass-through args to the repl goal for ipython #19858

Merged
merged 9 commits into from
Sep 27, 2023

Conversation

gauthamnair
Copy link
Contributor

@gauthamnair gauthamnair commented Sep 18, 2023

Fixes #3423

As discussed in #3423 (comment) we are implementing args at the goal-level but with a caveat that it is only available for some shells. In this PR, we only enable it for ipython. The repl will error out otherwise.

@gauthamnair
Copy link
Contributor Author

Currently this work for an ipython shell, but does not work for a python shell. I am debugging why this might be.

@gauthamnair
Copy link
Contributor Author

Ok, the issue with supplying arguments to the python repl has to do with two separate apparent issues with, upon closer debugging.

  1. pex boot gets into an infinite loop when the pex has no entry point or script and is called with just an interpreter option, such as -q (this is easily fixable, will fix in pex, if it hasn't already been fixed in more recent versions).
  2. pex boot does not seem to support the -i python flag, used to run some code or script but then drop into a shell. The script executes and a shell appears later but it does not have available the names that should be available at the end of running the script.

It is quite likely one or both of these already has a reported issue in pex, need to dig for them.

@gauthamnair
Copy link
Contributor Author

@gauthamnair gauthamnair changed the title [WIP] Repl passthrough 3423 Repl passthrough 3423 Sep 22, 2023
@gauthamnair gauthamnair marked this pull request as ready for review September 22, 2023 16:00
@thejcannon
Copy link
Member

Mind editing the title to be a bit more clear as to whats changing? 😄

@gauthamnair gauthamnair changed the title Repl passthrough 3423 Support pass-through args to the repl goal for ipython Sep 22, 2023
@gauthamnair
Copy link
Contributor Author

@thejcannon Changed it. :)

Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Sorry for the long delayed review.

@stuhood stuhood enabled auto-merge (squash) September 27, 2023 03:47
@stuhood stuhood merged commit 3d84c12 into pantsbuild:main Sep 27, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for passthrough args to the python repl
5 participants