Type stubs for when Airflow is not installed
Project description
airflow-stubs
Table of Contents
Installation
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 without installing it in my project.
I do however want to define DAGs in my project that use @task.docker.
Installing the stubs alleviates some of the errors from not having Airflow installed in my environment.
Notes on regenerating
rm -rf dist
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
python -m build .
In order to render airflow.models.dag I had to patch
get_members
in mypy in order to retry on RuntimeError: dictionary changed size during iteration.
(I used try: ... except RuntimeError: return self.get_members(obj).)
Publishing to PyPI is manual for now: twine upload dist/*.
License
airflow-stubs is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airflow_stubs-0.0.2.tar.gz.
File metadata
- Download URL: airflow_stubs-0.0.2.tar.gz
- Upload date:
- Size: 155.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aa6ee705c84d0bd0f94111438fc5eb4ed46605d20269b96eed925639bc0c9da
|
|
| MD5 |
2017dab4c9a5fd4aacc069fd5a4fe1b1
|
|
| BLAKE2b-256 |
c0a5e995f01fa01e3d21bc4d083bf0ad9a5803ae31543758b132fffebc3dbea0
|
Provenance
The following attestation bundles were made for airflow_stubs-0.0.2.tar.gz:
Publisher:
release.yaml on maresb/airflow-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_stubs-0.0.2.tar.gz -
Subject digest:
3aa6ee705c84d0bd0f94111438fc5eb4ed46605d20269b96eed925639bc0c9da - Sigstore transparency entry: 195221059
- Sigstore integration time:
-
Permalink:
maresb/airflow-stubs@7aaecb656fd0bd272ad665ad7d7e5f1b018ae9d9 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/maresb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@7aaecb656fd0bd272ad665ad7d7e5f1b018ae9d9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file airflow_stubs-0.0.2-py3-none-any.whl.
File metadata
- Download URL: airflow_stubs-0.0.2-py3-none-any.whl
- Upload date:
- Size: 410.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1119ff0e717f400ffcf181d4d1dee9736d75ebfae551fec71d50d830f4f67f39
|
|
| MD5 |
17292aca1a0894afa65a4dc14afd622b
|
|
| BLAKE2b-256 |
a70a7be9510d433308497b39943d12f1e53fd2e655c02ee08dc8551c3c984be2
|
Provenance
The following attestation bundles were made for airflow_stubs-0.0.2-py3-none-any.whl:
Publisher:
release.yaml on maresb/airflow-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_stubs-0.0.2-py3-none-any.whl -
Subject digest:
1119ff0e717f400ffcf181d4d1dee9736d75ebfae551fec71d50d830f4f67f39 - Sigstore transparency entry: 195221061
- Sigstore integration time:
-
Permalink:
maresb/airflow-stubs@7aaecb656fd0bd272ad665ad7d7e5f1b018ae9d9 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/maresb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@7aaecb656fd0bd272ad665ad7d7e5f1b018ae9d9 -
Trigger Event:
release
-
Statement type: