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

Refactoring: make subproc_captured_* methods private and provide xonsh API instead #5383

Open
anki-code opened this issue May 2, 2024 · 0 comments

Comments

@anki-code
Copy link
Member

anki-code commented May 2, 2024

I noticed that another projects (e.g. conda, xontrib-prompt-bar) are using xonsh.built_ins.subproc_captured_* methods to run commands using xonsh. But behavior of this methods is strongly related to parser (i.e. substitutions), environment (i.e. $XONSH_SUBPROC_OUTPUT_FORMAT) and CommandPipeline (i.e. a bunch of settings) and these methods were originally used in parser. If we change environment or parser we can break other projects (mostly integrations and xontribs) downstream code.

This is why we need to separate subproc_captured_* into:

  • the functions that are used in between of parser and CommandPipeline.
  • the functions that are atomic public xonsh API to run commands and get output

For example subproc_captured_stdout now can return str or list (#5377) because we need this behavior in parser as well as in CommandPipeline but it's uncomfortable behavior for xonsh API users who expect to have str forever.

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant