From b4792e6870a736f04531f04dd1941bd3f40ca224 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 31 Jan 2019 14:53:06 -0800 Subject: [PATCH 1/4] add test for importing the built package --- .circleci/config.yml | 2 +- {scripts => test-packaging}/test-packaging.sh | 5 +++-- test-packaging/test.py | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) rename {scripts => test-packaging}/test-packaging.sh (76%) create mode 100644 test-packaging/test.py diff --git a/.circleci/config.yml b/.circleci/config.yml index ec3070fc..603bbf54 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,7 @@ test-template: &test-template command: | if [[ "$CIRCLE_JOB" != "test-3.3" ]]; then sudo rm -rf dist *.egg-info; - ./scripts/test-packaging.sh; + ./test-packaging/test-packaging.sh; fi - store_test_results: path: test-reports diff --git a/scripts/test-packaging.sh b/test-packaging/test-packaging.sh similarity index 76% rename from scripts/test-packaging.sh rename to test-packaging/test-packaging.sh index 8fcb7e3a..50a40364 100755 --- a/scripts/test-packaging.sh +++ b/test-packaging/test-packaging.sh @@ -5,10 +5,11 @@ set -e rm -rf dist python setup.py sdist -rm -rf test-packaging -mkdir test-packaging cd test-packaging +rm -rf env virtualenv env source env/bin/activate pip install ../dist/*.tar.gz + +python test.py diff --git a/test-packaging/test.py b/test-packaging/test.py new file mode 100644 index 00000000..5337cb2e --- /dev/null +++ b/test-packaging/test.py @@ -0,0 +1,3 @@ +import ldclient + +print("Successfully installed and imported ldclient") From 7c2b501794eb4c992314d99d7fe57855c05dafc2 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 31 Jan 2019 14:59:39 -0800 Subject: [PATCH 2/4] add submodule imports --- test-packaging/test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test-packaging/test.py b/test-packaging/test.py index 5337cb2e..62f8b636 100644 --- a/test-packaging/test.py +++ b/test-packaging/test.py @@ -1,3 +1,5 @@ import ldclient +import ldclient.integrations +import ldclient.interfaces print("Successfully installed and imported ldclient") From a9d481ce7a5efca76db29f719787cf7be5fbfb21 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 31 Jan 2019 15:08:17 -0800 Subject: [PATCH 3/4] ensure that all packages are included in distribution --- setup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 7d3c80cc..92d0c7d0 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,4 @@ -try: - from setuptools import setup, Command -except ImportError: - from distutils.core import setup +from setuptools import setup, Command import sys import uuid @@ -51,7 +48,7 @@ def run(self): version=ldclient_version, author='LaunchDarkly', author_email='team@launchdarkly.com', - packages=['ldclient'], + packages=find_packages(), url='https://github.com/launchdarkly/python-client', description='LaunchDarkly SDK for Python', long_description='LaunchDarkly SDK for Python', From 71b821f969377d403635187b8941046e31e31156 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 31 Jan 2019 15:09:27 -0800 Subject: [PATCH 4/4] fix import --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 92d0c7d0..3c3a06b5 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, Command +from setuptools import find_packages, setup, Command import sys import uuid