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

Publishing to PyPI is manual for now: twine upload dist/*.

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.2.tar.gz (155.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airflow_stubs-0.0.2-py3-none-any.whl (410.9 kB view details)

Uploaded Python 3

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

Hashes for airflow_stubs-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3aa6ee705c84d0bd0f94111438fc5eb4ed46605d20269b96eed925639bc0c9da
MD5 2017dab4c9a5fd4aacc069fd5a4fe1b1
BLAKE2b-256 c0a5e995f01fa01e3d21bc4d083bf0ad9a5803ae31543758b132fffebc3dbea0

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_stubs-0.0.2.tar.gz:

Publisher: release.yaml on maresb/airflow-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for airflow_stubs-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1119ff0e717f400ffcf181d4d1dee9736d75ebfae551fec71d50d830f4f67f39
MD5 17292aca1a0894afa65a4dc14afd622b
BLAKE2b-256 a70a7be9510d433308497b39943d12f1e53fd2e655c02ee08dc8551c3c984be2

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_stubs-0.0.2-py3-none-any.whl:

Publisher: release.yaml on maresb/airflow-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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