-
Notifications
You must be signed in to change notification settings - Fork 5
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
__init__.py causes No module named 'adblock.adblock' #17
Comments
Can you reproduce this behaviour with (run in root of git repository):
I can't, unfortunately.
That's right. It's the most straightforward way I found to make a PEP 561 compatible package.
I'm not sure, but it is the pattern that a number of PyO3 examples seem to follow. See for example: |
I think this is fixed in dc33223 |
I have the same issue, and dc33223 did not fix it for me. |
I'm seeing this on the package installed system-wide via setup.py |
@b3n @ddevault Ah, I had been trying to reproduce this when installing with
When I leave the git repository, |
I've never tried it from the git repository, and that's not how I would use it anyway - I am packaging this for Alpine Linux. |
This seemed to surface for Alpine when we went from python 3.8 to 3.9... |
+1
There is no abi3.so inside the adblock/ directory even after the build... (maybe it's not supposed to be there, I don't know) |
After building via
maturin build
and installing the wheel via pip, runningpython3 -c "import adblock"
results in:This is because the
adblock
module gets imported, and due tofrom .adblock
import, Python tries to importadblock.adblock
.When trying again outside of the git repository, the import works fine.
It looks like that
adblock
module is only required for type annotations? Is the__init__.py
really required, and is the import even correct? Perhaps it could be moved tosrc/
somehow to not interfere with the native extension module?The text was updated successfully, but these errors were encountered: