I have a setup.py based package that has a bespoke bdist_wheel class
class BDistWheel(bdist_wheel):
def run(self):
if DEBUG: print('+++++ start BDistWheel')
hgid = pjoin('src','rlextra','.hgid')
with open(hgid,'w') as f:
f.write(subprocess.check_output(["hg","id","-i"]).decode('ascii').replace('+',''))
bdist_wheel.run(self)
unwanted = pjoin(pkgDir,'rlextra.egg-info')
if isdir(unwanted):
if DEBUG: print(f'+++++ rmtree {unwanted!r}')
shutil.rmtree(unwanted)
if isfile(hgid): os.remove(hgid)
if DEBUG: print('----- end BDistWheel')
this works fine in pip 26.1.2 & python 3.14 eg
$ pip --version
pip 26.1.2 from /home/robin/devel/reportlab/.py314/lib/python3.14/site-packages/pip (python 3.14)$ pip wheel -w ./tmp . --no-deps
Looking in indexes: Simple index , Welcome to ReportLab's pypiserver!
Processing ./.
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Building wheels for collected packages: rlextra
Building wheel for rlextra (pyproject.toml) … done
Created wheel for rlextra: filename=rlextra-5.0.1-py3-none-any.whl size=4285030 sha256=9c8a76d9619f55eebb121d64ef0f8f4ff9972bd7bfdf5571240c432e07e96931
Stored in directory: /tmp/pip-ephem-wheel-cache-3j3tcjnt/wheels/16/75/ae/dc65b58deeb115d70d389a4bb83447a32386c6a27d2730eaec
Successfully built rlextra
However if I upgrade pip it fails
$ pip --version
pip 26.2.1 from /home/robin/devel/reportlab/.py314/lib/python3.14/site-packages/pip (python 3.14)
$ pip wheel -w ./tmp . --no-deps
Looking in indexes: https://pypi.org/simple, https://beta:****@www.reportlab.com/pypi
Processing ./.
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: rlextra
Building wheel for rlextra (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for rlextra (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [72 lines of output]
/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/wheel/bdist_wheel.py:4: FutureWarning: The 'wheel' package is no longer the canonical location of the 'bdist_wheel' command, and will be removed in a future release. Please update to setuptools v70.1 or later which contains an integrated version of this command.
warn(
running bdist_wheel
Error processing line 1 of /home/robin/devel/reportlab/.py314/lib/python3.14/site-packages/__editable__.preppy-5.2.1.pth:
Error in sitecustomize; set PYTHONVERBOSE for traceback:
ModuleNotFoundError: No module named 'traceback'
Traceback (most recent call last):
File "/usr/bin/hg", line 10, in <module>
from __future__ import annotations
ModuleNotFoundError: No module named '__future__'
Traceback (most recent call last):
File "/home/robin/devel/reportlab/.py314/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
~~~~^^
File "/home/robin/devel/reportlab/.py314/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/robin/devel/reportlab/.py314/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
wheel_directory, config_settings, metadata_directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 441, in build_wheel
return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 429, in _build
return self._build_with_temp_dir(
~~~~~~~~~~~~~~~~~~~~~~~~~^
cmd,
^^^^
...<3 lines>...
self._arbitrary_args(config_settings),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 410, in _build_with_temp_dir
self.run_setup()
~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals()) # noqa: S102 # exec is intentional here
~~~~^^^^^^^^^^^^^^^^
File "<string>", line 251, in <module>
File "<string>", line 192, in main
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs) # type: ignore[return-value]
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/_distutils/core.py", line 168, in setup
return run_commands(dist)
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/_distutils/core.py", line 184, in run_commands
dist.run_commands()
~~~~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/_distutils/dist.py", line 1028, in run_commands
self.run_command(cmd)
~~~~~~~~~~~~~~~~^^^^^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/dist.py", line 1106, in run_command
super().run_command(command)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/tmp/pip-build-env-44xuv01n/overlay/lib/python3.14/site-packages/setuptools/_distutils/dist.py", line 1047, in run_command
cmd_obj.run()
~~~~~~~~~~~^^
File "<string>", line 157, in run
File "/home/robin/LOCAL/3.14.7/lib/python3.14/subprocess.py", line 473, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**kwargs).stdout
^^^^^^^^^
File "/home/robin/LOCAL/3.14.7/lib/python3.14/subprocess.py", line 578, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['hg', 'id', '-i']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for rlextra
It seems this latest pip is interfering with mercurial in some way