Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 42 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,50 @@ permissions:

jobs:
build-and-test:
name: build-and-test (${{ matrix.os }})
name: build-and-test (${{ matrix.wheel-plat }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-15-intel # x86_64
- macos-latest # arm64 (macos-14+)
- windows-latest
include:
# Linux x86_64 — manylinux_2_17 tag required by PyPI (bare linux_x86_64 is rejected)
- os: ubuntu-latest
arch: ''
wheel-plat: manylinux_2_17_x86_64
# Linux aarch64
- os: ubuntu-24.04-arm
arch: ''
wheel-plat: manylinux_2_17_aarch64
# macOS Intel x86_64 — use 10.9 deployment target for broad compatibility
# NOTE: macOS _PYTHON_HOST_PLATFORM must use dashes (macosx-X.Y-arch),
# not underscores — wheel's macosx_libfile.py splits on '-'
- os: macos-15-intel
arch: ''
wheel-plat: macosx-10.9-x86_64
# macOS Apple Silicon arm64 — 11.0 is the minimum for arm64
- os: macos-latest
arch: ''
wheel-plat: macosx-11.0-arm64
# Windows 64-bit
- os: windows-latest
arch: x64
wheel-plat: win_amd64
# Windows 32-bit — 32-bit Python on 64-bit runner via actions/setup-python arch
- os: windows-latest
arch: x86
wheel-plat: win32
# Windows ARM64 — native runner; no arch override, setup-python defaults to ARM64
- os: windows-11-arm
arch: ''
wheel-plat: win_arm64

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: ${{ matrix.arch }}

- name: Install build deps
run: pip install setuptools wheel setuptools-download
Expand All @@ -45,11 +72,18 @@ jobs:
run: fga help

- name: Build platform wheel
env:
# Force the correct platform tag; without this:
# - Linux gets bare linux_x86_64 which PyPI rejects (needs manylinux)
# - macOS gets the runner OS version (too new, e.g. macosx_15_0)
# - Windows x86 Python may not detect win32 correctly
_PYTHON_HOST_PLATFORM: ${{ matrix.wheel-plat }}
run: pip wheel --no-deps --no-build-isolation --wheel-dir dist .

- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
# Use wheel-plat in the name — ensures uniqueness across the two windows-latest entries
name: wheels-${{ matrix.wheel-plat }}
path: dist/*.whl

publish-pypi:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Python wrapper to provide a pip-installable [OpenFGA CLI (`fga`)](https://github.com/openfga/cli) binary.

[![CI](https://github.com/openfga/openfga-cli-py/actions/workflows/main.yml/badge.svg)](https://github.com/openfga/openfga-cli-py/actions/workflows/main.yml)
[![CI](https://github.com/neeve-ai/openfga-cli-py/actions/workflows/main.yml/badge.svg)](https://github.com/neeve-ai/openfga-cli-py/actions/workflows/main.yml)
[![PyPI](https://img.shields.io/pypi/v/openfga-cli-py)](https://pypi.org/project/openfga-cli-py/)

## Installation
Expand All @@ -14,7 +14,7 @@ pip install openfga-cli-py
Or install a platform wheel directly from a GitHub Release (for air-gapped/offline use):

```bash
pip install https://github.com/openfga/openfga-cli-py/releases/download/v0.7.19.0/openfga_cli_py-0.7.19.0-py2.py3-none-linux_x86_64.whl
pip install https://github.com/neeve-ai/openfga-cli-py/releases/download/v0.7.19.0/openfga_cli_py-0.7.19.0-py2.py3-none-linux_x86_64.whl
```

## Usage
Expand Down Expand Up @@ -45,15 +45,15 @@ subprocess.run(["fga", "version"], check=True)
> `setuptools-download`. Use a supported platform or build from source.

> **Note**: In air-gapped environments, download the pre-built wheel for your platform from
> the [GitHub Releases page](https://github.com/openfga/openfga-cli-py/releases) and install
> the [GitHub Releases page](https://github.com/neeve-ai/openfga-cli-py/releases) and install
> it directly with `pip install <wheel-file>`.

## As a pre-commit hook

Add to your `.pre-commit-config.yaml`:

```yaml
- repo: https://github.com/openfga/openfga-cli-py
- repo: https://github.com/neeve-ai/openfga-cli-py
rev: v0.7.19.0
hooks:
- id: fga
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = 0.7.19.0
description = Python wrapper around invoking the OpenFGA CLI (https://github.com/openfga/cli)
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/openfga/openfga-cli-py
url = https://github.com/neeve-ai/openfga-cli-py
author = oss-robin
license = Apache License Version 2.0
license_files = LICENSE
Expand All @@ -15,7 +15,7 @@ classifiers =
Programming Language :: Python :: Implementation :: PyPy

[options]
python_requires = >=3.10
python_requires = >=3.11
setup_requires =
setuptools-download

Expand Down
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

from setuptools import setup

# setuptools >= 70.1 ships bdist_wheel natively; wheel package is the fallback
# for older environments where setuptools delegated to the wheel package.
try:
from setuptools.command.bdist_wheel import bdist_wheel as orig_bdist_wheel
except ImportError:
try:
from wheel.bdist_wheel import bdist_wheel as orig_bdist_wheel
except ImportError:
orig_bdist_wheel = None

if orig_bdist_wheel is None:
cmdclass = {}
else:
class bdist_wheel(orig_bdist_wheel):
Expand Down
Loading
Loading