Skip to content

[BUG] 58.0.0: build fails with "AttributeError: type object 'Distribution' has no attribute '_finalize_2to3_doctests'" #2765

@kloczek

Description

@kloczek

setuptools version

58.0.0

Python version

3.8.12

OS

Linux/x86_64

Additional environment information

build version 0.6.0

Description

With setuptools I was able to use build procedure consisting from:

  • python3 -m build --no-isolation --wheel
  • generate egg_info by python3 setup.py egg_info
  • generate man pages using setuptools<>sphinx integration

In new version that procedure fails on first step.

Expected behavior

build should produce .whl file.

How to Reproduce

  • unpack git tagged tar ball
  • execute SETUPTOOLS_SCM_PRETEND_VERSION=58.0.0 python3 -m build --no-isolation --wheel

Output

+ cd setuptools-58.0.0
+ SETUPTOOLS_SCM_PRETEND_VERSION=58.0.0
+ /usr/bin/python3 -m build --no-isolation --wheel
* Getting dependencies for wheel...
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/pkg_resources/__init__.py", line 2458, in resolve
    return functools.reduce(getattr, self.attrs, module)
AttributeError: type object 'Distribution' has no attribute '_finalize_2to3_doctests'

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 349, in <module>
    main()
  File "/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 331, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/usr/lib/python3.8/site-packages/pep517/in_process/_in_process.py", line 117, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/build_meta.py", line 154, in get_requires_for_build_wheel
    return self._get_build_requires(
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/build_meta.py", line 135, in _get_build_requires
    self.run_setup()
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/build_meta.py", line 150, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
  File "setup.py", line 87, in <module>
    dist = setuptools.setup(**setup_params)
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.8/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/dist.py", line 446, in __init__
    _Distribution.__init__(
  File "/usr/lib64/python3.8/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/dist.py", line 821, in finalize_options
    for ep in sorted(eps, key=by_order):
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/setuptools/dist.py", line 820, in <lambda>
    eps = map(lambda e: e.load(), pkg_resources.iter_entry_points(group))
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/home/tkloczko/rpmbuild/BUILD/setuptools-58.0.0/pkg_resources/__init__.py", line 2460, in resolve
    raise ImportError(str(exc)) from exc
ImportError: type object 'Distribution' has no attribute '_finalize_2to3_doctests'

ERROR Backend subproccess exited when trying to invoke get_requires_for_build_wheel

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions