testcontainers-python icon indicating copy to clipboard operation
testcontainers-python copied to clipboard

feat(modules): add OpenFGA module

Open giggsoff opened this issue 11 months ago • 1 comments

Add OpenFGA testcontainer module

giggsoff avatar Jan 30 '25 09:01 giggsoff

This is super useful. I am trying to run something like this locally but not having much success. Would love to see this native to testcontainers-python.

cbernard-rm25 avatar May 28 '25 16:05 cbernard-rm25

Closed https://github.com/testcontainers/testcontainers-python/issues/806

Tranquility2 avatar Jul 02 '25 15:07 Tranquility2

So we got:

modules/openfga/tests/test_openfga.py:1: in <module>
    from testcontainers.openfga import OpenFGAContainer
modules/openfga/testcontainers/openfga/__init__.py:17: in <module>
    from openfga_sdk import ClientConfiguration
E   ImportError: cannot import name 'ClientConfiguration' from 'openfga_sdk'

looks like a completability issue.

Checking the lock file we get:

name = "openfga-sdk"
version = "0.1.1"

This is from Jan 18, 2023

Tranquility2 avatar Jul 02 '25 19:07 Tranquility2

poetry add openfga_sdk==0.9.4

Updating dependencies
Resolving dependencies... (0.0s)

The current project's supported Python range (>=3.9,<4.0) is not compatible with some of the required packages Python requirement:
  - openfga-sdk requires Python >=3.10, so it will not be installable for Python >=3.9,<3.10

https://github.com/openfga/python-sdk/blob/main/CHANGELOG.md#v020

Tranquility2 avatar Jul 02 '25 19:07 Tranquility2

this is currently blocked by python3.9 support.

so because python3.9 is not supported the latest openfga sdk, and we support python3.9, poetry installs 0.1.1, which is not like 0.9.5 at all.

i think this is solved by simply dropping python3.9 support. i think this may also be solved by not installing openfga on python < 3.10

any thoughts?

alexanderankin avatar Jul 18 '25 06:07 alexanderankin

@alexanderankin checkout https://github.com/testcontainers/testcontainers-python/discussions/846

Tranquility2 avatar Jul 19 '25 06:07 Tranquility2

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (main@ef65bd1). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #762   +/-   ##
=======================================
  Coverage        ?   83.90%           
=======================================
  Files           ?       13           
  Lines           ?      752           
  Branches        ?      122           
=======================================
  Hits            ?      631           
  Misses          ?       92           
  Partials        ?       29           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jul 21 '25 20:07 codecov[bot]