travis: test package build/install

setup: removed distutils fallback ; little pep8 clean-up
diff --git a/.travis.yml b/.travis.yml
index abf642e..66c662e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,8 +4,10 @@
 matrix:
   fast_finish: true
   include:
-    - {python: 2.7, env: test_group=pep8}
-    - {python: 3.6, env: test_group=pep8}
+    - {env: test_group=package, python: 2.7}
+    - {env: test_group=package, python: 3.6}
+    - {env: test_group=pep8, python: 2.7}
+    - {env: test_group=pep8, python: 3.6}
     - {python: 2.7}
     - {python: 3.3}
     - {python: 3.4}
@@ -19,9 +21,6 @@
   pip: true
   directories:
     - $HOME/.cache
-addons:
-  apt_packages:
-    # - libssl-dev
 
 install:
   - pip install 'pip>=9.0' 'setuptools>=36.2' 'codecov>=2.0.15' -r requirements-test.txt
diff --git a/script/test b/script/test
index a88318b..4517afc 100755
--- a/script/test
+++ b/script/test
@@ -14,19 +14,28 @@
 
 cd "$( dirname "${BASH_SOURCE[0]}" )/.."
 if [[ -n "${CONTINUOUS_INTEGRATION-}" ]] ; then
-	if [[ "${test_group-}" = "pep8" ]] ; then
+	case "${test_group-}" in
+	pep8)
 		if [[ "${TRAVIS_PYTHON_VERSION}" = "2.7" ]] ; then
 			flake8 python2/
 		else
 			flake8 python3/ tests/
 		fi
-	else
+		;;
+	package)
+	    # TODO: sdist bdist_wheel
+	    # but wheels don't roll well with our 2/3 split code base
+		python setup.py sdist
+		pip install dist/httplib2*
+		;;
+	*)
 		pip install -e .
 		httplib2_test_still_run_skipped=1 pytest --fulltrace -k test_303 $@ tests/ || true
 		httplib2_test_still_run_skipped=1 pytest --fulltrace -k test_head_301 $@ tests/ || true
 		pytest --fulltrace ${test_flags[@]}
-	fi
-	codecov --flags=$(echo $python |tr -d -- '-.')
+		codecov --flags=$(echo $python |tr -d -- '-.')
+		;;
+	esac
 else
 	if [[ ! -d ./venv-27 ]] ; then
 		virtualenv --python=python2.7 ./venv-27
@@ -36,10 +45,16 @@
 		virtualenv --python=python3.6 ./venv-36
 		./venv-36/bin/pip install -e . -r requirements-test.txt
 	fi
+
 	./venv-27/bin/pytest ${test_flags[@]}
 	./venv-36/bin/pytest ${test_flags[@]}
+
 	# FIXME: too many errors
 	# ./venv-27/bin/flake8 python2/
 	# ./venv-36/bin/flake8 python3/ tests/
+
+    # TODO: sdist bdist_wheel
+    # but wheels don't roll well with our 2/3 split code base
+	./venv-36/bin/python setup.py sdist
 fi
 rm -rf ./_httplib2_test_cache
diff --git a/setup.py b/setup.py
index 8fb9f45..8a6eee7 100755
--- a/setup.py
+++ b/setup.py
@@ -1,20 +1,18 @@
-try:
-    from setuptools import setup
-except ImportError:
-    from distutils.core import setup
+import setuptools
 import sys
 
 pkgdir = {'': 'python%s' % sys.version_info[0]}
 VERSION = '0.10.3'
 
-setup(name='httplib2',
-        version=VERSION,
-        author='Joe Gregorio',
-        author_email='joe@bitworking.org',
-        url='https://github.com/httplib2/httplib2',
-        description='A comprehensive HTTP client library.',
-        license='MIT',
-        long_description="""
+setuptools.setup(
+    name='httplib2',
+    version=VERSION,
+    author='Joe Gregorio',
+    author_email='joe@bitworking.org',
+    url='https://github.com/httplib2/httplib2',
+    description='A comprehensive HTTP client library.',
+    license='MIT',
+    long_description="""
 
 A comprehensive HTTP client library, ``httplib2`` supports many features left out of other HTTP libraries.
 
@@ -57,12 +55,11 @@
 
 **Unit Tested**
   A large and growing set of unit tests.
-
-        """,
-        package_dir=pkgdir,
-        packages=['httplib2'],
-        package_data={'httplib2': ['*.txt']},
-        classifiers=[
+""",
+    package_dir=pkgdir,
+    packages=['httplib2'],
+    package_data={'httplib2': ['*.txt']},
+    classifiers=(
         'Development Status :: 4 - Beta',
         'Environment :: Web Environment',
         'Intended Audience :: Developers',
@@ -73,5 +70,5 @@
         'Programming Language :: Python :: 3',
         'Topic :: Internet :: WWW/HTTP',
         'Topic :: Software Development :: Libraries',
-        ],
-        )
+    ),
+)