question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. Go into temporary directory cd /tmp
  2. Install azure_eventhub under dir1 pip install --target=$(pwd)/dir1 azure_eventhub
  3. Install azure-eventhub-checkpointstoreblob under dir2 pip install --target=$(pwd)/dir2 azure-eventhub-checkpointstoreblob
  4. Create virtual environment virtualenv venv
  5. Activate virtual environment source venv/bin/activate
  6. Create main.py
cat > main.py
import sys
sys.path.extend(['/tmp/dir1', '/tmp/dir2'])
from azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore
  1. Execute main.py python ./main.py
  2. 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:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yunhaolingcommented, Sep 14, 2020

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!

0reactions
ivomodriniccommented, Dec 18, 2020

hey @ivomodrinic , we have a release plan in early Jan next year, sorry for keeping you waiting for so long.

No worries @yunhaoling. Thanks for quick response and ETA.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug: not properly parsing native namespace package imports ...
I am reporting a bug where mypy doesn't seem to be able to understand native namespace packages. The current behavior is mypy seems...
Read more >
Packaging namespace packages
Use pkgutil-style namespace packages. This is recommended for new packages that need to support Python 2 and 3 and installation via both pip...
Read more >
Python 2 & 3 compatible namespace modules (using pip)
Python 2.3 introduced the pkgutil module and the extend_path function. This can be used to declare namespace packages that need to be compatible...
Read more >
Python Namespace Packages - YouTube
python #setuptools # packaging #namespacing #django #papermergeIn this screencast we will learn about namespace packaging and few caveats ...
Read more >
Create python package toolbox using poetry + namespace
Namespace packages allow you to split the sub-packages and modules within a single package across multiple, separate distribution packages.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found