diff --git a/.travis.yml b/.travis.yml index b12b28b..63858f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,27 @@ language: python -sudo: required -dist: trusty -python: - - "2.7" - - "3.4" - - "3.5.2" +dist: xenial +matrix: + include: + - python: "2.7" + env: + - ALLOW_DOC_DEPLOY=false + - ALLOW_PYPI_DEPLOY=false + - python: "3.4" + env: + - ALLOW_DOC_DEPLOY=false + - ALLOW_PYPI_DEPLOY=false + - python: "3.5" + env: + - ALLOW_DOC_DEPLOY=false + - ALLOW_PYPI_DEPLOY=false + - python: "3.6" + env: + - ALLOW_DOC_DEPLOY=true + - ALLOW_PYPI_DEPLOY=true + - python: "3.7" + env: + - ALLOW_DOC_DEPLOY=false + - ALLOW_PYPI_DEPLOY=false addons: apt: packages: @@ -17,20 +34,20 @@ before_install: install: - pip install -U pip setuptools wheel - pip install -U pytest pytest-xdist pytest-cov coveralls - - sh -c "if [ '$TRAVIS_PYTHON_VERSION' = '3.5.2' ]; then pip install -r doc/requirements.txt; fi" + - sh -c "if [ '$ALLOW_DOC_DEPLOY' = 'true' ]; then pip install -r doc/requirements.txt; fi" - pip install -e . script: - - sh -c "if [ '$TRAVIS_PYTHON_VERSION' = '3.5.2' ]; then travis-sphinx build --source=doc/source --nowarn; fi" + - sh -c "if [ '$ALLOW_DOC_DEPLOY' = 'true' ]; then travis-sphinx build --source=doc/source --nowarn; fi" - py.test --cov-append --cov-config .coveragerc --cov=rtlsdr - py.test --cov-append --cov-config .coveragerc --cov=rtlsdr --boxed --no-overrides --pyargs tests/no_override* after_success: - coveralls - - sh -c "if [ '$TRAVIS_PYTHON_VERSION' = '3.5.2' ]; then travis-sphinx deploy; fi" + - sh -c "if [ '$ALLOW_DOC_DEPLOY' = 'true' ]; then travis-sphinx deploy; fi" deploy: provider: pypi distributions: "sdist bdist_wheel" on: - python: "3.5.2" + condition: $ALLOW_PYPI_DEPLOY = true tags: true user: nocarryr password: diff --git a/setup.py b/setup.py index 35a0a5e..b0dc42c 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,8 @@ def read_rst(): 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Topic :: Utilities'], license='GPLv3', keywords='radio librtlsdr rtlsdr sdr', diff --git a/tests/utils.py b/tests/utils.py index 474ef1f..5466c65 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -14,13 +14,15 @@ def iter_test_samples(num_samples=None): count = 0 - while True: + complete = False + while not complete: for i, q in zip(range(256), range(255, -1, -1)): yield i, q if num_samples is not None: count += 1 if count >= num_samples: - raise StopIteration() + complete = True + break def iter_test_bytes(num_bytes=None): count = 0 @@ -28,18 +30,21 @@ def iter_test_bytes(num_bytes=None): num_samples = num_bytes // 2 else: num_samples = None - while True: + complete = False + while not complete: for i, q in iter_test_samples(num_samples): yield i if num_bytes is not None: count += 1 if count >= num_bytes: - raise StopIteration() + complete = True + break yield q if num_bytes is not None: count += 1 if count >= num_bytes: - raise StopIteration() + complete = True + break def check_generated_data(samples, direct_sampling=0, use_numpy=True): if not is_travisci():