From 3773feb2fc24295ffb2aa02b5e3574e6e2599f6e Mon Sep 17 00:00:00 2001
From: Zoey Greer <zoey@buildbuddy.io>
Date: Tue, 26 Nov 2024 12:33:55 -0800
Subject: [PATCH] Fix deprecated use of `namespace_packages` in
 `python/dist/setup.py` (#18235)

Uses implicit namespaces instead of explicit, as per https://peps.python.org/pep-0420/

Fixes a warning otherwise output during build.

Closes #18235

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18235 from tempoz:tempoz-fix-deprecated-use-of-namespace-packages 85067b6fa2ceec3b38a575b8ffd4f8ce60be64cb
PiperOrigin-RevId: 700426731
---
 python/dist/setup.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/python/dist/setup.py b/python/dist/setup.py
index b0ee4c35dd5b3..4a92a4de17ae2 100755
--- a/python/dist/setup.py
+++ b/python/dist/setup.py
@@ -12,7 +12,7 @@
 import os
 import sys
 
-from setuptools import setup, Extension, find_packages
+from setuptools import setup, Extension, find_namespace_packages
 
 
 def GetVersion():
@@ -59,8 +59,7 @@ def GetVersion():
         'Programming Language :: Python :: 3.12',
         'Programming Language :: Python :: 3.13',
     ],
-    namespace_packages=['google'],
-    packages=find_packages(),
+    packages=find_namespace_packages(include=['google*']),
     install_requires=[],
     ext_modules=[
         Extension(
