Cross-project setup and build tools that guarantee code/process consistency and quality.
Installation and usage will vary based on the external project goal. The tools in this repository are designed to be used as either:
- Starter templates to be copied into a project.
- Pulled on-demand by the template once placed into a project.
Either way, the tools will typically not be used directly from a full clone of this project. Example use case:
- Copy the Python starter Makefile template from this project into a new project.
- Update the placeholders.
- Commit the completed template for future use.
- Use recipes, such as
make setupandmake wheelto configure the Python project and build a Python wheel.
- Copy the python-starter.mk template to
Makefilein a new project. - Update the placeholders at the top of the file.
UPSTREAMis required, and must be the project's upstream git repository path.PYLINT_EXTRASis optional, and can be used to add additional file(s)/folder(s) to the lint jobs.
- Run
make setupto set up the project and clone the Python common recipes for future use. - Optional: Follow Use Python Common Recipes as needed.
The process is performed automatically by the Python project starter Makefile. To use the file manually:
- Copy the python.mk to
python.mkin an existing project. - Add
-include python.mkto the top of the primaryMakefilein the project. - Follow Use Python Common Recipes as needed.
- Run
make <recipe>to perform a specific Python-based process. Example:make test.
The Python common Makefile contains the following recipes:
venv- Create a Python virtual environment for development/testing.clean-venv- Remove the Python virtual environment.format- Check source code format for consistent patterns.lint- Check for common lint/complexity/style issues.typing- Check typehints for static typing best practices.security- Check for common security issues/best practices.qa- Check full code quality suite (minus unit tests) against source.test- Run basic unit tests.wheel- Package the library into a pip installable.release- Package the library into a pip installable.clean- Remove the packages from previous builds.
The process is performed automatically by the make release shared python recipe.
To use the file manually:
- Copy the build_python_release.sh to
build_python_release.shin an existing project. - Run
build_python_release.sh. - Follow the steps printed to upload.
Refer to the Contributing Guide for information on how to contribute to this project.