Skip to content

stage: create method is doing too much #2417

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

Closed
ghost opened this issue Aug 20, 2019 · 0 comments
Closed

stage: create method is doing too much #2417

ghost opened this issue Aug 20, 2019 · 0 comments
Labels
p3-nice-to-have It should be done this or next sprint refactoring Factoring and re-factoring

Comments

@ghost
Copy link

ghost commented Aug 20, 2019

It might be reasonable to refactor this:

Who is using Stage.__init__?

  • dvc/stage.py:load
  • dvc/repo/move.py

Who is using Stage.create?

  • dvc/repo/imp_url.py
  • dvc/repo/add.py
  • dvc/repo/run.py

Steps:

  • Move out destructive operations to a separate method
    • ignore_build_cache
    • overwrite / confirm removal
  • Move initialization options to __init__
    • _fill_stage_outputs if outputs are a list of strings/paths
    • dependency.loads_from
    • Default fname
  • Move cwd/fname check to __init__
@efiop efiop added refactoring Factoring and re-factoring p3-nice-to-have It should be done this or next sprint labels Aug 20, 2019
@efiop efiop closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-nice-to-have It should be done this or next sprint refactoring Factoring and re-factoring
Projects
None yet
Development

No branches or pull requests

1 participant