From b001ee15549043d137f1db85913955617152930f Mon Sep 17 00:00:00 2001 From: Jiashuo Li Date: Mon, 17 Feb 2020 22:13:53 +0800 Subject: [PATCH 1/5] drop python 2 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ea7580..c0b9447 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ sudo: false language: python python: -- '2.7' -- '3.5' - '3.6' +- '3.7' +- '3.8' install: pip install tox-travis script: tox deploy: From ff098232f9c3dfd70f63ddc33ca47cbc0f596661 Mon Sep 17 00:00:00 2001 From: Jiashuo Li Date: Mon, 17 Feb 2020 22:35:34 +0800 Subject: [PATCH 2/5] update package versions --- requirements.txt | 6 +++--- setup.py | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 30f6d1d..8ac66d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ argcomplete==1.8.2 -colorama==0.3.9 +colorama==0.4.3 flake8==3.2.1 jmespath==0.9.2 mock==2.0.0 pylint==1.9.4; python_version <= '2.7' pylint==2.3.1; python_version >= '3.5' -pygments==2.2.0 -pyyaml==3.12 +pygments==2.5.2 +pyyaml==5.3 six==1.10.0 tabulate==0.7.7 vcrpy==1.10.3 diff --git a/setup.py b/setup.py index 5f1c1ab..6c18bc4 100644 --- a/setup.py +++ b/setup.py @@ -39,12 +39,11 @@ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], packages=['knack', 'knack.testsdk'], From e66c82822f28fc0fdde7fd6c831f89f197882aa9 Mon Sep 17 00:00:00 2001 From: Jiashuo Li Date: Mon, 17 Feb 2020 22:50:54 +0800 Subject: [PATCH 3/5] update --- requirements.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8ac66d1..247ba6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,12 @@ -argcomplete==1.8.2 +argcomplete==1.11.1 colorama==0.4.3 -flake8==3.2.1 -jmespath==0.9.2 -mock==2.0.0 -pylint==1.9.4; python_version <= '2.7' -pylint==2.3.1; python_version >= '3.5' -pygments==2.5.2 -pyyaml==5.3 -six==1.10.0 -tabulate==0.7.7 -vcrpy==1.10.3 -pytest==4.6.6 +flake8==3.7.9 +jmespath==0.9.4 +mock==4.0.1 +pylint==2.3.0 +Pygments==2.5.2 +PyYAML==5.3 +six==1.14.0 +tabulate==0.8.6 +vcrpy==4.0.2 +pytest==5.3.5 From ba2c527d712c9e6cdfabc081f092a63a6c6d141c Mon Sep 17 00:00:00 2001 From: Jiashuo Li Date: Mon, 17 Feb 2020 23:30:28 +0800 Subject: [PATCH 4/5] fix flake8 --- .flake8 | 6 +++++- tox.ini | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 063a6da..c31f9e8 100644 --- a/.flake8 +++ b/.flake8 @@ -4,6 +4,10 @@ max-complexity = 10 ignore = E126, E501, + E741, + E722, F401, F811, - C901 + C901, + W503, + W504 diff --git a/tox.ini b/tox.ini index dad6730..95c8a67 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py35,py36,py37 +envlist = py36,py37,py38 [testenv] deps = -rrequirements.txt commands= From 39ffa91b0a22f7c0ba0fc14d78a04f9dd6886b5b Mon Sep 17 00:00:00 2001 From: Jiashuo Li Date: Tue, 18 Feb 2020 01:10:09 +0800 Subject: [PATCH 5/5] fix test on Windows --- tests/test_config.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index aa49dd3..bf71f48 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -186,13 +186,15 @@ def test_set_config_value_file_permissions(self): file_mode = os.stat(self.cli_config.config_path).st_mode self.assertTrue(bool(file_mode & stat.S_IRUSR)) self.assertTrue(bool(file_mode & stat.S_IWUSR)) - self.assertFalse(bool(file_mode & stat.S_IXUSR)) - self.assertFalse(bool(file_mode & stat.S_IRGRP)) - self.assertFalse(bool(file_mode & stat.S_IWGRP)) - self.assertFalse(bool(file_mode & stat.S_IXGRP)) - self.assertFalse(bool(file_mode & stat.S_IROTH)) - self.assertFalse(bool(file_mode & stat.S_IWOTH)) - self.assertFalse(bool(file_mode & stat.S_IXOTH)) + # only S_IRUSR and S_IWUSR are supported on Windows: https://docs.python.org/3.8/library/os.html#os.chmod + if os.name != 'nt': + self.assertFalse(bool(file_mode & stat.S_IXUSR)) + self.assertFalse(bool(file_mode & stat.S_IRGRP)) + self.assertFalse(bool(file_mode & stat.S_IWGRP)) + self.assertFalse(bool(file_mode & stat.S_IXGRP)) + self.assertFalse(bool(file_mode & stat.S_IROTH)) + self.assertFalse(bool(file_mode & stat.S_IWOTH)) + self.assertFalse(bool(file_mode & stat.S_IXOTH)) def test_has_option_local(self): section = 'MySection'