Skip to content

Build broken with latest setuptools 70.0.0 #29

@stweil

Description

@stweil

Build fails (and breaks ocrd_all builds, too). This is the failing part:

pip3 install --no-build-isolation -f "https://dl.fbaipublicfiles.com/detectron2/wheels/$CUDA/torch1.10/index.html" "git+https://github.com/facebookresearch/detectron2@v0.6#egg=detectron2"
Looking in links: https://dl.fbaipublicfiles.com/detectron2/wheels/cu122/torch1.10/index.html
Collecting detectron2
  Cloning https://github.com/facebookresearch/detectron2 (to revision v0.6) to /tmp/pip-install-mv14g2ap/detectron2_96226a9ef17042e2b5931862b54f45cf
  Running command git clone --filter=blob:none --quiet https://github.com/facebookresearch/detectron2 /tmp/pip-install-mv14g2ap/detectron2_96226a9ef17042e2b5931862b54f45cf
  Running command git checkout -q d1e04565d3bec8719335b88be9e9b961bf3ec464
  Resolved https://github.com/facebookresearch/detectron2 to commit d1e04565d3bec8719335b88be9e9b961bf3ec464
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-mv14g2ap/detectron2_96226a9ef17042e2b5931862b54f45cf/setup.py", line 11, in <module>
          from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension
        File "/OCR-D/venv/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 28, in <module>
          from pkg_resources import packaging  # type: ignore[attr-defined]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ImportError: cannot import name 'packaging' from 'pkg_resources' (/OCR-D/venv/lib/python3.11/site-packages/pkg_resources/__init__.py)
      [end of output]

The failure is due to deprecation of pkg_resources API from setuptools since version 68: https://setuptools.pypa.io/en/latest/pkg_resources.html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions