protobuf
protobuf copied to clipboard
Fix deprecated use of `namespace_packages` in `python/dist/setup.py`
Uses implicit namespaces instead of explicit, as per https://peps.python.org/pep-0420/
Fixes a warning otherwise output during build.
You will also have to remove the file python/google/__init__.py otherwise it will interfere with Python's namespace logic and Python will not treat it as a namespace package (I think :D ).
Can you include the warning you hit without this?
Also you'll need to rebase to run the tests.
Here's the error:
+ python3 setup.py sdist
/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/sandbox/linux-sandbox/7457/execroot/com_google_protobuf/external/pip_deps_setuptools/site-packages/setuptools/dist.py:679: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!
********************************************************************************
Please replace its usage with implicit namespaces (PEP 420).
See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************
!!
ep.load()(self, ep.name, value)
And I've rebased now, so it should be good to go!