https://github.com/FFY00/python-pyproject-metadata/pull/24
--- a/setup.cfg
+++ b/setup.cfg
@@ -26,6 +26,10 @@ install_requires =
     packaging>=19.0
 python_requires = >=3.7
 
+[options.packages.find]
+exclude =
+    tests
+
 [options.extras_require]
 test =
     pytest>=6.2.4
