From b112e87130f42c6698b94340920bb9afcbbb7b33 Mon Sep 17 00:00:00 2001 From: Ted Crossman Date: Tue, 25 Jan 2022 11:03:52 -0800 Subject: [PATCH 1/2] Use find_packages() to get nested packages (closes #575) When openapi-python-client is used to with the --meta=setup option the generated setup.py needs to use setuptools.find_packages() to find the top-level and all of the nested pacakges in the directory so that distributions include them --- openapi_python_client/templates/setup.py.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi_python_client/templates/setup.py.jinja b/openapi_python_client/templates/setup.py.jinja index 9fa4fee79..33b755180 100644 --- a/openapi_python_client/templates/setup.py.jinja +++ b/openapi_python_client/templates/setup.py.jinja @@ -1,6 +1,6 @@ import pathlib -from setuptools import setup +from setuptools import setup, find_packages here = pathlib.Path(__file__).parent.resolve() long_description = (here / "README.md").read_text(encoding="utf-8") @@ -11,7 +11,7 @@ setup( description="{{ package_description }}", long_description=long_description, long_description_content_type="text/markdown", - packages=["{{ package_name }}"], + packages=find_packages(), python_requires=">=3.7, <4", install_requires=["httpx >= 0.15.0, < 0.22.0", "attrs >= 21.3.0", "python-dateutil >= 2.8.0, < 3"], package_data={"{{ package_name }}": ["py.typed"]}, From 26f7acab5478e56951f418a4c223c63afbcb0df6 Mon Sep 17 00:00:00 2001 From: Ted Crossman Date: Tue, 25 Jan 2022 14:14:20 -0800 Subject: [PATCH 2/2] Fix order of imports --- openapi_python_client/templates/setup.py.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi_python_client/templates/setup.py.jinja b/openapi_python_client/templates/setup.py.jinja index 33b755180..d1e790933 100644 --- a/openapi_python_client/templates/setup.py.jinja +++ b/openapi_python_client/templates/setup.py.jinja @@ -1,6 +1,6 @@ import pathlib -from setuptools import setup, find_packages +from setuptools import find_packages, setup here = pathlib.Path(__file__).parent.resolve() long_description = (here / "README.md").read_text(encoding="utf-8")