Table of contents
The apache-airflow-mypy package provides Mypy plugins for Apache Airflow to enhance type checking capabilities. It includes plugins for typed decorators and operator output type handling.
The Release Manager prepares apache-airflow-mypy packages separately from the main Airflow Release, using breeze commands and accompanying scripts. This document provides an overview of the command line tools needed to prepare the packages.
You can release apache-airflow-mypy distributions separately from the main Airflow on an ad-hoc basis, whenever we find that the mypy plugins need to be released - due to new features, bug fixes, or improvements to type checking support.
We are using the SEMVER versioning scheme for the apache-airflow-mypy distributions. This is to give users confidence about maintaining backwards compatibility in new releases.
Before releasing, update the RELEASE_NOTES.rst file with the changes since the last release. You can use towncrier to generate release notes from newsfragments:
cd dev/mypy towncrier build --version <VERSION>
To preview the release notes without writing to the file:
towncrier build --version <VERSION> --draft
Review and edit the generated release notes as needed.
The Release Manager can use the breeze tool to build the package:
breeze release-management prepare-mypy-distributions \ --distribution-format both \ --version-suffix rc1
Follow the same signing process as other Airflow packages:
cd dist for file in *.tar.gz *.whl; do gpg --armor --detach-sign $file sha512sum $file > $file.sha512 done
Tag the release candidate in git:
git tag -s apache-airflow-mypy-<VERSION>rc<RC> -m "Apache Airflow Mypy <VERSION>rc<RC>" git push origin apache-airflow-mypy-<VERSION>rc<RC>
Follow the standard Apache release process for committing to the SVN repository.
Release candidates should be published to TestPyPI first:
twine upload --repository testpypi dist/apache_airflow_mypy-<VERSION>rc<RC>*
Send a voting email to dev@airflow.apache.org with the following template:
Subject: [VOTE] Release Apache Airflow Mypy <VERSION> based on <VERSION>rc<RC> Hello Apache Airflow Community, This is a call for the vote to release Apache Airflow Mypy version <VERSION>. The release candidate is available at: https://dist.apache.org/repos/dist/dev/airflow/apache-airflow-mypy-<VERSION>rc<RC>/ The packages are available at TestPyPI: https://test.pypi.org/project/apache-airflow-mypy/<VERSION>rc<RC>/ The vote will be open for at least 72 hours. [ ] +1 Approve the release [ ] +0 No opinion [ ] -1 Do not release (please provide specific comments) Only PMC votes are binding, but everyone is welcome to check and vote. Best regards, <YOUR NAME>
Verify the release by:
Installing from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ apache-airflow-mypy==<VERSION>rc<RC>
Testing the plugins in a mypy configuration:
[mypy] plugins = airflow_mypy.plugins.decorators, airflow_mypy.plugins.outputs
Running the test suite if available
Once the vote passes, summarize the results in a reply to the voting thread.
Move the release from dev to release in SVN:
svn mv https://dist.apache.org/repos/dist/dev/airflow/apache-airflow-mypy-<VERSION>rc<RC> \ https://dist.apache.org/repos/dist/release/airflow/apache-airflow-mypy-<VERSION> \ -m "Release Apache Airflow Mypy <VERSION>"
Publish the final release to PyPI:
twine upload dist/apache_airflow_mypy-<VERSION>-py3-none-any.whl twine upload dist/apache_airflow_mypy-<VERSION>.tar.gz
Tag the final release:
git tag -s apache-airflow-mypy-<VERSION> -m "Apache Airflow Mypy <VERSION>" git push origin apache-airflow-mypy-<VERSION>
Send an announcement email to dev@airflow.apache.org and announce@apache.org:
Subject: [ANNOUNCE] Apache Airflow Mypy <VERSION> released The Apache Airflow team is pleased to announce the release of Apache Airflow Mypy <VERSION>. Apache Airflow Mypy provides Mypy plugins for Apache Airflow to enhance type checking capabilities. The release is available at: https://pypi.org/project/apache-airflow-mypy/<VERSION>/ Release notes: https://github.com/apache/airflow/blob/main/dev/mypy/RELEASE_NOTES.rst Installation: pip install apache-airflow-mypy Usage: Add to your mypy configuration: [mypy] plugins = airflow_mypy.plugins.decorators, airflow_mypy.plugins.outputs Cheers, The Apache Airflow Team