The basics towards better software with Python by means of development best practices. A work in progress with a continuous improvement mindset.
There are some basic system-wide prerequisites such as curl, git,
python (dev, pip, venv). Finally, uv is installed to assure
a proper project and Python environment management.
NOTICE: Using UNIX shell commands in a Debian GNU/Linux Bash shell. Adapt accordingly your Operating System.
TODO
https://github.com/nunoachenriques/basics-qa-python
In order to facilitate pull requests if you want to contribute then go to https://github.com/nunoachenriques/basics-qa-python and hit fork!
NOTICE: Make sure you've completed the Prerequisites for your operating system case!
SHORTCUT: If you've completed the Prerequisites AND NOT interested in the details then you may skip this step-by-step guide and jump to the next section Wrap-up.
Quality Assurance Step by Step
All the prerequisites must be accomplished (by following the above instructions or by means of a previous project installation). The project files for quality assurance must be in place by one of two options:
-
Contributing to the Basics QA Python project.
First, a fork of the remote. Second, the clone in your own repository:
git clone git@github.com:{YOUR_OWN_USER}/basics-qa-python.gitcd basics-qa-python uv sync --dev uv run pre-commit install -t pre-commit uv run pre-commit install -t pre-pushThird, carry on coding, committing, and issuing pull requests to the main project.
-
Developing a new project using this quality assurance.
First, use the template in the remote or unzip a download from Basics QA Python GitHub. Second, choose your own project name:
mv basics-qa-python YOUR-OWN-PROJECT-NAME cd YOUR-OWN-PROJECT-NAME uv sync --dev git init uv run pre-commit install -t pre-commit uv run pre-commit install -t pre-pushThird, custom everything you see fit (NOTICE: change basics-qa-python references and URL to your owns) then code, commit, and push to a remote if you've added your local Git-based repository to a newly created project with an
<URL>provided by a remote (e.g., GitLab).git remote add origin <URL>
How to test the .pre-commit-config.yaml calls and also the configuration in
pyproject.toml:
uv run pre-commit run --all-files --hook-stage pre-commit
uv run pre-commit run --all-files --hook-stage pre-pushA command-line interface is available and ready to run the application:
uv run python app_cli.pyIt started in 2022 with an urge to compile some basics of quality assurance for application development in Python. The motivation was and is to simplify, automate, and guarantee a proper normalised and more secure code.
By me Nuno A. C. Henriques and by Alexandre Almeida's precious contributions in code and vivid discussions!
Copyright 2022 Nuno A. C. Henriques https://nunoachenriques.net
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.