From e07a3c1c583bed10950c137d0edd1f08b63b91f4 Mon Sep 17 00:00:00 2001 From: Erik Ljungstrom Date: Mon, 27 Apr 2026 10:16:19 +0100 Subject: [PATCH] Add license notice and headers --- CONTRIBUTING.md | 91 +++++++++++++++++++ MAINTAINERS | 8 ++ NOTICE | 5 + airflow_api_client/__init__.py | 1 + airflow_api_client/auth.py | 1 + airflow_api_client/commands/__init__.py | 1 + airflow_api_client/commands/create_payload.py | 1 + airflow_api_client/commands/get/__init__.py | 1 + airflow_api_client/commands/get/dag.py | 1 + airflow_api_client/commands/get/dag_run.py | 1 + airflow_api_client/commands/get/log.py | 1 + airflow_api_client/commands/get/main.py | 1 + .../commands/get/task_instance.py | 1 + airflow_api_client/commands/list/__init__.py | 1 + airflow_api_client/commands/list/base.py | 1 + airflow_api_client/commands/list/dag_runs.py | 1 + airflow_api_client/commands/list/dags.py | 1 + airflow_api_client/commands/list/main.py | 1 + .../commands/list/task_instances.py | 1 + airflow_api_client/commands/pause.py | 1 + airflow_api_client/commands/profile.py | 1 + airflow_api_client/commands/raw.py | 1 + airflow_api_client/commands/run.py | 1 + airflow_api_client/commands/unpause.py | 1 + airflow_api_client/commands/xcom.py | 1 + airflow_api_client/filters.py | 1 + airflow_api_client/io.py | 1 + airflow_api_client/log.py | 1 + airflow_api_client/main.py | 3 +- airflow_api_client/models/__init__.py | 1 + airflow_api_client/typedefs.py | 1 + 31 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md create mode 100644 MAINTAINERS create mode 100644 NOTICE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e7b822e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,91 @@ +# Contributing to Airflow API Client + +Thank you for your interest in contributing. This document covers how to set up a development +environment, the coding standards we follow, and the process for submitting changes. + +> **Note:** This file has been reviewed and approved by Rackspace Legal. Do not modify the +> DCO section or the contribution process without seeking Legal review again. + +## Developer Certificate of Origin (DCO) + +This project uses the [Developer Certificate of Origin (DCO)](https://developercertificate.org/) +rather than a Contributor Licence Agreement (CLA). By submitting a pull request you certify that +you have the right to contribute the code and that you agree to the DCO terms. + +Every commit must include a `Signed-off-by` trailer with your real name and email address: + +``` +Signed-off-by: Jane Smith +``` + +Add it automatically with: + +```bash +git commit -s -m "your commit message" +``` + +If you forget on a previous commit: + +```bash +git commit --amend -s --no-edit +``` + +Pull requests with unsigned commits will not be merged. + +## Development setup + +Requires Python 3.10+ and [uv](https://github.com/astral-sh/uv). + +```bash +git clone https://github.com/rackerlabs/airflow-api-client.git +cd airflow-api-client +uv sync --extra dev +``` + +Install pre-commit hooks (runs Black, isort, and Pylint before each commit): + +```bash +uv run pre-commit install +``` + +## Code style + +| Tool | Purpose | +|---|---| +| [Black](https://black.readthedocs.io/) | Formatting (line length 100) | +| [isort](https://pycqa.github.io/isort/) | Import ordering | +| [Pylint](https://pylint.readthedocs.io/) | Linting | +| [Flake8](https://flake8.pycqa.org/) | Additional style checks | + +Run all checks manually: + +```bash +uv run black airflow_api_client/ tests/ +uv run isort airflow_api_client/ tests/ +uv run pylint --rcfile=pyproject.toml airflow_api_client/ +uv run flake8 airflow_api_client/ tests/ +``` + +The pre-commit hooks run Black, isort, and Pylint automatically on `git commit`. + +## Running tests + +```bash +uv run pytest tests/ +``` + +## Submitting a pull request + +1. Fork the repository and create a branch from `main`. +2. Make your changes with signed-off commits (see DCO above). +3. Ensure all tests pass and linters report no errors. +4. Open a pull request against `main`. CI must pass before the PR can be merged. +5. A maintainer will review your PR and may request changes. + +Please keep pull requests focused — one logical change per PR makes review faster. + +The current maintainers are listed in [MAINTAINERS](MAINTAINERS). + +## Reporting bugs + +Open a GitHub issue with steps to reproduce, the command you ran, and the full error output. diff --git a/MAINTAINERS b/MAINTAINERS new file mode 100644 index 0000000..fa9c57b --- /dev/null +++ b/MAINTAINERS @@ -0,0 +1,8 @@ +The following people are responsible for reviewing and merging pull requests, triaging issues, +and cutting releases. + +| Name | GitHub | +|---|---| +| Erik Ljungstrom | @eljrax | +| Ed Velez | @ed-velez | +| Dimitar Filipov | @dimitarfilipov | diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..be3387a --- /dev/null +++ b/NOTICE @@ -0,0 +1,5 @@ +Airflow API Client +Copyright 2026 Rackspace Technology, Inc. + +This product includes software developed at +Rackspace Technology, Inc. (https://www.rackspace.com/). diff --git a/airflow_api_client/__init__.py b/airflow_api_client/__init__.py index e69de29..314d800 100644 --- a/airflow_api_client/__init__.py +++ b/airflow_api_client/__init__.py @@ -0,0 +1 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 diff --git a/airflow_api_client/auth.py b/airflow_api_client/auth.py index f132530..1d07211 100644 --- a/airflow_api_client/auth.py +++ b/airflow_api_client/auth.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Authentication provider for Airflow API client that supports JWT tokens. AirflowAPIClientAuthProvider is the default authentication provider for Airflow API client. Custom providers can be implemented by subclassing AirflowAPIClientAuthProvider and overriding the diff --git a/airflow_api_client/commands/__init__.py b/airflow_api_client/commands/__init__.py index 8a0d466..85547ad 100644 --- a/airflow_api_client/commands/__init__.py +++ b/airflow_api_client/commands/__init__.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Base class for CLI commands.""" from abc import ABC, abstractmethod diff --git a/airflow_api_client/commands/create_payload.py b/airflow_api_client/commands/create_payload.py index 7319582..0fa2d6a 100644 --- a/airflow_api_client/commands/create_payload.py +++ b/airflow_api_client/commands/create_payload.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Command to construct a payload for a DAG run by prompting for values for each parameter defined in the DAG's parameters. """ diff --git a/airflow_api_client/commands/get/__init__.py b/airflow_api_client/commands/get/__init__.py index 1651c07..58dc6e4 100644 --- a/airflow_api_client/commands/get/__init__.py +++ b/airflow_api_client/commands/get/__init__.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Get command module""" from airflow_api_client.commands.get.main import GetCommand diff --git a/airflow_api_client/commands/get/dag.py b/airflow_api_client/commands/get/dag.py index a062ead..ba45a3e 100644 --- a/airflow_api_client/commands/get/dag.py +++ b/airflow_api_client/commands/get/dag.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Get DAG details""" from airflow_api_client.log import logger diff --git a/airflow_api_client/commands/get/dag_run.py b/airflow_api_client/commands/get/dag_run.py index 322ae6f..56f09be 100644 --- a/airflow_api_client/commands/get/dag_run.py +++ b/airflow_api_client/commands/get/dag_run.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Get DAG run details""" from airflow_api_client.log import logger diff --git a/airflow_api_client/commands/get/log.py b/airflow_api_client/commands/get/log.py index 689bbd1..ca5b499 100644 --- a/airflow_api_client/commands/get/log.py +++ b/airflow_api_client/commands/get/log.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Get task instance log""" from airflow_client.client.exceptions import NotFoundException diff --git a/airflow_api_client/commands/get/main.py b/airflow_api_client/commands/get/main.py index 5034ebe..ba418d8 100644 --- a/airflow_api_client/commands/get/main.py +++ b/airflow_api_client/commands/get/main.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Main get command with subcommand dispatch""" import json diff --git a/airflow_api_client/commands/get/task_instance.py b/airflow_api_client/commands/get/task_instance.py index cb6de3a..e13a7e5 100644 --- a/airflow_api_client/commands/get/task_instance.py +++ b/airflow_api_client/commands/get/task_instance.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Get task instance details""" from airflow_api_client.log import logger diff --git a/airflow_api_client/commands/list/__init__.py b/airflow_api_client/commands/list/__init__.py index dca3d7b..45f5a15 100644 --- a/airflow_api_client/commands/list/__init__.py +++ b/airflow_api_client/commands/list/__init__.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """List command module""" from airflow_api_client.commands.list.main import ListCommand diff --git a/airflow_api_client/commands/list/base.py b/airflow_api_client/commands/list/base.py index 868ffff..3af1b69 100644 --- a/airflow_api_client/commands/list/base.py +++ b/airflow_api_client/commands/list/base.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Base class for list commands""" from typing import Any, List diff --git a/airflow_api_client/commands/list/dag_runs.py b/airflow_api_client/commands/list/dag_runs.py index b05c983..0c79a34 100644 --- a/airflow_api_client/commands/list/dag_runs.py +++ b/airflow_api_client/commands/list/dag_runs.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """List DAG runs command""" from airflow_api_client.filters import filter_obj diff --git a/airflow_api_client/commands/list/dags.py b/airflow_api_client/commands/list/dags.py index dd5309b..838be23 100644 --- a/airflow_api_client/commands/list/dags.py +++ b/airflow_api_client/commands/list/dags.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """List DAGs command""" from airflow_api_client.filters import filter_obj diff --git a/airflow_api_client/commands/list/main.py b/airflow_api_client/commands/list/main.py index 740268e..5da29da 100644 --- a/airflow_api_client/commands/list/main.py +++ b/airflow_api_client/commands/list/main.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Main list command with subcommand dispatch""" from airflow_api_client.commands.list.base import ListCommandBase diff --git a/airflow_api_client/commands/list/task_instances.py b/airflow_api_client/commands/list/task_instances.py index 864626e..7fe6e78 100644 --- a/airflow_api_client/commands/list/task_instances.py +++ b/airflow_api_client/commands/list/task_instances.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """List task instances command""" from airflow_api_client.filters import filter_obj diff --git a/airflow_api_client/commands/pause.py b/airflow_api_client/commands/pause.py index d298550..c208739 100644 --- a/airflow_api_client/commands/pause.py +++ b/airflow_api_client/commands/pause.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to the `pause` sub-command.""" from airflow_api_client.commands import Command diff --git a/airflow_api_client/commands/profile.py b/airflow_api_client/commands/profile.py index 4a97a4b..91a12cb 100644 --- a/airflow_api_client/commands/profile.py +++ b/airflow_api_client/commands/profile.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to the `profile` sub-command.""" import configparser diff --git a/airflow_api_client/commands/raw.py b/airflow_api_client/commands/raw.py index c831d4c..060901e 100644 --- a/airflow_api_client/commands/raw.py +++ b/airflow_api_client/commands/raw.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to the `raw` sub-command.""" import json diff --git a/airflow_api_client/commands/run.py b/airflow_api_client/commands/run.py index 1ae5d25..052a260 100644 --- a/airflow_api_client/commands/run.py +++ b/airflow_api_client/commands/run.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to the `run` sub-command.""" import json diff --git a/airflow_api_client/commands/unpause.py b/airflow_api_client/commands/unpause.py index 7af464a..fd64d53 100644 --- a/airflow_api_client/commands/unpause.py +++ b/airflow_api_client/commands/unpause.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to the `unpause` sub-command.""" from airflow_api_client.commands import Command diff --git a/airflow_api_client/commands/xcom.py b/airflow_api_client/commands/xcom.py index 2427a16..6859cfd 100644 --- a/airflow_api_client/commands/xcom.py +++ b/airflow_api_client/commands/xcom.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to the xcom sub-command""" from airflow_api_client.commands import Command diff --git a/airflow_api_client/filters.py b/airflow_api_client/filters.py index 8d76d4d..ba45c10 100644 --- a/airflow_api_client/filters.py +++ b/airflow_api_client/filters.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Code related to filtering objects based on user-provided criteria""" import json diff --git a/airflow_api_client/io.py b/airflow_api_client/io.py index d2d1931..697ff9a 100644 --- a/airflow_api_client/io.py +++ b/airflow_api_client/io.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Utility functions for outputting data in various formats (JSON, YAML, human-readable tables).""" import json diff --git a/airflow_api_client/log.py b/airflow_api_client/log.py index 7620a64..c90f974 100644 --- a/airflow_api_client/log.py +++ b/airflow_api_client/log.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Logging configuration for the application, using structlog for structured logging with pretty-printed collections in the console output. """ diff --git a/airflow_api_client/main.py b/airflow_api_client/main.py index d266149..dbcec42 100755 --- a/airflow_api_client/main.py +++ b/airflow_api_client/main.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Airflow API Client""" -# This is a client for Airflow 3.1 and the RAW environment +# This is a client for Airflow 3.1 import argparse import configparser import importlib diff --git a/airflow_api_client/models/__init__.py b/airflow_api_client/models/__init__.py index 2ee9961..921ad5e 100644 --- a/airflow_api_client/models/__init__.py +++ b/airflow_api_client/models/__init__.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """A module for interacting with Airflow DAGs, DAG runs, task instances, XCom and any other Airflow entities via the Airflow API. """ diff --git a/airflow_api_client/typedefs.py b/airflow_api_client/typedefs.py index 7c07f86..a32a266 100644 --- a/airflow_api_client/typedefs.py +++ b/airflow_api_client/typedefs.py @@ -1,3 +1,4 @@ +# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0 """Types used across the application."""