Migrate python code under `fuzzbench` python package directory in the repo
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
We should follow the python convention of having a main "python package directory" in the repo, i.e., have a `/fuzzbench` directory that contains our python codebase. We recently created this directory and we can incrementally migrate python code under it. This practice has the following benefits:
- Currently the repository directory (``) itself serves as the top level python package, however not all directories in the repo belong to the "fuzzbench" python package (e.g., docs, benchmarks, docker, third_party, etc). Moving the python codebase under `/fuzzbench` will give a better separation.
- Python imports will be more clear: `fuzzbench` modules should import other modules using `from fuzzbench.common import xyz` -- so we don't introduce a top level package called say `common` in the global namespace of packages.
- It solves issues with pylint (e.g., #555): we will be able to just run `pylint fuzzbench` to lint our python codebase. Currently this is more difficult (https://github.com/google/fuzzbench/pull/566).
- No need to copy the python codebase directory by directory into docker images (https://github.com/google/fuzzbench/blob/master/docker/fuzzbench/Dockerfile#L28-L35)
See guidelines recommending this practice:
https://packaging.python.org/tutorials/packaging-projects/
https://realpython.com/python-application-layouts/
https://docs.python-guide.org/writing/structure/
https://docs.pytest.org/en/latest/goodpractices.html
https://stackoverflow.com/questions/193161/what-is-the-best-project-structure-for-a-python-application
Contributor guide
Assessment
This issue has not been assessed yet.