From 12ff3f8d3103bc48f5ac8e3e66eec71cd87c32c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Bouliane?= Date: Tue, 31 Mar 2020 10:03:04 -0400 Subject: [PATCH] Ubersmith client doesn't package pbr anymore PBR is a setup_requires, it does not require to be published alongside the package. Also added tests for python3.4 -> 3.8, fix pep8 and added dependencies pinning for repeatable tests. Bonus: Add readme.rst as documentation --- .travis.yml | 47 ++++++++++++++++++++++----------- constraints.txt | 26 ++++++++++++++++++ requirements.txt | 1 - setup.cfg | 6 +++++ test-requirements.txt | 7 ++--- tox.ini | 19 ++++++++++++- ubersmith_client/_http_utils.py | 2 +- 7 files changed, 86 insertions(+), 22 deletions(-) create mode 100644 constraints.txt diff --git a/.travis.yml b/.travis.yml index 64146d6..cfdcc04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,39 @@ language: python python: - - '2.7' + - '3.8' + - '3.7' + - '3.6' + - '3.5' - '3.4' + - '2.7' install: - - pip install -r requirements.txt - - pip install -r test-requirements.txt + - pip install tox-travis + +script: tox -script: - - nosetests - - flake8 +jobs: + include: + - stage: test + name: pep8 + python: 3.8 + script: tox -e pep8 + - name: latest + python: 3.8 + script: tox -e latest -deploy: - provider: pypi - user: internaphosting - password: - secure: fZxfMePJQroeiLQb+lmpNiEEMvRONOVt4yTQY8CmemyVMOe4TVZUfsBzCMa7eZkUaFZuHfNaUo/4Jmhn15EruzGhqBLRe5fpuFxFqJqDJ7ZmPMTRBIMKUsRuYrG6vc9YmG8CLfLvxwG8OUoLzND+rz+QwWaFruFeDlkCN3xMpzRHcdopcKlKoKwUJCkPzqEm0qeziTsRNixLbrBHzfr+FY96FDclE2GDywUBCacPzwP+R9QwPKU74NevlD+MazP/bYcZHY8DKDQ2X4L7NSr/8osJswVvCCoOqqqFPsPLaVzhDLU1hvTSW44K3hUSlRmKWzmdfFutkPix4Zrge9JYzTOodV921WgFLSsSPcpwEoRMZM21hoFhO6PThd9ag33z1rUxXzAJxBYfjM5OP+2g6gqWDptyJp8OgdqjzoCKFsXBrINf+vb+Ossdtl2+W1fzBjHlV9D8t6gf7ekJZmTAKzfYcvrRc++gnZwlwmPWrr5qBUSxT9SEqln7L/u4RbHxZdAOzYivPBvrL1ncdwUx9kvzbelr1wolc0aszodRgx8S7aWZ7V4CbuE6LpNkRREJ+EY71MYInpCRO81XabAIEG7T7i11ZkNexxQAe5Mafy/nSw5cGWirIAcLEO7WU3tSd5rteP7hgp28VJ9XfGZPwH9Q1FqiNMpKk+Db6PwplDE= - on: - tags: true - python: 3.4 - distributions: sdist bdist_wheel - repo: internap/python-ubersmithclient + - stage: deploy + python: 3.8 + script: skip + deploy: + provider: pypi + user: internaphosting + password: + secure: fZxfMePJQroeiLQb+lmpNiEEMvRONOVt4yTQY8CmemyVMOe4TVZUfsBzCMa7eZkUaFZuHfNaUo/4Jmhn15EruzGhqBLRe5fpuFxFqJqDJ7ZmPMTRBIMKUsRuYrG6vc9YmG8CLfLvxwG8OUoLzND+rz+QwWaFruFeDlkCN3xMpzRHcdopcKlKoKwUJCkPzqEm0qeziTsRNixLbrBHzfr+FY96FDclE2GDywUBCacPzwP+R9QwPKU74NevlD+MazP/bYcZHY8DKDQ2X4L7NSr/8osJswVvCCoOqqqFPsPLaVzhDLU1hvTSW44K3hUSlRmKWzmdfFutkPix4Zrge9JYzTOodV921WgFLSsSPcpwEoRMZM21hoFhO6PThd9ag33z1rUxXzAJxBYfjM5OP+2g6gqWDptyJp8OgdqjzoCKFsXBrINf+vb+Ossdtl2+W1fzBjHlV9D8t6gf7ekJZmTAKzfYcvrRc++gnZwlwmPWrr5qBUSxT9SEqln7L/u4RbHxZdAOzYivPBvrL1ncdwUx9kvzbelr1wolc0aszodRgx8S7aWZ7V4CbuE6LpNkRREJ+EY71MYInpCRO81XabAIEG7T7i11ZkNexxQAe5Mafy/nSw5cGWirIAcLEO7WU3tSd5rteP7hgp28VJ9XfGZPwH9Q1FqiNMpKk+Db6PwplDE= + on: + tags: true + distributions: sdist bdist_wheel + repo: internap/python-ubersmithclient + allow_failures: + - name: latest diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 0000000..5f810fa --- /dev/null +++ b/constraints.txt @@ -0,0 +1,26 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --no-emit-trusted-host --no-index --output-file=constraints.txt setup.py test-requirements.txt +# +certifi==2019.11.28 # via requests +chardet==3.0.4 # via requests +click==7.0 # via pip-tools +entrypoints==0.3 # via flake8 +flake8==3.7.9 +idna==2.8 # via requests +mccabe==0.6.1 # via flake8 +mock==3.0.5 +nose==1.3.7 +pip-tools==3.9.0 +pycodestyle==2.5.0 # via flake8 +pyflakes==2.1.1 # via flake8 +pyhamcrest==1.9.0 +requests==2.21.0 +six==1.14.0 # via mock, pip-tools, pyhamcrest +typing==3.7.4.1 # via flake8 +urllib3==1.24.3 # via requests + +# The following packages are considered to be unsafe in a requirements file: +# setuptools==43.0.0 # via pyhamcrest diff --git a/requirements.txt b/requirements.txt index 39d4f77..f229360 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -pbr>=1.8 requests diff --git a/setup.cfg b/setup.cfg index 83a5503..91fc041 100755 --- a/setup.cfg +++ b/setup.cfg @@ -11,6 +11,12 @@ classifier = Operating System :: POSIX Programming Language :: Python :: 2.7 Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 +description-file = README.rst +description-content-type = text/x-rst; charset=UTF-8 [files] packages = diff --git a/test-requirements.txt b/test-requirements.txt index bb0dfc5..7178b47 100755 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,5 @@ -nose==1.2.1 -pyhamcrest==1.8.1 -mock==1.3.0 +nose +pyhamcrest<2.0.0 +mock flake8 +pip-tools diff --git a/tox.ini b/tox.ini index ef011f1..01f5130 100755 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,32 @@ [tox] -envlist = py34,py27,pep8 +envlist = py34,py35,py36,py37,py38,py27,pep8 [testenv] deps = -r{toxinidir}/test-requirements.txt +install_command = python -m pip install -c constraints.txt {opts} {packages} commands = nosetests +[testenv:latest] +deps = -r{toxinidir}/test-requirements.txt +basepython = python3.8 +install_command = python -m pip install {opts} {packages} +commands = + nosetests + [testenv:pep8] deps = -r{toxinidir}/test-requirements.txt commands = flake8 {posargs} +[testenv:bump-dependencies] +basepython = python3.4 +skip_install = true +deps = + pip-tools +commands = + pip-compile --upgrade --no-index --no-emit-trusted-host --output-file constraints.txt setup.py test-requirements.txt + + [flake8] show-source = True max-line-length = 120 diff --git a/ubersmith_client/_http_utils.py b/ubersmith_client/_http_utils.py index 0de20b7..6752777 100644 --- a/ubersmith_client/_http_utils.py +++ b/ubersmith_client/_http_utils.py @@ -23,7 +23,7 @@ def form_encode(data): def form_encode_without_files(data): - return form_encode({k: v for k, v in data.items() if k is not 'files'}) + return form_encode({k: v for k, v in data.items() if k != 'files'}) def _explode_enumerable(k, v):