https://github.com/maresb/airflow-stubs
Type stubs for when Airflow is not installed
https://github.com/maresb/airflow-stubs
Last synced: 9 months ago
JSON representation
Type stubs for when Airflow is not installed
- Host: GitHub
- URL: https://github.com/maresb/airflow-stubs
- Owner: maresb
- License: mit
- Created: 2024-03-23T20:46:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T07:41:01.000Z (about 1 year ago)
- Last Synced: 2025-07-26T17:10:38.353Z (11 months ago)
- Language: Python
- Homepage:
- Size: 428 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# airflow-stubs
[](https://github.com/maresb/airflow-stubs)
[](https://pypi.org/project/airflow-stubs)
-----
## Table of Contents
- [airflow-stubs](#airflow-stubs)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Introduction](#introduction)
- [Motivation](#motivation)
- [Notes on regenerating](#notes-on-regenerating)
- [License](#license)
## Installation
```console
pip install airflow-stubs
```
## Introduction
This is not meant to improve the type hints of Airflow. Instead it's meant to offer some basic type hints when Airflow is not installed.
Lots of stuff is broken. Use at your own risk.
## Motivation
Airflow has lots of dependencies.
I want to be able to run it via Docker Compose as in [simple-airflow](https://github.com/maresb/simple-airflow) without installing it in my project.
I do however want to define DAGs in my project that use [`@task.docker`](https://airflow.apache.org/docs/apache-airflow/stable/tutorial/taskflow.html#dependency-separation-using-docker-operator).
Installing the stubs alleviates some of the errors from not having Airflow installed in my environment.
## Notes on regenerating
Run the following commands:
```bash
docker pull apache/airflow
docker run -it --name generate-airflow-stubs -v "$(pwd)/generate-stubs-in-container.sh:/generate-stubs-in-container.sh:ro" apache/airflow bash /generate-stubs-in-container.sh
docker cp generate-airflow-stubs:/home/airflow/out/airflow .
docker rm generate-airflow-stubs
rm -rf airflow-stubs
mv airflow airflow-stubs
```
and then commit/push the results. The release is handled via `hatch-vcs` for versioning, and OIDC for trusted publishing to PyPI. There is currently no conda-forge package.
## License
`airflow-stubs` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.