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

run: Move libvcs to new SubprocessCommand, document + test overriding #340

Open
tony opened this issue May 1, 2022 · 0 comments · May be fixed by #341
Open

run: Move libvcs to new SubprocessCommand, document + test overriding #340

tony opened this issue May 1, 2022 · 0 comments · May be fixed by #341

Comments

@tony
Copy link
Member

tony commented May 1, 2022

requires #337

  • run() should convert to Popen params for compatibility with SubprocessCommand

  • run() should support legacy_params (existing) to deprecate safely

class CommandPopenMixin:
    _run_fn = Subprocess.Popen


class CommandRunMixin:
    _run_fn = Subprocess.run

class Command:
    _run_fn = SubprocessCommand




class Command:
    _run_fn = SubprocessCommand

This turns git command into a subprocess command factory:

class Git(Command):
   ...


git_factory = Git(url='...')
status_cmd = git_factory.status()
status_cmd.run()
status_cmd.Popen()

Subprocess.Popen
Subprocess.run
@tony tony added this to vcspull May 1, 2022
@tony tony self-assigned this May 1, 2022
@tony tony linked a pull request May 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant