Skip to main content

Type stubs for when Airflow is not installed

Project description

airflow-stubs

PyPI - Version


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).)

License

airflow-stubs is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_stubs-0.0.1.tar.gz (129.5 kB view details)

Uploaded Source

Built Distribution

airflow_stubs-0.0.1-py3-none-any.whl (358.5 kB view details)

Uploaded Python 3

File details

Details for the file airflow_stubs-0.0.1.tar.gz.

File metadata

  • Download URL: airflow_stubs-0.0.1.tar.gz
  • Upload date:
  • Size: 129.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for airflow_stubs-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5727d744be0083b49af5435eb2111239a81d339d00170f2f1ae10f0c56f80d03
MD5 057e008903f8032ee9d3666fd564d9cb
BLAKE2b-256 4c30882f9963707b57a59e6f2a382f1694b2557aa07ceec963c855e5bd73bf08

See more details on using hashes here.

File details

Details for the file airflow_stubs-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_stubs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0298d714ad5e03421a8ecbc341642f510a9f820bce0496c0d2ebf4b64e5bcb5b
MD5 6955a2a93fa5f7c5d846adca6286e1d3
BLAKE2b-256 2bdd7c1ea1fdd8603147592e685fa186e941d65ccfeb5573cb44380390fb3bfd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page