From eaa0cd87652854cc69ea96f5c1ddcf75e426b01f Mon Sep 17 00:00:00 2001 From: Rushi Agrawal Date: Sat, 18 Sep 2021 02:07:16 +0530 Subject: [PATCH] Update setup.py to correctly pick up Python files And also re-update package name in utils/build-dists.py so that it is uninstalled successfully Signed-off-by: Rushi Agrawal --- setup.py | 3 ++- utils/build-dists.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 74c3d032..e432cf94 100644 --- a/setup.py +++ b/setup.py @@ -41,10 +41,11 @@ with open(join(base_dir, package_name.replace("-", ""), "_version.py")) as f: with open(join(base_dir, "README.md")) as f: long_description = f.read().strip() +module_dir = package_name.replace("-", "") packages = [ package for package in find_packages(where=".", exclude=("test_opensearchpy*",)) - if package == package_name or package.startswith(package_name + ".") + if package == module_dir or package.startswith(module_dir + ".") ] install_requires = [ diff --git a/utils/build-dists.py b/utils/build-dists.py index dab8bd2b..11ede687 100644 --- a/utils/build-dists.py +++ b/utils/build-dists.py @@ -161,7 +161,14 @@ def test_dist(dist): ) # Uninstall the dist, see that we can't import things anymore - run(venv_python, "-m", "pip", "uninstall", "--yes", dist_name) + run( + venv_python, + "-m", + "pip", + "uninstall", + "--yes", + dist_name.replace("opensearchpy", "opensearch-py"), + ) run( venv_python, "-c",