Bug 2186076 - python-setuptools 62.6.0 FTBFS with Python 3.11.1 on F37
Summary: python-setuptools 62.6.0 FTBFS with Python 3.11.1 on F37
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-setuptools
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Python Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2158677
TreeView+ depends on / blocked
 
Reported: 2023-04-12 03:13 UTC by Charalampos Stratakis
Modified: 2023-04-26 12:11 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-04-26 12:11:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Diff of the two different build logs (33.21 KB, text/plain)
2023-04-12 03:13 UTC, Charalampos Stratakis
no flags Details
Current build log with the egg-info removal (22.35 KB, text/plain)
2023-04-12 03:14 UTC, Charalampos Stratakis
no flags Details
Build log without removing the egg-info dir (54.10 KB, text/plain)
2023-04-12 03:15 UTC, Charalampos Stratakis
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github pypa setuptools issues 3761 0 None open [BUG] Python 3.11.1 breaks setuptools builds on Fedora 2023-04-12 03:13:06 UTC

Description Charalampos Stratakis 2023-04-12 03:13:06 UTC
Created attachment 1957042 [details]
Diff of the two different build logs

Current error:

Handling wheel from get_requires_for_build_wheel
Requirement satisfied: wheel
   (installed: wheel 0.37.1)
Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 532, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 444, in generate_requires
    generate_run_requirements(backend, requirements, build_wheel=build_wheel, wheeldir=wheeldir)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 354, in generate_run_requirements
    generate_run_requirements_hook(backend, requirements)
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 310, in generate_run_requirements_hook
    dir_basename = prepare_metadata('.')
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
    self.run_setup()
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/build_meta.py", line 174, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
  File "setup.py", line 87, in <module>
    dist = setuptools.setup(**setup_params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/_distutils/core.py", line 151, in setup
    dist.parse_config_files()
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/dist.py", line 865, in parse_config_files
    setupcfg.parse_configuration(
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/config/setupcfg.py", line 160, in parse_configuration
    options.parse()
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/config/setupcfg.py", line 451, in parse
    section_parser_method(section_options)
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/config/setupcfg.py", line 676, in parse_section_entry_points
    self['entry_points'] = parsed
    ~~~~^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/setuptools-62.6.0/setuptools/config/setupcfg.py", line 233, in __setitem__
    raise KeyError(option_name)
KeyError: 'entry_points'


This was fixed on rawhide by not removing the pregenerated egg-info directory here:
https://src.fedoraproject.org/rpms/python-setuptools/c/7a725177361053e5932657a718eb53ef8634cb9c?branch=rawhide

However if the same fix is applied on F37 we get the same error albeit with a different build log this time.

Build log diff comparison, with the current build and the non-egg-info-removal one added as an attachment.

Comment 1 Charalampos Stratakis 2023-04-12 03:14:45 UTC
Created attachment 1957043 [details]
Current build log with the egg-info removal

Comment 2 Charalampos Stratakis 2023-04-12 03:15:30 UTC
Created attachment 1957044 [details]
Build log without removing the egg-info dir

Comment 3 Charalampos Stratakis 2023-04-12 03:41:59 UTC
The issue can be worked around by utilizing the github tarball which contains the bootstrap.egg-info directory

Draft example:
diff --git a/python-setuptools.spec b/python-setuptools.spec
index 0971702..1a88305 100644
--- a/python-setuptools.spec
+++ b/python-setuptools.spec
@@ -20,7 +20,7 @@
 # Disable it if you build this package in an alternative stack.
 %bcond_without main_python
 
-%global python_wheel_name %{srcname}-%{version}-py3-none-any.whl
+%global python_wheel_name %{srcname}-%{version}.post20230412-py3-none-any.whl
 
 Name:           python-setuptools
 # When updating, update the bundled libraries versions bellow!
@@ -43,7 +43,7 @@ Summary:        Easily build and distribute Python packages
 # the setuptools logo is MIT
 License:        MIT and ASL 2.0 and (BSD or ASL 2.0) and Python
 URL:            https://pypi.python.org/pypi/%{srcname}
-Source0:        %{pypi_source %{srcname} %{version}}
+Source0:        https://github.com/pypa/%{srcname}/archive/refs/tags/v%{version}.tar.gz
 
 # Some test deps are optional and either not desired or not available in Fedora, thus this patch removes them.
 Patch:          Remove-optional-or-unpackaged-test-deps.patch
@@ -133,7 +133,7 @@ A Python wheel of setuptools to use with venv.
 # If we don't have setuptools installed yet, we use the pre-generated .egg-info
 # See https://github.com/pypa/setuptools/pull/2543
 # And https://github.com/pypa/setuptools/issues/2550
-rm -r %{srcname}.egg-info
+#rm -r %{srcname}.egg-info
 %endif

Comment 4 Miro Hrončok 2023-04-12 11:38:58 UTC
The "post20230412" bit worries me.

Comment 5 Miro Hrončok 2023-04-12 12:42:38 UTC
Maybe we can add the GH tarball as Source1 and only unpack bootstrap.egg-info directory from that? It will effectively double the size of the SRPM, but that does not sound like a big deal for me.

Comment 6 Charalampos Stratakis 2023-04-12 21:24:24 UTC
(In reply to Miro Hrončok from comment #5)
> Maybe we can add the GH tarball as Source1 and only unpack
> bootstrap.egg-info directory from that? It will effectively double the size
> of the SRPM, but that does not sound like a big deal for me.

Interesting idea. I'll hack something up.

Comment 7 Charalampos Stratakis 2023-04-12 23:32:00 UTC
PR: https://src.fedoraproject.org/rpms/python-setuptools/pull-request/96


Note You need to log in before you can comment on or make changes to this bug.