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/setup.py b/setup.py index 7d3c80cc..3c3a06b5 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 find_packages, 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', 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..62f8b636 --- /dev/null +++ b/test-packaging/test.py @@ -0,0 +1,5 @@ +import ldclient +import ldclient.integrations +import ldclient.interfaces + +print("Successfully installed and imported ldclient")