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

Migrate all usages of mkdir and rmdir to buildops #1668

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

Julian-O
Copy link
Contributor

This is a refactor as one step to reduce the size/complexity of the Buildozer class. It doesn't change functionality. except to improve logging consistency and a small performance improvement

  • mkdir() and rmdir() methods removed from buildozer/__init__.py (cleaner versions are already in buildops.py)
  • All references to buildozer's mkdir and rmdir changed over to use buildops.
  • Call to Linux's mkdir via a separate shell replaced with (faster, and platform independent) library call.
  • Re-ordered imports, where touched, to match PEP8.

This is a refactor as one step to reduce the size/complexity of the Buildozer class. It doesn't change functionality. except to improve logging consistency and a small performance improvement

* mkdir and rmdir removed from `buildozer/__init__.py`
* All references to buildozer's mkdir and rmdir changed over to use buildops.
* Call to Linux's mkdir via a separate shell replaced with (faster, and platform independent) library call.
* Re-ordered imports, where touched, to match PEP8.
@@ -361,22 +362,22 @@ def check_build_layout(self):
exit(1)

# create global dir
self.mkdir(self.global_buildozer_dir)
self.mkdir(self.global_cache_dir)
mkdir(self.global_buildozer_dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To help people understand that mkdir (and other methods) are from buildops, how about importing buildops and than using buildops.mkdir?

Yeah, is quite verbose, but IMHO, the readability (and the understandability) gets improved a lot.

What do you think about it?

@Julian-O
Copy link
Contributor Author

Julian-O commented Aug 24, 2023 via email

Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@misl6 misl6 merged commit b1f0e61 into kivy:master Aug 25, 2023
14 checks passed
aorizondo pushed a commit to aorizondo/buildozer that referenced this pull request Aug 28, 2023
* Migrate all usages of mkdir and rmdir to buildops

This is a refactor as one step to reduce the size/complexity of the Buildozer class. It doesn't change functionality. except to improve logging consistency and a small performance improvement

* mkdir and rmdir removed from `buildozer/__init__.py`
* All references to buildozer's mkdir and rmdir changed over to use buildops.
* Call to Linux's mkdir via a separate shell replaced with (faster, and platform independent) library call.
* Re-ordered imports, where touched, to match PEP8.

* Make buildops methods more explicit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants