-
Notifications
You must be signed in to change notification settings - Fork 255
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
add stub file for autocomplete #313
Conversation
Since we now have an |
@@ -260,7 +260,7 @@ def make_extension(): | |||
build_args = get_build_args() | |||
_CYTHON_COMPILE_TIME_ENV = build_args.pop('compile_time_env') | |||
return Extension( | |||
'tesserocr', sources=['tesserocr.pyx'], language='c++', **build_args | |||
'tesserocr.tesserocr', sources=['tesserocr.pyx'], language='c++', **build_args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks confusing to me, why the name change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is packing (I still fight to create a windows wheel). The actual code will produce wheel like this:
>unzip -l dist\tesserocr-2.5.2-cp39-cp39-win_amd64.whl
Archive: dist\tesserocr-2.5.2-cp39-cp39-win_amd64.whl
Length Date Time Name
--------- ---------- ----- ----
314368 2022-12-13 17:27 tesserocr.cp39-win_amd64.pyd
1082 2022-12-13 17:27 tesserocr-2.5.2.dist-info/LICENSE
10257 2022-12-13 17:27 tesserocr-2.5.2.dist-info/METADATA
100 2022-12-13 17:27 tesserocr-2.5.2.dist-info/WHEEL
10 2022-12-13 17:27 tesserocr-2.5.2.dist-info/top_level.txt
485 2022-12-13 17:27 tesserocr-2.5.2.dist-info/RECORD
3405824 2022-12-08 18:31 leptonica-1.82.0.dll
2502656 2022-12-08 18:37 tesseract52.dll
--------- -------
6234782 8 files
So pyd and dlls will be installed to 'c:\Python\Python39\Lib\site-packages'. My proposed change will produce it like this:
>unzip -l dist\tesserocr-2.5.2-cp39-cp39-win_amd64.whl
Archive: dist\tesserocr-2.5.2-cp39-cp39-win_amd64.whl
Length Date Time Name
--------- ---------- ----- ----
216 2022-12-13 17:30 tesserocr/__init__.py
63204 2022-12-13 17:30 tesserocr/__init__.pyi
3405824 2022-12-08 18:31 tesserocr/leptonica-1.82.0.dll
2502656 2022-12-08 18:37 tesserocr/tesseract52.dll
316416 2022-12-13 17:30 tesserocr/tesserocr.cp39-win_amd64.pyd
1082 2022-12-13 17:30 tesserocr-2.5.2.dist-info/LICENSE
10257 2022-12-13 17:30 tesserocr-2.5.2.dist-info/METADATA
100 2022-12-13 17:30 tesserocr-2.5.2.dist-info/WHEEL
10 2022-12-13 17:30 tesserocr-2.5.2.dist-info/top_level.txt
827 2022-12-13 17:30 tesserocr-2.5.2.dist-info/RECORD
--------- -------
6300592 10 files
e.g. dlls will be "hidden" in tesserocr directory after installation + installing __init__.pyi
in 'c:\Python\Python39\Lib\site-packages' is IMO bad idea. I try to follow example for cython packaing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regarding moving pyx
and pxd
to src - I tried it but the build/creating wheel fails and I could not find a way how to fix it. We need some python packing expert help.
The current proposed changes work for me and I hope we can soon create windows builds (commit will follow later) with Github actions automatically.
any update to this PR? |
closing in favor of #350 |
fixes #312