Each release should contain appropriate git tagging and versioning.
CI/CD will be setup and triggered by pushes to {repo}/debian/changelog.
So, this meaning you should have some hope that your hotfix or feature works as intended. It would be a good idea to format, lint, and test the code at this stage.
Thus, don't push changes to the changelog until you are ready to deploy.
In general:
- Clone repo
- Create virtualenv
- Install wheel and setuptools in virtualenv
- Install package into virtualenv with extras
git clone git@github.com:WLAN-Pi/wlanpi-app.git
cd wlanpi-app
python3 -m venv venv && source venv/bin/activate
pip install -U pip wheel setuptools
# normal users who do not need to run or create tests
pip install .
# developers install test depends like so
pip install .[testing]Create a changelog entry for a new release: dch -i
Describe what you changed, fixed, or enhanced.
If you were to do this initially, and create the changelog file, you can create it by browsing to the root of the repository, and running debchange --create. This will be already done by the time you read this.
See the DCH page for further reading.
Each release requires versions to be updated in two locations:
-
debian changelog:
{repo}/debian/changelogviadebchange -
python package:
{repo}/wlanpi_app/__version__.pyvia manual update.
Please note that Python package versioning should follow PEP 440. https://www.python.org/dev/peps/pep-0440/
Please note that the Debian package versioning does not strictly align with Python versioning.
- Debian generally follows
<DebianPackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb. Package format also matters. Quilt vs native have differences. Native does not allow revision numbers (1.0.0instead of1.0.0-1). More on quilt vs native here.
Before committing, please lint, format, and test your code. Remove trailing whitespace. Remove whitespace from blank lines. In other words, make your code neat and conform to the style of the repository you're proposing changes to.
You can in general install tox and then you will be able to run tox -e format and tox -e lint to format and lint respectively. Tox should automatically handle creating the virtual environments and dependencies to run tests and format/lint code.
Here are some of the Python tools used:
- autoflake
- black
- flake8
- isort
- mypy
However, we are moving to ruff to replace the functionality of these tools with one tool. One tool to rule them all?
You can in general install tox, and then you will be able to run tox to run tests.
From the root directory of this repository run:
dpkg-buildpackage -us -uc -bIterate until you get files in ../ for the target application.
See PACKAGING.md for further reading.