Bug 291658 - devel/py-setuptools fails to build
Summary: devel/py-setuptools fails to build
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks: 293596
  Show dependency treegraph
 
Reported: 2025-12-14 13:48 UTC by Xavier Humbert
Modified: 2026-08-05 18:17 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments
full build log (6.08 KB, text/plain)
2025-12-14 13:48 UTC, Xavier Humbert
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Humbert 2025-12-14 13:48:25 UTC
Created attachment 266184 [details]
full build log

Hi,
I read https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285930
delated py311-whell, with no success :

  File "/usr/local/lib/python3.11/site-packages/setuptools_scm/_integration/setuptools.py", line 29, in _warn_on_old_setuptools
    if int(_version.split(".")[0]) < 61:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base r10: 'unknown'


Attached is the full build log
Regards,
Xavier
Comment 1 PG 2026-08-05 18:17:35 UTC
Comment on attachment 266184 [details]
full build log

Hi !
This bug is not a bug into devel/py-setuptools, but devel/py-wheel (I don't know how to change the information of this bug).

This bug seems to me kind of circular dependency from devel/py-wheel, and affects those who compile from source and scratch.
devel/py-wheel installs "/usr/local/lib/python3.11/site-packages/wheel/_bdist_wheel.py" and that file has a line to ask for the installed version of devel/py-setuptools.
At that point, devel/py-setuptools is not installed, and _bdist_wheel.py not executed.
While installing devel/py-setuptools, _bdist_wheel.py is executed, but there is not yet some py-setuptools installed, hence no version number available, and devel/py-setuptools fails to install.

I added this patch in devel/py-wheel/files/patch-_bdist_wheel_py.diff and re-installed devel/py-wheel. Everything seems Ok now :
----------
--- ./src/wheel/_bdist_wheel.py.orig  2026-04-22 15:50:55.394143300 +0000
+++ ./src/wheel/_bdist_wheel.py 2026-08-04 16:26:47.567105000 +0000
@@ -66,7 +66,7 @@
         return re.sub("[^A-Za-z0-9.]+", "-", version)
       
       
-setuptools_major_version = int(setuptools.__version__.split(".")[0])
+setuptools_major_version = int(63)
       
 PY_LIMITED_API_PATTERN = r"cp3\d"

----------

HTH