Skip to content

Importing OpenFeatureClient leads to an error #478

@imnotjames

Description

@imnotjames

If for any reason I import OpenFeatureClient directly without having previously imported api in the same file I receive the following error message:

ImportError: cannot import name 'OpenFeatureClient' from partially initialized module 'openfeature.client' (most likely due to a circular import) (.venv/lib/python3.11/site-packages/openfeature/client.py)

A minimal bit of code that replicates this:

from openfeature.client import OpenFeatureClient

This can be worked around by always importing the API first:

from openfeature import api
from openfeature.client import OpenFeatureClient

Is this expected? Am I not supported to be interacting with the client directly? I'm using it for typing information & dependency injection definitions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions