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

V3.0rc1 has runtime dep. on setuptools #71650

Open
Goldziher opened this issue Mar 13, 2025 · 1 comment · May be fixed by #71651
Open

V3.0rc1 has runtime dep. on setuptools #71650

Goldziher opened this issue Mar 13, 2025 · 1 comment · May be fixed by #71651
Assignees

Comments

@Goldziher
Copy link

bug描述 Describe the Bug

Look here:

I am getting the following error in CI:

kreuzberg\_ocr\_paddleocr.py:242: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv\Lib\site-packages\paddleocr\__init__.py:14: in <module>
    from .paddleocr import (
.venv\Lib\site-packages\paddleocr\paddleocr.py:21: in <module>
    from paddle.utils import try_import
.venv\Lib\site-packages\paddle\__init__.py:38: in <module>
    from .base import core  # noqa: F401
.venv\Lib\site-packages\paddle\base\__init__.py:38: in <module>
    from . import (  # noqa: F401
.venv\Lib\site-packages\paddle\base\dataset.py:23: in <module>
    from ..utils import deprecated
.venv\Lib\site-packages\paddle\utils\__init__.py:16: in <module>
    from . import (  # noqa: F401
.venv\Lib\site-packages\paddle\utils\cpp_extension\__init__.py:15: in <module>
    from .cpp_extension import (
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #     http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    # isort: skip_file
    
    from __future__ import annotations
    from typing import TYPE_CHECKING, Any
    import os
    import copy
    import concurrent
    import re
>   import setuptools
E   ModuleNotFoundError: No module named 'setuptools'

.venv\Lib\site-packages\paddle\utils\cpp_extension\cpp_extension.py:23: ModuleNotFoundError

The above exception was the direct cause of the following exception:

backend = <kreuzberg._ocr._paddleocr.PaddleBackend object at 0x000001DE22318290>
mock_find_spec = <MagicMock name='find_spec' id='205356[805](https://github.com/Goldziher/kreuzberg/actions/runs/13844252481/job/38738917361?pr=27#step:11:806)0640'>

    @pytest.mark.anyio
    @pytest.mark.skipif(sys.version_info > (3, 12), reason="paddle does not support python 3.13 yet")
    async def test_init_paddle_ocr_initialization_error(backend: PaddleBackend, mock_find_spec: Mock) -> None:
        """Test handling initialization errors."""
    
        PaddleBackend._paddle_ocr = None
    
        async def mock_run_sync_error(*args: Any, **_: Any) -> None:
            if args and args[0].__name__ == "PaddleOCR":
                raise Exception("Initialization error")
    
        with patch("kreuzberg._ocr._paddleocr.run_sync", side_effect=mock_run_sync_error):
            with pytest.raises(OCRError) as excinfo:
>               await backend._init_paddle_ocr()

tests\ocr\paddleocr_test.py:234: 

其他补充信息 Additional Supplementary Information

No response

@Bobholamovic
Copy link
Member

Bobholamovic commented Mar 13, 2025

This is a bug. Thanks for pointing it out! I'll create a PR to fix it later.

@Bobholamovic Bobholamovic linked a pull request Mar 13, 2025 that will close this issue
@Bobholamovic Bobholamovic added status/following-up 跟进中 and removed status/new-issue 新建 labels Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants