diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2019-06-18 13:03:45 +0200 |
---|---|---|
committer | Joris Roovers <joris.roovers@gmail.com> | 2019-06-18 14:34:06 +0200 |
commit | 3fc4c03276b0e15368da03eccb2b5d95e91c79a7 (patch) | |
tree | 010dbabe3c8b208f44977707d3da5ec23cd9e7d3 | |
parent | 157c0783170e290415e9eef4960b868bd42486a4 (diff) |
Updated dependencies
- Updated most dependencies to latest (or newer) versions
- Removed dependency pinning for Python 2.6 and 3.3
- Minor code-tweaks to deal with dependency changes
- Added pypi download stats to `run_tests.sh -s`
-rw-r--r-- | Vagrantfile | 2 | ||||
-rw-r--r-- | gitlint/tests/test_cli.py | 12 | ||||
-rw-r--r-- | requirements.txt | 10 | ||||
-rwxr-xr-x | run_tests.sh | 10 | ||||
-rw-r--r-- | setup.py | 11 | ||||
-rw-r--r-- | test-requirements.txt | 21 |
6 files changed, 32 insertions, 34 deletions
diff --git a/Vagrantfile b/Vagrantfile index 9ba944e..fbb0c20 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,7 +8,7 @@ cd /vagrant sudo add-apt-repository -y ppa:deadsnakes/ppa sudo apt-get update sudo apt-get install -y --allow-unauthenticated python2.7-dev python3.4-dev python3.5-dev python3.6-dev python3.7-dev -sudo apt-get install -y python-virtualenv git ipython python-pip python3-pip silversearcher-ag +sudo apt-get install -y python-virtualenv git ipython python-pip python3-pip silversearcher-ag jq sudo apt-get purge -y python3-virtualenv sudo pip3 install virtualenv diff --git a/gitlint/tests/test_cli.py b/gitlint/tests/test_cli.py index 07e130a..d05c4d9 100644 --- a/gitlint/tests/test_cli.py +++ b/gitlint/tests/test_cli.py @@ -344,17 +344,17 @@ class CLITests(BaseTestCase): # Directory as config file config_path = self.get_sample_path("config") result = self.cli.invoke(cli.cli, ["--config", config_path]) - expected_string = u"Error: Invalid value for \"-C\" / \"--config\": Path \"{0}\" is a directory.".format( + expected_string = u"Error: Invalid value for \"-C\" / \"--config\": File \"{0}\" is a directory.".format( config_path) - self.assertEqual(result.output.split("\n")[2], expected_string) + self.assertEqual(result.output.split("\n")[3], expected_string) self.assertEqual(result.exit_code, self.USAGE_ERROR_CODE) # Non existing file config_path = self.get_sample_path(u"föo") result = self.cli.invoke(cli.cli, ["--config", config_path]) - expected_string = u"Error: Invalid value for \"-C\" / \"--config\": Path \"{0}\" does not exist.".format( + expected_string = u"Error: Invalid value for \"-C\" / \"--config\": File \"{0}\" does not exist.".format( config_path) - self.assertEqual(result.output.split("\n")[2], expected_string) + self.assertEqual(result.output.split("\n")[3], expected_string) self.assertEqual(result.exit_code, self.USAGE_ERROR_CODE) # Invalid config file @@ -379,14 +379,14 @@ class CLITests(BaseTestCase): result = self.cli.invoke(cli.cli, ["--target", u"/föo/bar"]) self.assertEqual(result.exit_code, self.USAGE_ERROR_CODE) expected_msg = u"Error: Invalid value for \"--target\": Directory \"/föo/bar\" does not exist." - self.assertEqual(result.output.split("\n")[2], expected_msg) + self.assertEqual(result.output.split("\n")[3], expected_msg) # try setting a file as target target_path = self.get_sample_path("config/gitlintconfig") result = self.cli.invoke(cli.cli, ["--target", target_path]) self.assertEqual(result.exit_code, self.USAGE_ERROR_CODE) expected_msg = u"Error: Invalid value for \"--target\": Directory \"{0}\" is a file.".format(target_path) - self.assertEqual(result.output.split("\n")[2], expected_msg) + self.assertEqual(result.output.split("\n")[3], expected_msg) @patch('gitlint.config.LintConfigGenerator.generate_config') def test_generate_config(self, generate_config): diff --git a/requirements.txt b/requirements.txt index 3596958..6215ef9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,6 @@ setuptools -wheel==0.29.0; python_version == '2.6' or python_version == '3.3' -wheel==0.32.2; python_version != '2.6' and python_version != '3.3' -Click==6.7 +wheel==0.33.4; +Click==7.0 sh==1.12.14; sys_platform != 'win32' # sh is not supported on windows -arrow==0.10.0 -ordereddict==1.1; python_version < '2.7' -importlib==1.0.3; python_version < '2.7' +arrow==0.14.2; python_version != '3.4' +arrow==0.13.2; python_version == '3.4' diff --git a/run_tests.sh b/run_tests.sh index 97ab9c0..ced36ae 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -93,7 +93,7 @@ run_unit_tests(){ clean # py.test -s => print standard output (i.e. show print statement output) # -rw => print warnings - OMIT="*pypy*" + OMIT="*pypy*,*venv*,*virtualenv*,*gitlint/tests/*" if [ -n "$testargs" ]; then coverage run --omit=$OMIT -m pytest -rw -s "$testargs" else @@ -186,7 +186,7 @@ run_build_test(){ run_stats(){ clean # required for py.test to count properly echo "*** Code ***" - radon raw -s gitlint | tail -n 6 + radon raw -s gitlint | tail -n 11 echo "*** Docs ***" echo " Markdown: $(cat docs/*.md | wc -l | tr -d " ") lines" echo "*** Tests ***" @@ -200,6 +200,12 @@ run_stats(){ echo " First commit: $(git log --pretty="%aD" $(git rev-list --max-parents=0 HEAD))" echo " Contributors: $(git log --format='%aN' | sort -u | wc -l | tr -d ' ')" echo " Releases (tags): $(git tag --list | wc -l | tr -d ' ')" + # PyPi API: https://pypistats.org/api/ + echo "*** PyPi ***" + stats=$(curl -s https://pypistats.org/api/packages/gitlint/recent) + echo " Last Month: $(echo $stats | jq .data.last_month)" + echo " Last Week: $(echo $stats | jq .data.last_week)" + echo " Last Day: $(echo $stats | jq .data.last_day)" } clean(){ @@ -64,13 +64,14 @@ setup( "License :: OSI Approved :: MIT License" ], install_requires=[ - 'Click==6.7', - 'arrow==0.10.0' + 'Click==7.0', ], extras_require={ - ':python_version < "2.7"': [ - 'importlib==1.0.3', - 'ordereddict==1.1', + ':python_version != "3.4"': [ + 'arrow==0.14.2', + ], + ':python_version == "3.4"': [ + 'arrow==0.13.2', ], ':sys_platform != "win32"': [ 'sh==1.12.14', diff --git a/test-requirements.txt b/test-requirements.txt index 4dfd61c..c169d2a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,17 +1,10 @@ -discover==0.4.0; python_version < '2.7' unittest2==1.1.0; python_version <= '2.7' -flake8==2.6.2; python_version < '2.7' -flake8==3.2.1; python_version >= '2.7' -coverage==4.0.3 -python-coveralls==2.9.1 -radon==1.4.2 -mock==2.0.0 -pytest==3.2.5; python_version == '2.6' or python_version == '3.3' -pytest==3.10.0; python_version != '2.6' and python_version != '3.3' -pylint<1.4; python_version < '2.7' -astroid<=1.3.2; python_version < '2.7' # astroid is a pylint dependency -isort==4.2.15; python_version == '3.3' # specific version for pylint 1.7.6 -pylint==1.9.2; python_version == '2.7' -pylint==1.7.6; python_version == '3.3' +flake8==3.5.0 +coverage==4.5.3 +python-coveralls==2.9.2 +radon==3.0.3 +mock==3.0.5 +pytest==4.6.3; +pylint==1.9.4; python_version == '2.7' pylint==2.3.1; python_version >= '3.4' -e . |