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

Question on intended refactoring and code quality improvements: minimum supported python version? #1631

Open
Up50qyx opened this issue Jan 29, 2024 · 1 comment

Comments

@Up50qyx
Copy link

Up50qyx commented Jan 29, 2024

TLDR: interested contributor, want to implement improvements, but have some Qs first

Hello!

First of all, big thank you to the maintainers and core devs of this project. I came across bleachbit a few weeks ago, and it immediately caught my interest. When I looked into it and saw that not only was it a programmable and secure way to clean up files but also that this was THE infamous software which hillary clinton used to delete her emails... you already know I immediately started reading the source code to see if/how I could contribute to the project.

After reading the codebase, I found several ways that I can help out (listed below). The proposed changes are intended to simplify the build process, make the code easier to work with/maintain/develop, reduce overall codebase size, catch more bugs during static analysis, and potentially speed up the app. I've been able to implement similar changes on legacy codebases before, and I hope to show that it will be worth it. At a high level, the improvements are aimed towards....

  1. Fixing the structure of the package to reduce the need to do imports inside of function calls (I assume those are currently there to fix circular import errors).
  2. Adding PEP 484-style type hints to give editor suggestions for tab-complete and allow tools like mypy or pyright to catch bugs during static analysis.
  3. Adding a dependency management system: even something simple like python -m venv in combination with a requirements.txt file will simplify the setup of the dev and testing environments. A more reliable and sturdy solution would be to either implement a PEP 517-style build system with something like meson as the actual build backend or to add conda to the repo which can manage both python and non-python dependencies (aka gtk in this case). This will eventually remove the need for the fragile build scripts made specifically for this project and just allow bleachbit to use well-specced standards.
  4. Removing deprecated code, fixing excessively nested/awkward conditionals, using comprehension over for-loops where possible, switching to use of generators (functions with yield) over for loops where possible, and other optimizations.
  5. IF all of the above 4 are done, I speculate that a reliable and most importantly maintainable MacOS build with GUI is possible. I know that it has been a requested feature for a long time, judging by the website and some of the other issues.

To clarify, I am ready and able to start submitting pull requests to gradually merge the proposed changes (gotta implement them first). I understand how important maintaining high coverage % and minimizing regressions is to a project like this, so I indend to make my PRs small and do this in small segments over time. I have also already read the docs and contribution guide. However, I have a couple clarifying questions to the current maintainers:

  1. What is the targeted minimum version for python support? Currently, the earliest version that is not officially end-of-life is 3.8. However, in this repo I see some code suitable for versions which are much older. The features I suggested above would work for 3.6 and up.
  2. What are the near term milestones and existing plans (if any) for development and new features? I want to work with you around your existing goals as much as possible and not cause confusion.

Thank you for taking the time to read through this! And again thank you for your work in maintaining this project.

@rados
Copy link
Contributor

rados commented Feb 5, 2024

@Up50qyx Hey, great thanks! I am Rado, my role here is just supportive. In my humble opinion it would be excellent if we could increase the test coverage and then we will be more confident to refactor...

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

No branches or pull requests

2 participants