-
Notifications
You must be signed in to change notification settings - Fork 44
Added rename project option #1013
Conversation
Replaced all uses of os.path with Pathlib in gmrecords.py Replaced all uses of os.path with Pathlib in projects.py Updated the changelog to reflect these changes
@smithj382 have you been able to make any sense of the path errors for Windows? I was looking over the azure logs and trying to figure out what's up. It seems like a relative path issue still |
@@ -140,8 +143,7 @@ def main(self, gmrecords): | |||
if not prompt.query_yes_no(question, default="yes"): | |||
sys.exit(0) | |||
|
|||
shutil.rmtree(conf_path, ignore_errors=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emthompson-usgs are things at data_path no longer being removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose not. Perhaps we need to fix that, but I think it is a separate issue. I'm note sure the "delete" argument ever gets used by anyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gferragu I modified the shutil to delete the parent of config_path so that it would also delete the project folder. See ) I don't know if this is the right approach (probably not) so if the alternative way of deleting the config_path and data_path folders separately is preferred I can change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no guarantee that the the data and conf directories share a common parent directory (although that is the default), which is why it done separately before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emthompson-usgs OK I didn't think about this because I am using the default. I can revert it back, but I think I'll wait until the Windows relative_path issue is resolved.
@gferragu I tried to revert to not using relative_to for the Windows platform (as the build that passed Azure was doing), but it seems like the test used relative_to for Windows despite the |
Yes, the purpose of the if-statement was to not use relative paths on Windows and it had fixed things before. I think that the reason for the errors may be unrelated to this, but it is difficult to test/debug without a Windows system to run it on. |
@smithj382 Yeah that seems weird, it's definitely still running the relative_to bit despite running on Windows |
These edits were included in #1016 in which I fixed the Windows issue. |
Added a rename projection option to the gmrecords proj subcommand.
Replaced all uses of os.path with Pathlib in gmrecords.py
Replaced all uses of os.path with Pathlib in projects.py
Updated the changelog to reflect these changes