From d67287710422ac731e85c9ec7c16826714c8f06d Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 15:25:18 +0900 Subject: [PATCH 01/16] Pin test dependencies --- tox.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 13df4b0..b5d4648 100644 --- a/tox.ini +++ b/tox.ini @@ -4,11 +4,11 @@ minversion = 1.6.0 [testenv] deps = - flake8 >= 3.3.0 - flake8-import-order-spoqa - pytest >= 3.0.7, < 3.1.0 - pytest-flake8 >= 0.8.1, < 0.9.0 - testtools + flake8 >= 3.5.0, < 3.8.0 + flake8-import-order-spoqa >= 1.5.0, < 2.0.0 + pytest >= 3.5.0, < 4.0.0 + pytest-flake8 >= 1.0.4, < 1.1.0 + testtools >= 2.3.0, < 3.0.0 # testtools is required by dirspec commands = flake8 geofrontcli From a50df2b9f6b2479af45741c3873bee90fa463ead Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 15:25:44 +0900 Subject: [PATCH 02/16] Fix lint errors --- geofrontcli/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geofrontcli/client.py b/geofrontcli/client.py index 95af5d2..4b8caa3 100644 --- a/geofrontcli/client.py +++ b/geofrontcli/client.py @@ -19,7 +19,7 @@ from .key import PublicKey from .ssl import create_urllib_https_handler -from .version import MIN_PROTOCOL_VERSION, MAX_PROTOCOL_VERSION, VERSION +from .version import MAX_PROTOCOL_VERSION, MIN_PROTOCOL_VERSION, VERSION __all__ = ('REMOTE_PATTERN', 'BufferedResponse', 'Client', 'ExpiredTokenIdError', @@ -197,7 +197,7 @@ def remotes(self): extra={'user_waiting': False}) return dict((alias, fmt(remote)) for alias, remote in result.items()) - except: + except Exception: logger.info('Failed to fetch the list of remotes.', extra={'user_waiting': False}) raise @@ -227,7 +227,7 @@ def authorize(self, alias): logger.info('Authentication is required.', extra={'user_waiting': False}) raise - except: + except Exception: logger.info('Authorization to %s has failed.', alias, extra={'user_waiting': False}) raise From 212277211d36954d2003e89a8468f48310fabaa1 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 15:32:29 +0900 Subject: [PATCH 03/16] Don't need to run flake8 twice pytest-flake8 handles them. --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index b5d4648..eaf2523 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,6 @@ deps = testtools >= 2.3.0, < 3.0.0 # testtools is required by dirspec commands = - flake8 geofrontcli py.test {posargs:--durations=5} [pytest] From 2f1c3f8372d704ff83a69106587b85d6809f77be Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 16:44:51 +0900 Subject: [PATCH 04/16] Handle KeyboardInterrupt as normal exit No more traceback while pressing Ctrl+C. --- geofrontcli/cli.py | 7 +++++++ geofrontcli/client.py | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/geofrontcli/cli.py b/geofrontcli/cli.py index 9bb6db9..3962a5a 100644 --- a/geofrontcli/cli.py +++ b/geofrontcli/cli.py @@ -456,6 +456,13 @@ def prepend_lines(c, text): def main(args=None): + try: + _run(args) + except KeyboardInterrupt: + parser.exit() + + +def _run(args=None): args = parser.parse_args(args) log_handler = logging.StreamHandler(sys.stdout) log_handler.addFilter(UserWaitingFilter()) diff --git a/geofrontcli/client.py b/geofrontcli/client.py index 4b8caa3..5f1a268 100644 --- a/geofrontcli/client.py +++ b/geofrontcli/client.py @@ -197,6 +197,10 @@ def remotes(self): extra={'user_waiting': False}) return dict((alias, fmt(remote)) for alias, remote in result.items()) + except KeyboardInterrupt: + logger.info('Request is aborted.', + extra={'user_waiting': False}) + raise except Exception: logger.info('Failed to fetch the list of remotes.', extra={'user_waiting': False}) @@ -227,6 +231,10 @@ def authorize(self, alias): logger.info('Authentication is required.', extra={'user_waiting': False}) raise + except KeyboardInterrupt: + logger.info('Authorization is aborted.', + extra={'user_waiting': False}) + raise except Exception: logger.info('Authorization to %s has failed.', alias, extra={'user_waiting': False}) From 608d400813c719ba0c135c4fee46dea1576c21dc Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 17:26:36 +0900 Subject: [PATCH 05/16] Drop support for Python 3.3, PyPy 5.3 or below --- .travis.yml | 7 ++----- setup.py | 15 +++------------ tox.ini | 2 +- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab6593a..8296b2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,10 @@ matrix: # See also: https://github.com/Homebrew/homebrew-core/issues/6949 - os: linux language: python - python: pypy-5.3.1 + python: pypy-5.4 - os: linux language: python python: 2.7 - - os: linux - language: python - python: 3.3 - os: linux language: python python: 3.4 @@ -28,7 +25,7 @@ install: pip install --upgrade pip setuptools tox-travis; elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew tap drolando/homebrew-deadsnakes; - brew install python33 python34 python35 python3 pypy + brew install python34 python35 python3 pypy pip install --upgrade pip setuptools pip install --user tox; fi diff --git a/setup.py b/setup.py index 30c3e37..64fe046 100644 --- a/setup.py +++ b/setup.py @@ -28,17 +28,10 @@ def readme(): 'six', } -below_py34_requires = { - 'enum34', -} - win32_requires = { 'pypiwin32', } -if sys.version_info < (3, 4): - install_requires.update(below_py34_requires) - if sys.platform == 'win32': install_requires.update(win32_requires) @@ -62,7 +55,6 @@ def readme(): ''', install_requires=list(install_requires), extras_require={ - ":python_version<'3.4'": list(below_py34_requires), ":sys_platform=='win32'": list(win32_requires), }, classifiers=[ @@ -75,7 +67,6 @@ def readme(): 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -90,7 +81,7 @@ def readme(): if 'bdist_wheel' in sys.argv and ( below_py34_requires.issubset(install_requires) or win32_requires.issubset(install_requires)): - warnings.warn('Building wheels on Windows or using below Python 3.4 is ' - 'not recommended since platform-specific dependencies can ' - 'be merged into common dependencies:\n' + + warnings.warn('Building wheels on Windows is not recommended since ' + 'platform-specific dependencies can be merged into common ' + 'dependencies:\n' + '\n'.join('- ' + i for i in install_requires)) diff --git a/tox.ini b/tox.ini index eaf2523..f602bcc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pypy, py27, py33, py34, py35, py36 +envlist = pypy, py27, py34, py35, py36 minversion = 1.6.0 [testenv] From 3bd2c99bc9483c9c952e5b9e5e377b7c840e504a Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 17:27:10 +0900 Subject: [PATCH 06/16] Add support for Python up to 3.7 and PyPy 7.1 --- .travis.yml | 23 ++++++++++++++++++++++- setup.py | 1 + tox.ini | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8296b2d..cde5b42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,24 @@ matrix: - os: linux language: python python: pypy-5.4 + - os: linux + language: python + python: pypy2.7-5.10 + - os: linux + language: python + python: pypy3.5-5.10 + - os: linux + language: python + python: pypy2.7-6.0 + - os: linux + language: python + python: pypy3.5-6.0 + - os: linux + language: python + python: pypy2.7-7.1 + - os: linux + language: python + python: pypy3.5-7.1 - os: linux language: python python: 2.7 @@ -19,13 +37,16 @@ matrix: - os: linux language: python python: 3.6 + - os: linux + language: python + python: 3.7 install: | if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then pip install --upgrade pip setuptools tox-travis; elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew tap drolando/homebrew-deadsnakes; - brew install python34 python35 python3 pypy + brew install python34 python35 python36 python3 pypy pip install --upgrade pip setuptools pip install --user tox; fi diff --git a/setup.py b/setup.py index 64fe046..73dc764 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ def readme(): 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: System :: Systems Administration :: Authentication/Directory', # noqa: E501 diff --git a/tox.ini b/tox.ini index f602bcc..73330fe 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pypy, py27, py34, py35, py36 +envlist = pypy, py27, py34, py35, py36, py37 minversion = 1.6.0 [testenv] From c198aae050ef7d566511c42e048b8f67c3bc6f79 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 18:05:12 +0900 Subject: [PATCH 07/16] Jump to Xenial --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index cde5b42..5a85726 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +dist: xenial matrix: include: - os: osx From 59abb85e729636a539d350ff2dae532f86cc62a1 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 18:09:06 +0900 Subject: [PATCH 08/16] Shorten the build matrix --- .travis.yml | 52 ++++++++++++++++------------------------------------ 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a85726..93fd76e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,26 @@ sudo: false dist: xenial +os: linux +language: python +python: +- 'pypy-5.4' +- 'pypy2.7-5.10' +- 'pypy3.5-5.10' +- 'pypy2.7-6.0' +- 'pypy3.5-6.0' +- 'pypy2.7-7.1' +- 'pypy3.5-7.1' +- '2.7' +- '3.4' +- '3.5' +- '3.6' +- '3.7' matrix: include: - os: osx + language: generic osx_image: xcode8.1 # See also: https://github.com/Homebrew/homebrew-core/issues/6949 - - os: linux - language: python - python: pypy-5.4 - - os: linux - language: python - python: pypy2.7-5.10 - - os: linux - language: python - python: pypy3.5-5.10 - - os: linux - language: python - python: pypy2.7-6.0 - - os: linux - language: python - python: pypy3.5-6.0 - - os: linux - language: python - python: pypy2.7-7.1 - - os: linux - language: python - python: pypy3.5-7.1 - - os: linux - language: python - python: 2.7 - - os: linux - language: python - python: 3.4 - - os: linux - language: python - python: 3.5 - - os: linux - language: python - python: 3.6 - - os: linux - language: python - python: 3.7 install: | if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then From 7eca69dcffff1fcbd92f5ace588adef3fbd68c98 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 18:23:31 +0900 Subject: [PATCH 09/16] Retain available Python versions --- .travis.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93fd76e..fbd645a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,18 +3,13 @@ dist: xenial os: linux language: python python: -- 'pypy-5.4' -- 'pypy2.7-5.10' -- 'pypy3.5-5.10' -- 'pypy2.7-6.0' -- 'pypy3.5-6.0' -- 'pypy2.7-7.1' -- 'pypy3.5-7.1' -- '2.7' -- '3.4' -- '3.5' -- '3.6' - '3.7' +- '3.6' +- '3.5' +- '3.4' +- '2.7' +- 'pypy3.5-6.0' +- 'pypy2.7-6.0' matrix: include: - os: osx From 2dc001a5a4d6e2d9b23a3d58aebff2c8601ba4a1 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 18:25:44 +0900 Subject: [PATCH 10/16] Upgrade to xcode9.4 xcode8.1 already obsoleted. Previous builds are fallen back to default version (xcode9.4) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fbd645a..d13fded 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ python: matrix: include: - os: osx + osx_image: xcode9.4 language: generic - osx_image: xcode8.1 - # See also: https://github.com/Homebrew/homebrew-core/issues/6949 + python: null install: | if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then From 80a112f5ffc68d10710819ce9a547c7bb70968b0 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 19:03:25 +0900 Subject: [PATCH 11/16] Use xcode10.2 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d13fded..f2d703e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,17 +13,17 @@ python: matrix: include: - os: osx - osx_image: xcode9.4 + osx_image: xcode10.2 language: generic python: null install: | if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then - pip install --upgrade pip setuptools tox-travis; + pip install --upgrade pip setuptools tox-travis elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - brew tap drolando/homebrew-deadsnakes; + brew tap drolando/homebrew-deadsnakes brew install python34 python35 python36 python3 pypy pip install --upgrade pip setuptools - pip install --user tox; + pip install tox fi script: tox From ef4f1c853e3214bbfc224f5c7ba5e3954ec208bc Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 23:01:45 +0900 Subject: [PATCH 12/16] Fix macOS test to install zlib explicitly --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index f2d703e..a3b50dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ install: pip install --upgrade pip setuptools tox-travis elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew tap drolando/homebrew-deadsnakes + brew install zlib brew install python34 python35 python36 python3 pypy pip install --upgrade pip setuptools pip install tox From 00127a6aa5d8ec0df1b6a04fef5891311749e4b4 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Thu, 16 May 2019 23:35:34 +0900 Subject: [PATCH 13/16] Just use builtin pyenv and tox --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a3b50dc..9549ba5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,13 @@ install: if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then pip install --upgrade pip setuptools tox-travis elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - brew tap drolando/homebrew-deadsnakes - brew install zlib - brew install python34 python35 python36 python3 pypy - pip install --upgrade pip setuptools - pip install tox + export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib" + export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include" + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig" + versions=(3.7.2 3.6.8 3.5.6 3.4.9 2.7.15 pypy3.5-6.0 pypy2.7-6.0.0) + for ver in $versions; do + pyenv install -s "$ver" + done + pyenv global $versions fi script: tox From 0d9b0f05c677c78512048177a10c72b8ce3a10c1 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Fri, 17 May 2019 00:16:35 +0900 Subject: [PATCH 14/16] Install sqlite3 and make pyenv verbose --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9549ba5..9d59cc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,10 @@ install: export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib" export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include" export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig" + brew install sqlite3 versions=(3.7.2 3.6.8 3.5.6 3.4.9 2.7.15 pypy3.5-6.0 pypy2.7-6.0.0) for ver in $versions; do - pyenv install -s "$ver" + pyenv install --verbose --skip-existing "$ver" done pyenv global $versions fi From 37e7ff4b0909b325653e3eee7752504bf996a868 Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Fri, 17 May 2019 00:27:09 +0900 Subject: [PATCH 15/16] Locate the path to sqlite3 --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d59cc5..615caca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,10 +21,9 @@ install: if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then pip install --upgrade pip setuptools tox-travis elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib" - export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include" - export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig" - brew install sqlite3 + export LDFLAGS="${LDFLAGS} -L/usr/local/opt/sqlite3/lib -L/usr/local/opt/zlib/lib" + export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/sqlite3/include -I/usr/local/opt/zlib/include" + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/sqlite3/lib/pkgconfig /usr/local/opt/zlib/lib/pkgconfig" versions=(3.7.2 3.6.8 3.5.6 3.4.9 2.7.15 pypy3.5-6.0 pypy2.7-6.0.0) for ver in $versions; do pyenv install --verbose --skip-existing "$ver" From cefa862640a096f808126418c9c8331e001c090b Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Fri, 17 May 2019 00:44:13 +0900 Subject: [PATCH 16/16] Try to trust Travis --- .travis.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 615caca..e3698e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ sudo: false dist: xenial -os: linux +os: +- linux +- osx +osx_image: +- xcode10.2 language: python python: - '3.7' @@ -10,24 +14,7 @@ python: - '2.7' - 'pypy3.5-6.0' - 'pypy2.7-6.0' -matrix: - include: - - os: osx - osx_image: xcode10.2 - language: generic - python: null install: | - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then - pip install --upgrade pip setuptools tox-travis - elif [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - export LDFLAGS="${LDFLAGS} -L/usr/local/opt/sqlite3/lib -L/usr/local/opt/zlib/lib" - export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/sqlite3/include -I/usr/local/opt/zlib/include" - export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/sqlite3/lib/pkgconfig /usr/local/opt/zlib/lib/pkgconfig" - versions=(3.7.2 3.6.8 3.5.6 3.4.9 2.7.15 pypy3.5-6.0 pypy2.7-6.0.0) - for ver in $versions; do - pyenv install --verbose --skip-existing "$ver" - done - pyenv global $versions - fi + pip install --upgrade pip setuptools tox-travis script: tox