Bug 2319690

Summary: python-pdfkit fails to build with setuptools 74+
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-pdfkitAssignee: Raphael Groner <projects.rg>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: projects.rg, python-packagers-sig
Target Milestone: ---Keywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pdfkit-0.6.1-18.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-23 09:29:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2300528, 2319387, 2322407    

Description Miro Hrončok 2024-10-18 10:12:22 UTC
Dear package maintainer,

this bugzilla is automated becasue the number of impacted packages it too high to go trough manually.

It appears that your package failed to build with setuptools 74.1.3 and wheel 0.44 in

  https://copr.fedorainfracloud.org/coprs/churchyard/setuptools-74/package/python-pdfkit/

While it succeeded with setuptools 69.2.0 and wheel 0.43 in

  https://copr.fedorainfracloud.org/coprs/churchyard/setuptools-control/package/python-pdfkit/

This usually means this package fails to build with setuptools 74+

We plan to update setuptools to version 74 or newer in Fedora 42. This is an approved Fedora 42 Change:

  https://fedoraproject.org/wiki/Changes/Setuptools_74+



Please analyze the failure and fix it in rawhide. Thanks.


You can use the builds from the churchyard/setuptools-74 copr for local testing.

  mock -r fedora-rawhide-x86_64 --addrepo 'https://download.copr.fedorainfracloud.org/results/churchyard/setuptools-74/fedora-rawhide-$basearch/'


One of the most common problems is that the setup.py test command cannot be used. If that is the case here, run the tests in %check differently, e.g. via %pytest, %tox, %{python3} -m unittest, etc.


If you need help, reach out to me in this bugzilla.

Comment 1 Miro Hrončok 2024-10-29 10:58:39 UTC
I plan to update setuptools to 74.x in rawhide this week.

At that point, this package will fail to build from source if not fixed.

Comment 2 Raphael Groner 2024-11-04 11:57:59 UTC
(In reply to Miro Hrončok from comment #1)
> I plan to update setuptools to 74.x in rawhide this week.
> 
> At that point, this package will fail to build from source if not fixed.

What is status? Might be worth to orphan this package.

Comment 3 Miro Hrončok 2024-11-04 13:17:56 UTC
I haven't updated setuptools yet but I plan to do it soon.

Comment 4 Raphael Groner 2024-11-07 17:16:20 UTC
Relevant snippet from log: The test command is disabled.

+ /usr/bin/python3 setup.py test
/builddir/build/BUILD/python-pdfkit-0.6.1-build/pdfkit-0.6.1/setup.py:25: SyntaxWarning: invalid escape sequence '\.'
  code_block = '(:\n\n)?\.\. code-block::.*'
/builddir/build/BUILD/python-pdfkit-0.6.1-build/pdfkit-0.6.1/setup.py:3: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!

        ********************************************************************************
        Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

        By 2024-Nov-15, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.
        ********************************************************************************

!!
  from setuptools.command.test import test as TestCommand
/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-pdfkit-0.6.1-build/pdfkit-0.6.1/setup.py", line 29, in <module>
    setup(
    ~~~~~^
        name='pdfkit',
        ^^^^^^^^^^^^^^
    ...<21 lines>...
            ]
            ^
    )
    ^
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 184, in setup
    return run_commands(dist)
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
    dist.run_commands()
    ~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
    self.run_command(cmd)
    ~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib/python3.13/site-packages/setuptools/dist.py", line 950, in run_command
    super().run_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
    cmd_obj.run()
    ~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/setuptools/command/test.py", line 45, in run
    raise RuntimeError("Support for the test command was removed in Setuptools 72")
RuntimeError: Support for the test command was removed in Setuptools 72

Comment 5 Raphael Groner 2024-11-15 13:47:05 UTC
> RuntimeError: Support for the test command was removed in Setuptools 72

Is there a workaround? Too busy with daily job at the moment and too lazy to read into documentation, sorry.

Comment 6 Miro Hrončok 2024-11-15 13:52:07 UTC
as said in the original report:

One of the most common problems is that the setup.py test command cannot be used. If that is the case here, run the tests in %check differently, e.g. via %pytest, %tox, %{python3} -m unittest, etc.

Comment 7 Raphael Groner 2024-11-18 18:50:10 UTC
(In reply to Miro Hrončok from comment #6)
> as said in the original report:
> 
> One of the most common problems is that the setup.py test command cannot be
> used. If that is the case here, run the tests in %check differently, e.g.
> via %pytest, %tox, %{python3} -m unittest, etc.

Not sure if that works. Have to investigate with upstream or someone could file a patch.

Comment 8 Miro Hrončok 2024-12-10 14:53:33 UTC
This is used directly in the spec file:	
	
  %check
  ...
  %{__python3} setup.py test

Please, replace the usage of setup.py test with -m unittest, etc. as appropriate for this package.

Comment 9 Raphael Groner 2024-12-27 20:00:43 UTC
(In reply to Miro Hrončok from comment #8)
> This is used directly in the spec file:	
> 	
>   %check
>   ...
>   %{__python3} setup.py test
> 
> Please, replace the usage of setup.py test with -m unittest, etc. as
> appropriate for this package.

Patch is welcomed. Please file a pull request. Sorry for delay, timely missed somehow your proposal.