Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ac122ac
Add synchronous Client backed by requests with full OpenFaaS REST API…
welteki Apr 22, 2026
fea205b
Add invoke_function to Client with IAM function auth support
welteki Apr 22, 2026
50310ce
Rename sync_token -> token on the TokenSource protocol
welteki Apr 23, 2026
e4e6dcf
Remove ClientCredentialsAuth convenience wrapper
welteki Apr 23, 2026
114f5d2
Replace _FunctionAuth with _BearerAuth and prevent gateway auth leaki…
welteki Apr 23, 2026
bfd879d
Fix Pylance type errors across auth, token, exchange and transport mo…
welteki Apr 23, 2026
38f0cd9
Add request timeouts and optional http_client to exchange_id_token an…
welteki Apr 23, 2026
9c74617
Simplify BasicAuth by subclassing HTTPBasicAuth directly
welteki Apr 23, 2026
7ff0333
Pass client session to exchange_id_token in get_function_token
welteki Apr 23, 2026
a5bf4e8
Document thread safety requirement on TokenSource protocol
welteki Apr 23, 2026
b95a7ad
Add openfaas.builder subpackage for the Function Builder API
welteki Apr 23, 2026
064ba71
Split invoke_function_async from invoke_function; require explicit me…
welteki Apr 24, 2026
534ef2e
Include openfaas label in delete_namespace request body
welteki Apr 24, 2026
d319a49
Document custom TokenSource implementations in README
welteki Apr 27, 2026
36a9a98
Rename openfaas module to openfaas_sdk to match PyPI package name
welteki Apr 27, 2026
f074261
Add PyPI and TestPyPI publish workflows
welteki Apr 27, 2026
ff130c0
Improve README structure and clarity
welteki Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
- [ ] I have raised an issue to propose this change ([required](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md))
- [ ] My issue has received approval from the maintainers or lead with the `design/approved` label


## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)


## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I've read the [CONTRIBUTION](https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md) guide
- [ ] I have signed-off my commits with `git commit -s`
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
push:
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync

- name: Check lint
run: uv run ruff check .

- name: Check formatting
run: uv run ruff format --check .

typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync

- name: Run pyright
run: uv run pyright

test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync

- name: Run tests
run: uv run pytest tests/
28 changes: 28 additions & 0 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish to TestPyPI

on:
workflow_dispatch:

jobs:
publish:
name: Publish to TestPyPI
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"

- name: Set package name
run: sed -i 's/^name = "openfaas-sdk"/name = "${{ github.repository_owner }}-openfaas-sdk"/' pyproject.toml

- name: Build package
run: uv build

- name: Publish to TestPyPI
run: uv publish --publish-url https://test.pypi.org/legacy/
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to PyPI

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"

- name: Build package
run: uv build

- name: Publish to PyPI
run: uv publish
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__pycache__/
*.py[cod]
*.egg-info/
dist/
build/
.venv/
.pytest_cache/
65 changes: 65 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Contributing

## Requirements

- Python 3.10 or newer
- [uv](https://docs.astral.sh/uv/) for dependency management

## Setup

Clone the repository and install all dependencies including dev tools:

```bash
git clone https://github.com/openfaas/python-sdk
cd python-sdk
uv sync
```

## Running tests

```bash
uv run pytest tests/
```

## Linting

Check for lint issues:

```bash
uv run ruff check .
```

Fix lint issues automatically:

```bash
uv run ruff check --fix .
```

## Formatting

Check formatting:

```bash
uv run ruff format --check .
```

Apply formatting:

```bash
uv run ruff format .
```

## Type checking

```bash
uv run pyright
```

## CI

All of the above are run automatically on every push and pull request via
GitHub Actions. The workflow runs:

- **Lint** — `ruff check` and `ruff format --check`
- **Type check** — `pyright`
- **Test** — `pytest` across Python 3.10, 3.11, 3.12, and 3.13
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 OpenFaaS Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading