codewell / ml-workflow

Tools and reference implementation of ml-workflow
6 stars 0 forks source link

rope refactoring not able to run on a project when ml-workflow is a dependency #147

Open Jim-Holmstroem opened 4 years ago

Jim-Holmstroem commented 4 years ago

When running rope (default refactorer for vscode) to rename a symbol I get

Refactor failed. Syntax error in file <venv/src/master/template/{{cookiecutter.repository_name}}/{{cookiecutter.package_name}}/datastream/gradient_datastream.py> line <4>: invalid syntax
...
Jim-Holmstroem commented 4 years ago

easiest fix is probably just to not include the cookiecutter templates in the installation

samedii commented 4 years ago

What is your suggested solution? The template is a core functionality

Jim-Holmstroem commented 4 years ago

but does it have to be a part of the installation?

Jim-Holmstroem commented 4 years ago

having invalid python code in the source tree is kinda weird

Jim-Holmstroem commented 4 years ago

I guess the cookiecutter template isn't referenced anywhere in ml-workflow AST-wise?

samedii commented 4 years ago

I don't think it's part of the source. I think it's a resource. And yes, at the moment it's needed for "setup project" as is

Jim-Holmstroem commented 4 years ago

it exists under src together with the rest of the source for an installation

samedii commented 4 years ago

Maybe we are using resources incorrectly. It is currently placed under workflow at installation. I've seen it being placed under other names than the repo elsewhere. I suggest you try to rename workflow/template to workflow-template in setup.cfg and see if that helps

Jim-Holmstroem commented 4 years ago

my brain is starting to stop working, I'll have a look tomorrow not the world if rope doesn't work, just nice to have semantic refactoring and not relying on search replace :P

samedii commented 4 years ago

It would be nice if the refactoring worked inside the template too since it is using ml-workflow

Jim-Holmstroem commented 4 years ago

another possible solution is to separate ml-workflow and ml-workflow-template if nothing else then to separate the binary and the library