aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Shepelev <temotor@gmail.com>2018-03-17 02:33:19 +0300
committerSergey Shepelev <temotor@gmail.com>2018-03-17 04:56:04 +0300
commit55d878033657945b19535a8451feafba7b8923ec (patch)
tree93a05d8902b707b6605274e05a1a4a6ab559175e
parent586cccee9bf8e95e4d2938915be262035d2a79e5 (diff)
downloadplatform_external_python_httplib2-55d878033657945b19535a8451feafba7b8923ec.tar.gz
platform_external_python_httplib2-55d878033657945b19535a8451feafba7b8923ec.tar.bz2
platform_external_python_httplib2-55d878033657945b19535a8451feafba7b8923ec.zip
travis: test package build/install
setup: removed distutils fallback ; little pep8 clean-up
-rw-r--r--.travis.yml9
-rwxr-xr-xscript/test23
-rwxr-xr-xsetup.py37
3 files changed, 40 insertions, 29 deletions
diff --git a/.travis.yml b/.travis.yml
index abf642e..66c662e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,8 +4,10 @@ language: python
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 @@ cache:
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 @@ test_flags=(
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 @@ else
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 @@ A comprehensive HTTP client library, ``httplib2`` supports many features left ou
**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 @@ A comprehensive HTTP client library, ``httplib2`` supports many features left ou
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries',
- ],
- )
+ ),
+)