Skip to content
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

See if from senzing import SzAbstractFactoryGrpc works #152

Closed
docktermj opened this issue Jan 10, 2025 · 2 comments
Closed

See if from senzing import SzAbstractFactoryGrpc works #152

docktermj opened this issue Jan 10, 2025 · 2 comments
Assignees

Comments

@docktermj
Copy link
Contributor

docktermj commented Jan 10, 2025

Try the following

  1. src/senzing/__init__.py
from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc

__all__ = [
    :
    "SzAbstractFactoryGrpc",
    "SzAbstractFactoryParametersGrpc",
    :
]
  1. setup.cfg
install_requires =
    senzing_grpc >= 0.4.0
    typing-extensions >= 4.12.2; python_version<'3.11'
  1. requirements.txt
senzing_grpc==0.4.0
@docktermj docktermj self-assigned this Jan 10, 2025
@github-actions github-actions bot added the triage Need to triage label Jan 10, 2025
@docktermj docktermj removed the triage Need to triage label Jan 10, 2025
@docktermj
Copy link
Contributor Author

docktermj commented Jan 10, 2025

When tested with this program:

#! /usr/bin/env python3

import grpc

from senzing import SzAbstractFactoryGrpc, SzError

try:
    grpc_channel = grpc.insecure_channel("localhost:8261")
    sz_abstract_factory = SzAbstractFactoryGrpc(grpc_channel=grpc_channel)
except SzError as err:
    print(f"\nError:\n{err}\n")

Output:

$ ./test.py 

Traceback (most recent call last):
  File "/home/senzing/senzing-garage.git/sz-sdk-python/./test.py", line 5, in <module>
    from senzing import SzAbstractFactoryGrpc, SzError
  File "/home/senzing/senzing-garage.git/sz-sdk-python/.venv/lib/python3.12/site-packages/senzing/__init__.py", line 1, in <module>
    from senzing_grpc import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc
  File "/home/senzing/senzing-garage.git/sz-sdk-python/.venv/lib/python3.12/site-packages/senzing_grpc/__init__.py", line 1, in <module>
    from .szabstractfactory import SzAbstractFactoryGrpc, SzAbstractFactoryParametersGrpc
  File "/home/senzing/senzing-garage.git/sz-sdk-python/.venv/lib/python3.12/site-packages/senzing_grpc/szabstractfactory.py", line 13, in <module>
    from senzing import (
ImportError: cannot import name 'SzAbstractFactory' from partially initialized module 'senzing' (most likely due to a circular import) (/home/senzing/senzing-garage.git/sz-sdk-python/.venv/lib/python3.12/site-packages/senzing/__init__.py)

@docktermj
Copy link
Contributor Author

Won't be pursuing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant