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
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ build-client-python:
patch -p1 /module/openfga_sdk/sync/open_fga_api.py /config/clients/python/patches/open_fga_api_sync.py.patch && \
patch -p1 /module/docs/OpenFgaApi.md /config/clients/python/patches/OpenFgaApi.md.patch'"

make run-in-docker sdk_language=python image=python:${PYTHON_DOCKER_TAG} command="/bin/sh -c 'python -m pip install --upgrade pip && \
python -m pip install --upgrade setuptools wheel && \
python -m pip install -r test-requirements.txt && \
python -m ruff check --select I --fix . && \
python -m ruff format . && \
python setup.py sdist bdist_wheel'"
make run-in-docker sdk_language=python image=ghcr.io/astral-sh/uv:python${PYTHON_DOCKER_TAG}-alpine command="/bin/sh -c 'export UV_LINK_MODE=copy && \
uv sync && \
uv run ruff check --select I --fix . && \
uv run ruff format . && \
uv build'"

.PHONY: test-client-python
test-client-python: build-client-python
make run-in-docker sdk_language=python image=python:${PYTHON_DOCKER_TAG} command="/bin/sh -c 'python -m pip install -r test-requirements.txt && \
pytest --cov-report term-missing --cov=openfga_sdk test/ && \
ruff check .'"
make run-in-docker sdk_language=python image=ghcr.io/astral-sh/uv:python${PYTHON_DOCKER_TAG}-alpine command="/bin/sh -c 'export UV_LINK_MODE=copy && \
uv sync && \
uv run pytest --cov-report term-missing --cov=openfga_sdk test/ && \
uv run ruff check .'"

### Java
.PHONY: tag-client-java
Expand Down
3 changes: 3 additions & 0 deletions config/clients/python/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ test/*
.travis.yml
tox.ini
setup.cfg
setup.py
requirements.txt
test-requirements.txt
5 changes: 3 additions & 2 deletions config/clients/python/config.overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"supportsStreamedListObjects": "streamed_list_objects",
"files": {
".snyk": {},
"pyproject.toml": {},

"pyproject.toml.mustache": {
"destinationFilename": "pyproject.toml"
},
"api_sync.mustache": {
"folder": "openfga_sdk/sync",
"destinationFilename": "_sync.py",
Expand Down
86 changes: 0 additions & 86 deletions config/clients/python/template/pyproject.toml

This file was deleted.

145 changes: 145 additions & 0 deletions config/clients/python/template/pyproject.toml.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#
# {{#packageDescription}}{{{packageDescription}}}{{/packageDescription}}
#
# {{#version}}API version: {{{version}}}{{/version}}
# {{#websiteUrl}}Website: {{{websiteUrl}}}{{/websiteUrl}}
# {{#docsUrl}}Documentation: {{{docsUrl}}}{{/docsUrl}}
# {{#supportInfo}}Support: {{{supportInfo}}}{{/supportInfo}}
# {{#licenseId}}License: [{{{licenseId}}}](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/blob/main/LICENSE){{/licenseId}}
#

[project]
name = "{{{projectName}}}"
version = "{{packageVersion}}"
description="{{appDescription}}"
authors = [
{ name = "{{author}} ({{websiteUrl}})", email = "{{infoEmail}}"}
]
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=[
{{#packageTags}}
"{{.}}",
{{/packageTags}}
]
requires-python=">={{pythonMinimumRuntime}}"
{{#licenseId}}license="{{.}}"
{{/licenseId}}
dependencies = [
"aiohttp>=3.9.3",
"python-dateutil>=2.9.0",
"opentelemetry-api>=1.25.0",
"urllib3>=1.26.19,<3"
]

[project.urls]
Repository="https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.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",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

line-length = 88
indent-width = 4

target-version = "py310"

[tool.ruff.lint]
extend-select = [
#"B", # flake8-bugbear
#"C4", # flake8-comprehensions
#"C9", # mccabe
"I", # isort
"PGH", # pygrep-hooks
#"RUF", # ruff
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
#"TRY", # tryceratops
#"EM", # flake8-errmsg
]
ignore = []

fixable = ["ALL"]
unfixable = []

dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.pytest.ini_options]
testpaths = [
"test",
"integration",
]

addopts = "--cov=openfga_sdk --cov-report term-missing --cov-report xml --cov-report html"

asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"

[tool.mypy]
python_version = "{{pythonMinimumRuntime}}"
packages = "openfga_sdk"
exclude = [
"openfga_sdk/models",
]
#warn_return_any = "True"
#warn_unused_configs = "True"
#disallow_untyped_defs = "True"
6 changes: 0 additions & 6 deletions config/clients/python/template/requirements.mustache

This file was deleted.

53 changes: 0 additions & 53 deletions config/clients/python/template/setup.mustache

This file was deleted.

8 changes: 0 additions & 8 deletions config/clients/python/template/test-requirements.mustache

This file was deleted.

Loading