azure-eventhub/azure/eventhub/extensions/__init__.py is incompatible with packaging namespaces
See original GitHub issue-
Package Name: azure-eventhub
-
Package Version: 5.1.0
-
Operating System: Linux
-
Python Version: 3.8.2
Describe the bug Existence of emptiness of the file https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventhub/azure-eventhub/azure/eventhub/extensions/__init__.py is incompatible with packaging namespaces. It causes problem using this package in Bazel, see https://github.com/dillon-giacoppo/rules_python_external/issues/56
To Reproduce Steps to reproduce the behavior:
- Go into temporary directory
cd /tmp
- Install azure_eventhub under dir1
pip install --target=$(pwd)/dir1 azure_eventhub
- Install azure-eventhub-checkpointstoreblob under dir2
pip install --target=$(pwd)/dir2 azure-eventhub-checkpointstoreblob
- Create virtual environment
virtualenv venv
- Activate virtual environment
source venv/bin/activate
- Create main.py
cat > main.py
import sys
sys.path.extend(['/tmp/dir1', '/tmp/dir2'])
from azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore
- Execute main.py
python ./main.py
- Result is an error:
Traceback (most recent call last):
File "main.py", line 3, in <module>
from azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore
ModuleNotFoundError: No module named 'azure.eventhub.extensions.checkpointstoreblob'
Expected behavior main.py should execute without errors.
Screenshots N/A
Additional context The problem emerges because Bazel installs dependencies in separate directories. Current layout, incompatible with packaging namespaces makes it impossible to use in applications build by Bazel, see https://github.com/dillon-giacoppo/rules_python_external/issues/56
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
hey @pjachowi , after a long discussion the team has agreed on the fix and I’ve merged your PR. It would be carried in our next EventHub release (which is still under planning). I’ll keep you updated.
Again, thanks for your patience and contribution!
No worries @yunhaoling. Thanks for quick response and ETA.