Skip to content

Commit

Permalink
release(python-sdk): v0.6.0 (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Jul 15, 2024
2 parents 59f08ec + a16539d commit 02eb220
Show file tree
Hide file tree
Showing 82 changed files with 3,346 additions and 2,665 deletions.
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,25 @@ tag-client-python: test-client-python
.PHONY: build-client-python
build-client-python:
make build-client sdk_language=python tmpdir=${TMP_DIR} library="asyncio"
mv ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/openfga_sdk/api/open_fga_api_sync.py ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/openfga_sdk/sync/open_fga_api.py # TODO: Remove on OpenAPI generator v7.1 or higher
make run-in-docker sdk_language=python image=busybox:${BUSYBOX_DOCKER_TAG} command="/bin/sh -c 'patch -p1 /module/openfga_sdk/api/open_fga_api.py /config/clients/python/patches/open_fga_api.py.patch'"
make run-in-docker sdk_language=python image=busybox:${BUSYBOX_DOCKER_TAG} command="/bin/sh -c 'patch -p1 /module/openfga_sdk/sync/open_fga_api.py /config/clients/python/patches/open_fga_api_sync.py.patch'"
make run-in-docker sdk_language=python image=busybox:${BUSYBOX_DOCKER_TAG} command="/bin/sh -c '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 pyupgrade==3.15.2 isort==5.13.2 black==24.4.2 autoflake==2.3.1; pyupgrade \`find . -name *.py -type f\` --py310-plus --keep-runtime-typing; isort . --profile black; autoflake --exclude=__init__.py --in-place --remove-unused-variables --remove-all-unused-imports -r .; black .'"
make run-in-docker sdk_language=python image=python:${PYTHON_DOCKER_TAG} command="/bin/sh -c 'pip install setuptools wheel && python setup.py sdist bdist_wheel'"

mv ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/openfga_sdk/api/open_fga_api_sync.py ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/openfga_sdk/sync/open_fga_api.py
mv ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/test/test_open_fga_api.py ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/test/api/open_fga_api_test.py
mv ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/test/_/*.py ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/test/ && rm -rf ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/test/_/

sort -uo ${CLIENTS_OUTPUT_DIR}/fga-python-sdk/.openapi-generator/FILES{,}

make run-in-docker sdk_language=python image=busybox:${BUSYBOX_DOCKER_TAG} command="/bin/sh -c 'patch -p1 /module/openfga_sdk/api/open_fga_api.py /config/clients/python/patches/open_fga_api.py.patch && \
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 pyupgrade \`find . -name *.py -type f\` --py310-plus --keep-runtime-typing && \
python -m isort . --profile black && \
python -m autoflake --exclude=__init__.py --in-place --remove-unused-variables --remove-all-unused-imports -r . && \
python -m black . && \
python setup.py sdist bdist_wheel'"

.PHONY: test-client-python
test-client-python: build-client-python
Expand Down
6 changes: 6 additions & 0 deletions config/clients/python/CHANGELOG.md.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.6.0

### [0.6.0](https://github.com/openfga/python-sdk/compare/v0.5.0...v0.6.0) (2024-06-28)

- feat: add OpenTelemetry metrics reporting

## v0.5.0

### [0.5.0](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/compare/v0.4.2...v0.5.0) (2024-06-17)
Expand Down
227 changes: 155 additions & 72 deletions config/clients/python/config.overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,189 +2,272 @@
"sdkId": "python",
"gitRepoId": "python-sdk",
"packageName": "openfga_sdk",
"packageVersion": "0.5.0",
"packageVersion": "0.6.0",
"packageDescription": "Python SDK for OpenFGA",
"packageDetailedDescription": "This is an autogenerated python SDK for OpenFGA. It provides a wrapper around the [OpenFGA API definition](https://openfga.dev/api).",
"fossaComplianceNoticeId": "2f8a8629-b46c-435e-b8cd-1174a674fb4b",
"infoName": "OpenFGA",
"infoEmail": "[email protected]",
"docPrefix": "https://github.com/openfga/python-sdk/blob/main/",
"pythonMinimumRuntime": "3.10",
"supportsOpenTelemetry": true,
"files": {
".github/workflows/main.yaml.mustache": {
"destinationFilename": ".github/workflows/main.yaml",
"templateType": "SupportingFiles"
},

".snyk": {},
"credentials.mustache": {
"destinationFilename": "openfga_sdk/credentials.py",

"api_sync.mustache": {
"folder": "openfga_sdk/sync",
"destinationFilename": "_sync.py",
"templateType": "API"
},

"docs/opentelemetry.md": {},

"example/Makefile": {},
"example/README.md": {},
"example/example1/example1.py.mustache": {
"destinationFilename": "example/example1/example1.py",
"templateType": "SupportingFiles"
},
"example/example1/requirements.txt.mustache": {
"destinationFilename": "example/example1/requirements.txt",
"templateType": "SupportingFiles"
},
"credentials_test.mustache": {
"destinationFilename": "test/test_credentials.py",
"example/example1/setup.py.mustache": {
"destinationFilename": "example/example1/setup.py",
"templateType": "SupportingFiles"
},
"client/__init__.mustache": {
"destinationFilename": "openfga_sdk/client/__init__.py",
"example/example1/setup.cfg": {},

"example/opentelemetry/.env.example": {},
"example/opentelemetry/.gitignore": {},
"example/opentelemetry/README.md": {},
"example/opentelemetry/requirements.txt": {},
"example/opentelemetry/setup.cfg": {},
"example/opentelemetry/setup.py.mustache": {
"destinationFilename": "example/opentelemetry/setup.py",
"templateType": "SupportingFiles"
},
"client/client.mustache": {
"destinationFilename": "openfga_sdk/client/client.py",
"example/opentelemetry/main.py.mustache": {
"destinationFilename": "example/opentelemetry/main.py",
"templateType": "SupportingFiles"
},
"client/test_client.mustache": {
"destinationFilename": "test/test_client.py",

"src/api/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/api/__init__.py",
"templateType": "SupportingFiles"
},
"client/configuration.mustache": {
"src/client/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/client/__init__.py",
"templateType": "SupportingFiles"
},
"src/client/client.py.mustache": {
"destinationFilename": "openfga_sdk/client/client.py",
"templateType": "SupportingFiles"
},
"src/client/configuration.py.mustache": {
"destinationFilename": "openfga_sdk/client/configuration.py",
"templateType": "SupportingFiles"
},
"client/models/__init__.mustache": {
"src/client/models/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/__init__.py",
"templateType": "SupportingFiles"
},
"client/models/assertion.mustache": {
"src/client/models/assertion.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/assertion.py",
"templateType": "SupportingFiles"
},
"client/models/batch_check_response.mustache": {
"src/client/models/batch_check_response.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/batch_check_response.py",
"templateType": "SupportingFiles"
},
"client/models/check_request.mustache": {
"src/client/models/check_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/check_request.py",
"templateType": "SupportingFiles"
},
"client/models/expand_request.mustache": {
"src/client/models/expand_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/expand_request.py",
"templateType": "SupportingFiles"
},
"client/models/list_objects_request.mustache": {
"src/client/models/list_objects_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/list_objects_request.py",
"templateType": "SupportingFiles"
},
"client/models/list_relations_request.mustache": {
"src/client/models/list_relations_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/list_relations_request.py",
"templateType": "SupportingFiles"
},
"client/models/list_users_request.mustache": {
"src/client/models/list_users_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/list_users_request.py",
"templateType": "SupportingFiles"
},
"client/models/read_changes_request.mustache": {
"src/client/models/read_changes_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/read_changes_request.py",
"templateType": "SupportingFiles"
},
"client/models/tuple.mustache": {
"src/client/models/tuple.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/tuple.py",
"templateType": "SupportingFiles"
},
"client/models/write_request.mustache": {
"src/client/models/write_request.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/write_request.py",
"templateType": "SupportingFiles"
},
"client/models/write_response.mustache": {
"src/client/models/write_response.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/write_response.py",
"templateType": "SupportingFiles"
},
"client/models/write_single_response.mustache": {
"src/client/models/write_single_response.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/write_single_response.py",
"templateType": "SupportingFiles"
},
"client/models/write_transaction_opts.mustache": {
"src/client/models/write_transaction_opts.py.mustache": {
"destinationFilename": "openfga_sdk/client/models/write_transaction_opts.py",
"templateType": "SupportingFiles"
},
"configuration.mustache": {
"destinationFilename": "openfga_sdk/configuration.py",
"/src/models/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/models/__init__.py",
"templateType": "SupportingFiles"
},
"test_configuration.mustache": {
"destinationFilename": "test/test_configuration.py",
"/src/sync/client/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/sync/client/__init__.py",
"templateType": "SupportingFiles"
},
"validation.mustache": {
"destinationFilename": "openfga_sdk/validation.py",
"src/sync/client/client.py.mustache": {
"destinationFilename": "openfga_sdk/sync/client/client.py",
"templateType": "SupportingFiles"
},
"test_validation.mustache": {
"destinationFilename": "test/test_validation.py",
"src/sync/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/sync/__init__.py",
"templateType": "SupportingFiles"
},
"__init__sync.mustache": {
"destinationFilename": "openfga_sdk/sync/__init__.py",
"src/sync/api_client.py.mustache": {
"destinationFilename": "openfga_sdk/sync/api_client.py",
"templateType": "SupportingFiles"
},
"__init__sync_client.mustache": {
"destinationFilename": "openfga_sdk/sync/client/__init__.py",
"src/sync/oauth2.py.mustache": {
"destinationFilename": "openfga_sdk/sync/oauth2.py",
"templateType": "SupportingFiles"
},
"rest_sync.mustache": {
"src/sync/rest.py.mustache": {
"destinationFilename": "openfga_sdk/sync/rest.py",
"templateType": "SupportingFiles"
},
"api_client_sync.mustache": {
"destinationFilename": "openfga_sdk/sync/api_client.py",
"src/telemetry/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/telemetry/__init__.py",
"templateType": "SupportingFiles"
},
"api_sync.mustache": {
"folder": "openfga_sdk/sync",
"destinationFilename": "_sync.py",
"templateType": "API"
"src/telemetry/attributes.py.mustache": {
"destinationFilename": "openfga_sdk/telemetry/attributes.py",
"templateType": "SupportingFiles"
},
"api_test_sync.mustache": {
"destinationFilename": "test/test_open_fga_api_sync.py",
"src/telemetry/counters.py.mustache": {
"destinationFilename": "openfga_sdk/telemetry/counters.py",
"templateType": "SupportingFiles"
},
"client/client_sync.mustache": {
"destinationFilename": "openfga_sdk/sync/client/client.py",
"src/telemetry/histograms.py.mustache": {
"destinationFilename": "openfga_sdk/telemetry/histograms.py",
"templateType": "SupportingFiles"
},
"src/telemetry/metrics.py.mustache": {
"destinationFilename": "openfga_sdk/telemetry/metrics.py",
"templateType": "SupportingFiles"
},
"src/telemetry/telemetry.py.mustache": {
"destinationFilename": "openfga_sdk/telemetry/telemetry.py",
"templateType": "SupportingFiles"
},
"src/__init__.py.mustache": {
"destinationFilename": "openfga_sdk/__init__.py",
"templateType": "SupportingFiles"
},
"src/api_client.py.mustache": {
"destinationFilename": "openfga_sdk/api_client.py",
"templateType": "SupportingFiles"
},
"src/configuration.py.mustache": {
"destinationFilename": "openfga_sdk/configuration.py",
"templateType": "SupportingFiles"
},
"src/credentials.py.mustache": {
"destinationFilename": "openfga_sdk/credentials.py",
"templateType": "SupportingFiles"
},
"src/exceptions.py.mustache": {
"destinationFilename": "openfga_sdk/exceptions.py",
"templateType": "SupportingFiles"
},
"client/test_client_sync.mustache": {
"destinationFilename": "test/test_client_sync.py",
"src/help.py.mustache": {
"destinationFilename": "openfga_sdk/help.py",
"templateType": "SupportingFiles"
},
"oauth2.mustache": {
"src/oauth2.py.mustache": {
"destinationFilename": "openfga_sdk/oauth2.py",
"templateType": "SupportingFiles"
},
"oauth2_test.mustache": {
"destinationFilename": "test/test_oauth2.py",
"src/rest.py.mustache": {
"destinationFilename": "openfga_sdk/rest.py",
"templateType": "SupportingFiles"
},
"oauth2_sync.mustache": {
"destinationFilename": "openfga_sdk/sync/oauth2.py",
"src/validation.py.mustache": {
"destinationFilename": "openfga_sdk/validation.py",
"templateType": "SupportingFiles"
},
"oauth2_test_sync.mustache": {
"destinationFilename": "test/test_oauth2_sync.py",

"test/api/__init__.py.mustache": {
"destinationFilename": "test/api/__init__.py",
"templateType": "SupportingFiles"
},
"help.py": {
"destinationFilename": "openfga_sdk/help.py"
"test/client/__init__.py.mustache": {
"destinationFilename": "test/client/__init__.py",
"templateType": "SupportingFiles"
},
"example/Makefile": {
"destinationFilename": "example/Makefile",
"test/client/client_test.py.mustache": {
"destinationFilename": "test/client/client_test.py",
"templateType": "SupportingFiles"
},
"example/README.md": {
"destinationFilename": "example/README.md",
"test/sync/client/__init__.py.mustache": {
"destinationFilename": "test/sync/client/__init__.py",
"templateType": "SupportingFiles"
},
"example/example1/example1.py": {
"destinationFilename": "example/example1/example1.py",
"test/sync/client/client_test.py.mustache": {
"destinationFilename": "test/sync/client/client_test.py",
"templateType": "SupportingFiles"
},
"example/example1/requirements.txt.mustache": {
"destinationFilename": "example/example1/requirements.txt",
"test/sync/__init__.py.mustache": {
"destinationFilename": "test/sync/__init__.py",
"templateType": "SupportingFiles"
},
"example/example1/setup.py": {
"destinationFilename": "example/example1/setup.py",
"test/sync/api_test.py.mustache": {
"destinationFilename": "test/sync/open_fga_api_test.py",
"templateType": "SupportingFiles"
},
"test/sync/oauth2_test.py.mustache": {
"destinationFilename": "test/sync/oauth2_test.py",
"templateType": "SupportingFiles"
},
"test/__init__.py.mustache": {
"destinationFilename": "test/__init__.py",
"templateType": "SupportingFiles"
},
"test/configuration_test.py.mustache": {
"destinationFilename": "test/_/configuration_test.py",
"templateType": "SupportingFiles"
},
"test/credentials_test.py.mustache": {
"destinationFilename": "test/_/credentials_test.py",
"templateType": "SupportingFiles"
},
"test/oauth2_test.py.mustache": {
"destinationFilename": "test/_/oauth2_test.py",
"templateType": "SupportingFiles"
},
"example/example1/setup.cfg": {
"destinationFilename": "example/example1/setup.cfg",
"test/validation_test.py.mustache": {
"destinationFilename": "test/_/validation_test.py",
"templateType": "SupportingFiles"
}
}
Expand Down
Loading

0 comments on commit 02eb220

Please sign in to comment.