Skip to content

Modernize packaging #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
38 changes: 16 additions & 22 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,25 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- name: Set up uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
version: "0.7.7"
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
**/test-requirements*.txt
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install dependencies
run: |
pip install -r test-requirements.txt --upgrade pip
pip install "urllib3==${{ matrix.urllib3-version }}"
uv sync
uv pip install "urllib3==${{ matrix.urllib3-version }}"

- if: matrix.python-version == '3.10' && matrix.urllib3-version == '1.26.19'
name: Run `ruff`
run: ruff check
run: uv run ruff check

- name: Run tests and collect coverage
run: pytest --cov-fail-under 60 --cov openfga_sdk
run: uv run pytest --cov-fail-under 60 --cov openfga_sdk

- if: matrix.python-version == '3.10' && matrix.urllib3-version == '1.26.19'
name: Upload coverage to Codecov
Expand All @@ -69,23 +67,19 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- name: Set up uv and Python
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
version: "0.7.7"
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
**/test-requirements*.txt
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"

- name: Install dependencies
run: pip install -r test-requirements.txt --upgrade pip
run: uv sync

- name: Build package
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel
run: uv build

- name: Publish package
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
[project]
name = "openfga-sdk"
version = "0.9.4"
description="A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar."
authors = [
{ name = "OpenFGA (https://openfga.dev)", email = "[email protected]"}
]
readme = "README.md"
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords=[
"openfga",
"authorization",
"fga",
"fine-grained-authorization",
"rebac",
"zanzibar",
]
requires-python=">=3.10"
license="Apache-2.0"
dependencies = [
"aiohttp>=3.9.3",
"python-dateutil>=2.9.0",
"opentelemetry-api>=1.25.0",
"urllib3>=1.26.19,<3"
]

[project.urls]
Repository="https://github.com/openfga/python-sdk.git"

[dependency-groups]
dev = [
"griffe>=0.41.2",
"mock>=5.1.0",
"pytest-asyncio>=0.25",
"pytest-cov>=5",
"ruff>=0.9",
"mypy>=1.14.1",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.ruff]
exclude = [
".bzr",
Expand Down
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

8 changes: 0 additions & 8 deletions test-requirements.txt

This file was deleted.

Loading