-
Notifications
You must be signed in to change notification settings - Fork 499
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
Migrate to use Buildop's rmtree, file_copy, file_copytree and rename #1669
Conversation
This is part of a bigger refactor to reduce the size and complexity of the Buildozer class. It adds no new functionality (apart from making logging more consistent) * Remove file_rename, file_copy and file_copytree from Buildozer. * Update all references to those Buildozer methods to refer to buildops equivalents. * Note: `file_rename` is now called rename as, in practice, it was also used to rename directories. * Updated all references to shutil.copyfile and shutil.rmtree to use the Buildops equivalents * Note this adds implicit debug logging, making them more consistent. * Updated all references to check_call() and check_output() that called the `rm` and `cp` shell commands. * Note this adds implicit debug logging, making them more consistent, and improves performance. * Updated mock in test. Cheekily, also removed some obsolete references to Python 2 (only) standard libraries to make my IDE stop warning me about them while I edited the file.
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.
From a quick check, I've found (and added a comment) one reference of file_rename
which needs to be migrated, can you take care of it?
@@ -476,23 +476,6 @@ def file_matches(self, patterns): | |||
def file_exists(self, *args): | |||
return exists(join(*args)) | |||
|
|||
def file_rename(self, source, target, cwd=None): |
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.
Seems we still have a reference to file_rename
here:
buildozer/buildozer/targets/ios.py
Line 313 in b1f0e61
self.buildozer.file_rename(ipa_tmp, ipa) |
bd23368
to
7938754
Compare
Good spot. I do remember seeing the log message directly above it ('Moving IPA to bin...' sounds like it is throwing away some beer) so I don't know how I missed this one. Fixed. [I also accidentally gave a sneak preview of the next PR by committing in the wrong branch. I've undone that too.] |
😂 |
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.
LGTM. Thank you!
…ivy#1669) * Migrate to use Buildop's rmtree, file_copy, file_copytree and rename This is part of a bigger refactor to reduce the size and complexity of the Buildozer class. It adds no new functionality (apart from making logging more consistent) * Remove file_rename, file_copy and file_copytree from Buildozer. * Update all references to those Buildozer methods to refer to buildops equivalents. * Note: `file_rename` is now called rename as, in practice, it was also used to rename directories. * Updated all references to shutil.copyfile and shutil.rmtree to use the Buildops equivalents * Note this adds implicit debug logging, making them more consistent. * Updated all references to check_call() and check_output() that called the `rm` and `cp` shell commands. * Note this adds implicit debug logging, making them more consistent, and improves performance. * Updated mock in test. Cheekily, also removed some obsolete references to Python 2 (only) standard libraries to make my IDE stop warning me about them while I edited the file. * Fixed missed file_rename reference in IOS
This is part of a bigger refactor to reduce the size and complexity of the Buildozer class. It adds no new functionality (apart from making logging more consistent)
file_rename
is now called rename as, in practice, it was also used to rename directories.rm
andcp
shell commands.Cheekily, also removed some obsolete references to Python 2 (only) standard libraries to make my IDE stop warning me about them while I edited the file.