"The namespace_packages parameter is deprecated, "
"consider using implicit namespaces instead (PEP 420).",
)
warnings.warn(msg, SetuptoolsDeprecationWarning)
raises a TypeError: expected string or bytes-like object on line 287 because msg is a tuple.
Expected behavior
I expect a SetuptoolsDeprecationWarning to be raised, not an error.
How to Reproduce
python -m build --wheel on a package that is using the deprecated namespace_packages option.
Output
$ python -m build --wheel* Creating virtualenv isolated environment...* Installing packages in isolated environment... (babel, cython, numpy==1.17.3; python_version=="3.8", numpy==1.19.3; python_version=="3.9", numpy==1.21.3; python_version=="3.10", setuptools>=45, setuptools_scm>=6.4.0, wheel)* Getting dependencies for wheel...Traceback (most recent call last): File "/Users/emily/miniconda3/envs/main/lib/python3.10/site-packages/pep517/in_process/_in_process.py", line 363, in <module> main() File "/Users/emily/miniconda3/envs/main/lib/python3.10/site-packages/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/Users/emily/miniconda3/envs/main/lib/python3.10/site-packages/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel return hook(config_settings) File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel return self._get_build_requires( File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires self.run_setup() File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 65, in <module> setup( File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 109, in setup _setup_distribution = dist = klass(attrs) File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/dist.py", line 477, in __init__ _Distribution.__init__( File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 293, in __init__ self.finalize_options() File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/dist.py", line 901, in finalize_options ep(self) File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/dist.py", line 922, in _finalize_setup_keywords ep.load()(self, ep.name, value) File "/private/var/folders/zh/dy02ljyd4mj5_nfm158hwcr00000gn/T/build-env-sif8cxfe/lib/python3.10/site-packages/setuptools/dist.py", line 287, in check_nsp warnings.warn(msg, SetuptoolsDeprecationWarning)TypeError: expected string or bytes-like objectERROR Backend subproccess exited when trying to invoke get_requires_for_build_wheel
The text was updated successfully, but these errors were encountered:
setuptools version
62.3.0
Python version
3.10
OS
macOS
Additional environment information
No response
Description
Calling the
setup
function of a package using thenamespace_packages
parameter raises an error rather than the expectedSetuptoolsDeprecationWarning
.setuptools/setuptools/dist.py
Lines 283 to 287 in 1b7642b
raises a
TypeError: expected string or bytes-like object
on line 287 becausemsg
is a tuple.Expected behavior
I expect a
SetuptoolsDeprecationWarning
to be raised, not an error.How to Reproduce
python -m build --wheel
on a package that is using the deprecatednamespace_packages
option.Output
The text was updated successfully, but these errors were encountered: