From cc8bcf18034de7894e7faa9bc5393527ef831217 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 4 Apr 2017 12:26:06 +0800 Subject: [PATCH 001/508] Fix the Docker Hub link in README. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 867cfe91..9c7280da 100644 --- a/README.rst +++ b/README.rst @@ -38,7 +38,7 @@ from `GitHub `_ : pip install git+https://github.com/zdict/zdict.git -from `Docker Hub `_ : +from `Docker Hub `_ : .. code-block:: sh From bff5f9bce909efb95ce1f3b3772e44bab8613d97 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 4 Apr 2017 12:29:57 +0800 Subject: [PATCH 002/508] Update Usage in README. --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9c7280da..19f3f4bb 100644 --- a/README.rst +++ b/README.rst @@ -57,8 +57,8 @@ Usage :: usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt jisho,yahoo,urban,moe,spanish,all] [-ld] [-V] [-c] - [--dump [PATTERN]] [-D] + [-dt moe,moe-taiwanese,spanish,jisho,yahoo,urban,all] [-ld] [-V] + [-c] [--dump [PATTERN]] [-D] [word [word ...]] positional arguments: @@ -77,7 +77,7 @@ Usage the number of CPUs in the system. -sp, --show-provider Show the dictionary provider of the queried word -su, --show-url Show the url of the queried word - -dt jisho,yahoo,urban,moe,spanish,all, --dict jisho,yahoo,urban,moe,spanish,all + -dt moe,moe-taiwanese,spanish,jisho,yahoo,urban,all, --dict moe,moe-taiwanese,spanish,jisho,yahoo,urban,all Must be seperated by comma and no spaces after each comma. Choose the dictionary you want. (default: yahoo) Use 'all' for qureying all dictionaries. If From 3d419226e0e3c1d3baa3ec6239d060ee4ea01cc1 Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 17 Apr 2017 10:44:12 +0800 Subject: [PATCH 003/508] [README] Fix some typos. + originly => originally + integrate => integrates --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 19f3f4bb..a0a6ac0a 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ zdict *Note: This project is working in progress.* zdict is a CLI dictionay framework mainly focus on any kind of online dictionary. -This project originly forked from https://github.com/chenpc/ydict, which is a CLI tool for the Yahoo! online dictionary. +This project originally forked from https://github.com/chenpc/ydict, which is a CLI tool for the Yahoo! online dictionary. After heavily refactoring the original project including: 1. Change from Python 2 to Python 3 @@ -214,7 +214,7 @@ Related Projects ------------------------------ * `zdict.vim `_ - * A vim plugin integrate with zdict. + * A vim plugin integrates with zdict. * `zdict.sh `_ * A collection of shell completion scripts for zdict. From c8990cb836d7ae9e263bac4bb7621e2dc6e403af Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 12 Jul 2017 21:17:18 +0800 Subject: [PATCH 004/508] Fix typo in README.rst dictionay => dictionary --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a0a6ac0a..e145145c 100644 --- a/README.rst +++ b/README.rst @@ -10,12 +10,12 @@ zdict *Note: This project is working in progress.* -zdict is a CLI dictionay framework mainly focus on any kind of online dictionary. +zdict is a CLI dictionary framework mainly focus on any kind of online dictionary. This project originally forked from https://github.com/chenpc/ydict, which is a CLI tool for the Yahoo! online dictionary. After heavily refactoring the original project including: 1. Change from Python 2 to Python 3 -2. Focus on being a flexible framework for any kind online dicitionaries, not only just a CLI tool for querying Yahoo! online dictionay. +2. Focus on being a flexible framework for any kind online dicitionaries, not only just a CLI tool for querying Yahoo! online dictionary. 3. Based on an open source project skeleton. So, we decided to create a new project. From 00914accb51afc19445715b4686a3a40e50ebe61 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 27 Aug 2017 17:20:31 +0800 Subject: [PATCH 005/508] Upgrade all dependencies and CPython version --- .travis.yml | 9 +++------ requirements.txt | 6 +++--- test-requirements.txt | 10 +++++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25a4cf9c..02ece059 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,19 +15,16 @@ matrix: # https://github.com/travis-ci/travis-ci/issues/2312 - os: osx language: generic - env: PYTHON_VERSION=3.4.6 + env: PYTHON_VERSION=3.4.7 - os: osx language: generic - env: PYTHON_VERSION=3.5.3 + env: PYTHON_VERSION=3.5.4 - os: osx language: generic - env: PYTHON_VERSION=3.6.0 + env: PYTHON_VERSION=3.6.2 allow_failures: - python: "nightly" - - os: osx - language: generic - env: PYTHON_VERSION=3.4.6 before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi diff --git a/requirements.txt b/requirements.txt index 2ae2dca1..2aa0bd82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4>=4.4.1 -peewee>=2.8.1 -requests>=2.10.0 +beautifulsoup4>=4.6.0 +peewee>=2.10.1 +requests>=2.18.4 diff --git a/test-requirements.txt b/test-requirements.txt index 9e8e9f20..62db1d2a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ -coverage>=4.0.3 -flake8<=2.6.2 +coverage>=4.4.1 +flake8<=3.4.1 pyjokes==0.5.0 -pytest>=2.8.6 -pytest-cov==2.2.0 -pytest-flake8==0.2 +pytest>=3.2.1 +pytest-cov==2.5.1 +pytest-flake8==0.8.1 From dfde9e9e044b567c703ebac990e57eb609263701 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 27 Aug 2017 17:35:39 +0800 Subject: [PATCH 006/508] Fix some flake8 complain --- setup.cfg | 2 +- setup.py | 2 ++ zdict/dictionaries/jisho.py | 8 ++++---- zdict/dictionaries/moe.py | 20 ++++++++++---------- zdict/dictionaries/template.py | 2 +- zdict/dictionaries/urban.py | 8 ++++---- zdict/dictionaries/yahoo.py | 8 ++++---- zdict/dictionary.py | 4 ++-- 8 files changed, 28 insertions(+), 26 deletions(-) diff --git a/setup.cfg b/setup.cfg index 32731d79..f8202cdf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,4 @@ -[pytest] +[tool:pytest] addopts = --flake8 -v --cov zdict --cov-report html --cov-report term flake8-ignore = zdict/__init__.py F401 diff --git a/setup.py b/setup.py index a3385885..91a392ee 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ def get_test_req(): return test_requires + version = get_zdict_version() @@ -53,6 +54,7 @@ def run_tests(self): errno = pytest.main(self.pytest_args) sys.exit(errno) + install_requirements = parse_requirements( os.path.join(ROOT_DIR, 'requirements.txt'), session=False ) diff --git a/zdict/dictionaries/jisho.py b/zdict/dictionaries/jisho.py index e312077f..eb850797 100644 --- a/zdict/dictionaries/jisho.py +++ b/zdict/dictionaries/jisho.py @@ -93,8 +93,8 @@ def query(self, word: str): raise NotFoundError(word) record = Record( - word=word, - content=content, - source=self.provider, - ) + word=word, + content=content, + source=self.provider, + ) return record diff --git a/zdict/dictionaries/moe.py b/zdict/dictionaries/moe.py index a909ba2a..91b8fde0 100644 --- a/zdict/dictionaries/moe.py +++ b/zdict/dictionaries/moe.py @@ -49,7 +49,7 @@ def show(self, record: Record): self.color.print( '{order}. {text}'.format( - order=count+1, + order=count + 1, text=explain.get('def', '') ), ) @@ -91,10 +91,10 @@ def query(self, word: str): raise NotFoundError(exception.word) record = Record( - word=word, - content=content, - source=self.provider, - ) + word=word, + content=content, + source=self.provider, + ) return record @@ -161,7 +161,7 @@ def show(self, record: Record): # print explain for count, explain in enumerate(word.get('d', '')): - self.color.print('{order}. '.format(order=count+1), end='') + self.color.print('{order}. '.format(order=count + 1), end='') type = clean(explain.get('type', '')) if type: self.color.print( @@ -190,9 +190,9 @@ def query(self, word: str): raise NotFoundError(exception.word) record = Record( - word=word, - content=content, - source=self.provider, - ) + word=word, + content=content, + source=self.provider, + ) return record diff --git a/zdict/dictionaries/template.py b/zdict/dictionaries/template.py index a827bf9c..12b882cd 100644 --- a/zdict/dictionaries/template.py +++ b/zdict/dictionaries/template.py @@ -62,6 +62,6 @@ def query(self, word: str): word=word, content=json.dumps(content), source=self.provider, - ) + ) return record diff --git a/zdict/dictionaries/urban.py b/zdict/dictionaries/urban.py index 2f1678d4..4206ae69 100644 --- a/zdict/dictionaries/urban.py +++ b/zdict/dictionaries/urban.py @@ -50,9 +50,9 @@ def query(self, word: str): raise NotFoundError(word) record = Record( - word=word, - content=content, - source=self.provider, - ) + word=word, + content=content, + source=self.provider, + ) return record diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index d4734a08..e38e6980 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -206,8 +206,8 @@ def query(self, word: str): content['verbose'].append(node) record = Record( - word=word, - content=json.dumps(content), - source=self.provider, - ) + word=word, + content=json.dumps(content), + source=self.provider, + ) return record diff --git a/zdict/dictionary.py b/zdict/dictionary.py index af84778f..e1fad9f7 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -177,8 +177,8 @@ def _get_raw(self, word: str) -> str: if self.args.debug: from bs4 import BeautifulSoup soup = BeautifulSoup(res.text, 'html.parser') - print('='*30 + ' Start of debug info ' + '='*30) + print('=' * 30 + ' Start of debug info ' + '=' * 30) print(soup.prettify()) - print('='*30 + ' End of debug info ' + '='*30) + print('=' * 30 + ' End of debug info ' + '=' * 30) return res.text From a68937ac872155c0a9cfef3c8805196e23c8edab Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 27 Aug 2017 17:46:48 +0800 Subject: [PATCH 007/508] Fix CPython 3.6 problem on Travis CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 02ece059..4753b0f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then source ~/venv/bin/activate; fi install: + - "pip install -U setuptools" # for upgrade issue with setuptools and CPython 3.6 on Travis CI - "pip install -U pip" - "pip install -U pytest coveralls" - "pip install ." From be7d120eda6fb8c40e46a36f1e996507fdbe2333 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 19:56:48 +0800 Subject: [PATCH 008/508] Add Yandex Translate API support --- zdict/dictionaries/yandex.py | 64 ++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 zdict/dictionaries/yandex.py diff --git a/zdict/dictionaries/yandex.py b/zdict/dictionaries/yandex.py new file mode 100644 index 00000000..3371697b --- /dev/null +++ b/zdict/dictionaries/yandex.py @@ -0,0 +1,64 @@ +import json + +from zdict.dictionary import DictBase +from zdict.exceptions import NotFoundError +from zdict.models import Record + + +# The daily request limit is 1,000,000 characters. The monthly limit is 10,000,000 characters. +API_KEY = 'trnsl.1.1.20170826T075621Z.6dfcaff242c6caa8.e2b9cf136d451d9d6eb69516ec97b827e8c8229b' + + +# Change `Template` to the name of new dictionary. like xxxDict. +class YandexDict(DictBase): + """ + Docs: + + * https://tech.yandex.com/translate/ + * https://tech.yandex.com/dictionary/ + + """ + + # Change the url below to the API url of the new dictionary. + # Need to keep the `{word}` for `_get_url()` usage. + # TODO: support different translate direction + # TODO: use Dictionary API + API = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key={api_key}&text={word}&lang=ru-en' + + @property + def provider(self): + return 'yandex' + + @property + def title(self): + return 'Yandex Translate' + + def _get_url(self, word) -> str: + return self.API.format(api_key=API_KEY, word=word) + + def show(self, record: Record): + content = json.loads(record.content) + + self.color.print(record.word, 'yellow') + print() + + for index, data in enumerate(content['text']): + self.color.print('{}. {}'.format(index+1, data), 'org') + + print() + + def query(self, word: str): + content = self._get_raw(word) + content_json = json.loads(content) + + if not content_json['code'] != '200': + # TODO: handle response codes for different situation + raise NotFoundError(word) + + record = Record( + word=word, + content=content, + source=self.provider, + ) + + return record From 807469cbc27ba6a2f42e57b5d131ec4248fd6bbf Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 20:32:05 +0800 Subject: [PATCH 009/508] Fix some flake8 complain in yandex --- zdict/dictionaries/yandex.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/zdict/dictionaries/yandex.py b/zdict/dictionaries/yandex.py index 3371697b..56b288ce 100644 --- a/zdict/dictionaries/yandex.py +++ b/zdict/dictionaries/yandex.py @@ -5,8 +5,10 @@ from zdict.models import Record -# The daily request limit is 1,000,000 characters. The monthly limit is 10,000,000 characters. -API_KEY = 'trnsl.1.1.20170826T075621Z.6dfcaff242c6caa8.e2b9cf136d451d9d6eb69516ec97b827e8c8229b' +# The daily request limit is 1,000,000 characters +# The monthly limit is 10,000,000 characters +API_KEY = 'trnsl.1.1.20170826T075621Z.' \ + '6dfcaff242c6caa8.e2b9cf136d451d9d6eb69516ec97b827e8c8229b' # Change `Template` to the name of new dictionary. like xxxDict. @@ -23,7 +25,8 @@ class YandexDict(DictBase): # Need to keep the `{word}` for `_get_url()` usage. # TODO: support different translate direction # TODO: use Dictionary API - API = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key={api_key}&text={word}&lang=ru-en' + API = 'https://translate.yandex.net/api/v1.5/tr.json/translate?' \ + 'key={api_key}&text={word}&lang=ru-en' @property def provider(self): @@ -43,7 +46,7 @@ def show(self, record: Record): print() for index, data in enumerate(content['text']): - self.color.print('{}. {}'.format(index+1, data), 'org') + self.color.print('{}. {}'.format(index + 1, data), 'org') print() @@ -59,6 +62,5 @@ def query(self, word: str): word=word, content=content, source=self.provider, - ) - + ) return record From 3343ef3cd1bd79b6653497af7352c4f54056b296 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 20:54:50 +0800 Subject: [PATCH 010/508] Remove unused comments --- zdict/dictionaries/yandex.py | 1 - 1 file changed, 1 deletion(-) diff --git a/zdict/dictionaries/yandex.py b/zdict/dictionaries/yandex.py index 56b288ce..30644053 100644 --- a/zdict/dictionaries/yandex.py +++ b/zdict/dictionaries/yandex.py @@ -11,7 +11,6 @@ '6dfcaff242c6caa8.e2b9cf136d451d9d6eb69516ec97b827e8c8229b' -# Change `Template` to the name of new dictionary. like xxxDict. class YandexDict(DictBase): """ Docs: From ebc5f84e792aa5aac9cecc9a6c7f24f3f6c89bf3 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 20:55:35 +0800 Subject: [PATCH 011/508] Handle the NotFoundError correctly --- zdict/dictionaries/yandex.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zdict/dictionaries/yandex.py b/zdict/dictionaries/yandex.py index 30644053..beb28c12 100644 --- a/zdict/dictionaries/yandex.py +++ b/zdict/dictionaries/yandex.py @@ -1,7 +1,7 @@ import json from zdict.dictionary import DictBase -from zdict.exceptions import NotFoundError +from zdict.exceptions import NotFoundError, QueryError from zdict.models import Record @@ -50,10 +50,14 @@ def show(self, record: Record): print() def query(self, word: str): - content = self._get_raw(word) + try: + content = self._get_raw(word) + except QueryError as exception: + raise NotFoundError(exception.word) + content_json = json.loads(content) - if not content_json['code'] != '200': + if content_json.get('code') != 200: # TODO: handle response codes for different situation raise NotFoundError(word) From 36f0389e2769b4d69bc11ae23b9d7e841f1e63fe Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 20:55:57 +0800 Subject: [PATCH 012/508] Add test case for YandexDict --- zdict/tests/dictionaries/test_yandex.py | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 zdict/tests/dictionaries/test_yandex.py diff --git a/zdict/tests/dictionaries/test_yandex.py b/zdict/tests/dictionaries/test_yandex.py new file mode 100644 index 00000000..bb86e86b --- /dev/null +++ b/zdict/tests/dictionaries/test_yandex.py @@ -0,0 +1,51 @@ +from pytest import raises +from unittest.mock import Mock, patch + +from zdict.dictionaries.yandex import YandexDict, API_KEY +from zdict.exceptions import NotFoundError, QueryError +from zdict.models import Record +from zdict.zdict import get_args + + +class TestYandexDict: + def setup_method(self, method): + self.dict = YandexDict(get_args()) + + def teardown_method(self, method): + del self.dict + + def test__get_url(self): + url = 'https://translate.yandex.net/api/v1.5/tr.json/translate?' \ + 'key={}&text=дом&lang=ru-en' + assert url.format(API_KEY) == self.dict._get_url('дом') + + def test_provider(self): + assert self.dict.provider == 'yandex' + + def test_query_timeout(self): + self.dict._get_raw = Mock(side_effect=QueryError('дом', 404)) + + with raises(NotFoundError): + self.dict.query('дом') + + self.dict._get_raw.assert_called_with('дом') + + @patch('zdict.dictionaries.yandex.Record') + def test_query_normal(self, Record): + content = '{"code":200,"lang":"ru-en","text":["house"]}' + self.dict._get_raw = Mock(return_value=content) + self.dict.query('дом') + Record.assert_called_with(word='дом', content=content, source='yandex') + + def test_show(self): + content = ''' + { + "code": 200, + "lang": "ru-en", + "text": ["house"] + } + ''' + r = Record(word='дом', content=content, source=self.dict.provider) + + # god bless this method, hope that it do not raise any exception + self.dict.show(r) From a0588421be33ccbd038c902d04d18c52acaa2543 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 21:22:09 +0800 Subject: [PATCH 013/508] Show error message for status code of Yandex --- zdict/dictionaries/yandex.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/zdict/dictionaries/yandex.py b/zdict/dictionaries/yandex.py index beb28c12..404b1d2a 100644 --- a/zdict/dictionaries/yandex.py +++ b/zdict/dictionaries/yandex.py @@ -27,6 +27,16 @@ class YandexDict(DictBase): API = 'https://translate.yandex.net/api/v1.5/tr.json/translate?' \ 'key={api_key}&text={word}&lang=ru-en' + status_code = { + 200: 'Operation completed successfully', + 401: 'Invalid API key', + 402: 'Blocked API key', + 404: 'Exceeded the daily limit on the amount of translated text', + 413: 'Exceeded the maximum text size', + 422: 'The text cannot be translated', + 501: 'The specified translation direction is not supported', + } + @property def provider(self): return 'yandex' @@ -57,8 +67,14 @@ def query(self, word: str): content_json = json.loads(content) - if content_json.get('code') != 200: - # TODO: handle response codes for different situation + status = content_json.get('code') + if status != 200: + # https://tech.yandex.com/translate/doc/dg/reference/translate-docpage/#codes + message = self.status_code.get( + status, + 'Some bad thing happened with Yandex' + ) + print('Yandex: ' + message) raise NotFoundError(word) record = Record( From c0daf1ead128cd5492b3039e0aaf4b2216fdb6e7 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 26 Aug 2017 21:49:48 +0800 Subject: [PATCH 014/508] Add screenshot for Yandex Translate --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index e145145c..c81f919d 100644 --- a/README.rst +++ b/README.rst @@ -148,6 +148,12 @@ Screenshots .. image:: http://i.imgur.com/UMP8k4e.png +`Yandex Translate `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: https://user-images.githubusercontent.com/2716047/29741879-ca1a3826-8a3a-11e7-9701-4a7e9a15971a.png + + Development & Contributing --------------------------- From 46963f90d58dcade409f69ee6627e4fe2bfa661c Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 27 Aug 2017 22:55:30 +0800 Subject: [PATCH 015/508] Update README for Yandex --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index c81f919d..7ae66157 100644 --- a/README.rst +++ b/README.rst @@ -57,8 +57,8 @@ Usage :: usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt moe,moe-taiwanese,spanish,jisho,yahoo,urban,all] [-ld] [-V] - [-c] [--dump [PATTERN]] [-D] + [-dt moe,moe-taiwanese,yahoo,jisho,spanish,yandex,urban,all] + [-ld] [-V] [-c] [--dump [PATTERN]] [-D] [word [word ...]] positional arguments: @@ -77,7 +77,7 @@ Usage the number of CPUs in the system. -sp, --show-provider Show the dictionary provider of the queried word -su, --show-url Show the url of the queried word - -dt moe,moe-taiwanese,spanish,jisho,yahoo,urban,all, --dict moe,moe-taiwanese,spanish,jisho,yahoo,urban,all + -dt moe,moe-taiwanese,yahoo,jisho,spanish,yandex,urban,all, --dict moe,moe-taiwanese,yahoo,jisho,spanish,yandex,urban,all Must be seperated by comma and no spaces after each comma. Choose the dictionary you want. (default: yahoo) Use 'all' for qureying all dictionaries. If From 3855c655ea7a41b8b0c699e326117dbd9f7a9751 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Wed, 30 Aug 2017 22:59:30 +0800 Subject: [PATCH 016/508] [zdict-0.10.0] * [#127] Add Yandex Translate API support * [#128] Upgrade all dependencies --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index f102caf4..c55a3f66 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.9.7' +VERSION = '0.10.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.getenv('HOME'), BASE_DIR_NAME) From 388941a528c90e09a936a0508fc2f0dcf9407454 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 16 Sep 2017 21:47:23 +0800 Subject: [PATCH 017/508] [#130] Pinned versions of packages in requirements --- requirements.txt | 6 +++--- test-requirements.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2aa0bd82..1299310d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4>=4.6.0 -peewee>=2.10.1 -requests>=2.18.4 +beautifulsoup4==4.6.0 +peewee==2.10.1 +requests==2.18.4 diff --git a/test-requirements.txt b/test-requirements.txt index 62db1d2a..27e8fba7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ -coverage>=4.4.1 -flake8<=3.4.1 +coverage==4.4.1 +flake8==3.4.1 pyjokes==0.5.0 -pytest>=3.2.1 +pytest==3.2.2 pytest-cov==2.5.1 pytest-flake8==0.8.1 From f4a4cb362c5522db49f2ce6d356cf81e0013ed74 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 17 Sep 2017 17:14:40 +0800 Subject: [PATCH 018/508] [#98] Install `locales` for using `locale-gen` for Docker --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1252bf20..08bd0424 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ FROM ubuntu:16.04 # Set the locale +RUN apt-get clean && apt-get update && apt-get install -y locales RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 # Install Python3 & pip3 -RUN apt-get update RUN apt-get install -y python3 RUN apt-get install -y python3-pip RUN pip3 install --upgrade pip From 459510147a3de450249b4b77fb1eb3429487a844 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 17 Sep 2017 18:26:26 +0800 Subject: [PATCH 019/508] Reduce layers of Dockerfile --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 08bd0424..2d2d5ca1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,10 @@ FROM ubuntu:16.04 # Set the locale RUN apt-get clean && apt-get update && apt-get install -y locales RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_ALL="en_US.UTF-8" # Install Python3 & pip3 -RUN apt-get install -y python3 -RUN apt-get install -y python3-pip +RUN apt-get install -y python3 python3-pip RUN pip3 install --upgrade pip # Install zdict From c8177a34b5aec21019bae1aa1446048c5e187947 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 17 Sep 2017 21:45:52 +0800 Subject: [PATCH 020/508] Modify the part related to docker in README for issue-98 --- README.rst | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 7ae66157..4982b9b2 100644 --- a/README.rst +++ b/README.rst @@ -42,14 +42,36 @@ from `Docker Hub `_ : .. code-block:: sh - # Pull image from Docker Hub + # Pull the image of latest commit of master branch from Docker Hub docker pull zdict/zdict + # Pull the image of latest release from Docker Hub + docker pull zdict/zdict:release + + # Pull the image of specific release version from Docker Hub + docker pull zdict/zdict:${version} + docker pull zdict/zdict:v0.10.0 + + +How to run the zdict docker image + +.. code-block:: sh + # Run interactive mode - docker run -it --rm zdict/zdict + docker run -it --rm zdict/zdict # latest commit + docker run -it --rm zdict/zdict:release # latest release + docker run -it --rm zdict/zdict:v0.10.0 # use zdict v0.10.0 + docker run -it --rm zdict/zdict:$tag # with specific tag # Run normal mode - docker run -it --rm zdict/zdict apple bird + docker run -it --rm zdict/zdict apple bird # latest commit + docker run -it --rm zdict/zdict:release apple bird # latest release + docker run -it --rm zdict/zdict:v0.10.0 apple bird # use zdict v0.10.0 + docker run -it --rm zdict/zdict:$tag apple bird # with specific tag + + # You can also add the options while using docker run either interactive mode or normal mode + docker run -it --rm zdict/zdict:v0.10.0 -dt moe # use moe dict in interactive mode + docker run -it --rm zdict/zdict:v0.10.0 -dt moe 哈 # use moe dict in normal mode Usage ------------------------------ From 19a4a7776a14571a4e8de68848f11878ca1dcee5 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sat, 30 Sep 2017 16:15:22 +0800 Subject: [PATCH 021/508] Add pipenv data By "pipenv install -r requirements.txt" and "pipenv install -d -r test-requirements.txt" --- Pipfile | 20 ++++++ Pipfile.lock | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..99dc1c73 --- /dev/null +++ b/Pipfile @@ -0,0 +1,20 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[packages] + +"beautifulsoup4" = "==4.6.0" +peewee = "==2.10.1" +requests = "==2.18.4" + + +[dev-packages] + +coverage = "==4.4.1" +"flake8" = "==3.4.1" +pyjokes = "==0.5.0" +pytest = "==3.2.2" +"pytest-cov" = "==2.5.1" +"pytest-flake8" = "==0.8.1" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 00000000..eda72ec6 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,194 @@ +{ + "_meta": { + "hash": { + "sha256": "925fb4fb7b4fb6227dfc9730e817d95a220e00b5510b170b1b8e58757f3e3919" + }, + "host-environment-markers": { + "implementation_name": "cpython", + "implementation_version": "3.6.2", + "os_name": "posix", + "platform_machine": "x86_64", + "platform_python_implementation": "CPython", + "platform_release": "4.13.3-1-zen", + "platform_system": "Linux", + "platform_version": "#1 ZEN SMP PREEMPT Wed Sep 20 07:17:03 UTC 2017", + "python_full_version": "3.6.2", + "python_version": "3.6", + "sys_platform": "linux" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "beautifulsoup4": { + "hashes": [ + "sha256:7015e76bf32f1f574636c4288399a6de66ce08fb7b2457f628a8d70c0fbabb11", + "sha256:11a9a27b7d3bddc6d86f59fb76afb70e921a25ac2d6cc55b40d072bd68435a76", + "sha256:808b6ac932dccb0a4126558f7dfdcf41710dd44a4ef497a0bb59a77f9f078e89" + ], + "version": "==4.6.0" + }, + "certifi": { + "hashes": [ + "sha256:54a07c09c586b0e4c619f02a5e94e36619da8e2b053e20f594348c0611803704", + "sha256:40523d2efb60523e113b44602298f0960e900388cf3bb6043f645cf57ea9e3f5" + ], + "version": "==2017.7.27.1" + }, + "chardet": { + "hashes": [ + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" + ], + "version": "==3.0.4" + }, + "idna": { + "hashes": [ + "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4", + "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" + ], + "version": "==2.6" + }, + "peewee": { + "hashes": [ + "sha256:a146611e7278bf037b2b400e88d0f10a5a1b0f21bb9a63a60aa5486f7e8de0be" + ], + "version": "==2.10.1" + }, + "requests": { + "hashes": [ + "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", + "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" + ], + "version": "==2.18.4" + }, + "urllib3": { + "hashes": [ + "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b", + "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" + ], + "version": "==1.22" + } + }, + "develop": { + "coverage": { + "hashes": [ + "sha256:c1456f66c536010cf9e4633a8853a9153e8fd588393695295afd4d0fc16c1d74", + "sha256:97a7ec51cdde3a386e390b159b20f247ccb478084d925c75f1faa3d26c01335e", + "sha256:83e955b975666b5a07d217135e7797857ce844eb340a99e46cc25525120417c4", + "sha256:483ed14080c5301048128bb027b77978c632dd9e92e3ecb09b7e28f5b92abfcf", + "sha256:ef574ab9640bcfa2f3c671831faf03f65788945fdf8efa4d4a1fffc034838e2a", + "sha256:c5a205b4da3c624f5119dc4d84240789b5906bb8468902ec22dcc4aad8aa4638", + "sha256:5dea90ed140e7fa9bc00463313f9bc4a6e6aff297b4969615e7a688615c4c4d2", + "sha256:f9e83b39d29c2815a38e4118d776b482d4082b5bf9c9147fbc99a3f83abe480a", + "sha256:700040c354f0230287906b1276635552a3def4b646e0145555bc9e2e5da9e365", + "sha256:7f1eacae700c66c3d7362a433b228599c9d94a5a3a52613dddd9474e04deb6bc", + "sha256:13ef9f799c8fb45c446a239df68034de3a6f3de274881b088bebd7f5661f79f8", + "sha256:dfb011587e2b7299112f08a2a60d2601706aac9abde37aa1177ea825adaed923", + "sha256:381be5d31d3f0d912334cf2c159bc7bea6bfe6b0e3df6061a3bf2bf88359b1f6", + "sha256:83a477ac4f55a6ef59552683a0544d47b68a85ce6a80fd0ca6b3dc767f6495fb", + "sha256:dfd35f1979da31bcabbe27bcf78d4284d69870731874af629082590023a77336", + "sha256:9681efc2d310cfc53863cc6f63e88ebe7a48124550fa822147996cb09390b6ab", + "sha256:53770b20ac5b4a12e99229d4bae57af0945be87cc257fce6c6c7571a39f0c5d4", + "sha256:8801880d32f11b6df11c32a961e186774b4634ae39d7c43235f5a24368a85f07", + "sha256:16db2c69a1acbcb3c13211e9f954e22b22a729909d81f983b6b9badacc466eda", + "sha256:ef43a06a960b46c73c018704051e023ee6082030f145841ffafc8728039d5a88", + "sha256:c3e2736664a6074fc9bd54fb643f5af0fc60bfedb2963b3d3f98c7450335e34c", + "sha256:17709e22e4c9f5412ba90f446fb13b245cc20bf4a60377021bbff6c0f1f63e7c", + "sha256:a2f7106d1167825c4115794c2ba57cc3b15feb6183db5328fa66f94c12902d8b", + "sha256:2a08e978f402696c6956eee9d1b7e95d3ad042959b71bafe1f3e4557cbd6e0ac", + "sha256:57f510bb16efaec0b6f371b64a8000c62e7e3b3e48e8b0a5745ade078d849814", + "sha256:0f1883eab9c19aa243f51308751b8a2a547b9b817b721cc0ecf3efb99fafbea7", + "sha256:e00fe141e22ce6e9395aa24d862039eb180c6b7e89df0bbaf9765e9aebe560a9", + "sha256:ec596e4401553caa6dd2e3349ce47f9ef82c1f1bcba5d8ac3342724f0df8d6ff", + "sha256:c820a533a943ebc860acc0ce6a00dd36e0fdf2c6f619ff8225755169428c5fa2", + "sha256:b7f7283eb7badd2b8a9c6a9d6eeca200a0a24db6be79baee2c11398f978edcaa", + "sha256:a5ed27ad3e8420b2d6b625dcbd3e59488c14ccc06030167bcf14ffb0f4189b77", + "sha256:d7b70b7b4eb14d0753d33253fe4f121ca99102612e2719f0993607deb30c6f33", + "sha256:4047dc83773869701bde934fb3c4792648eda7c0e008a77a0aec64157d246801", + "sha256:7a9c44400ee0f3b4546066e0710e1250fd75831adc02ab99dda176ad8726f424", + "sha256:0f649e68db74b1b5b8ca4161d08eb2b8fa8ae11af1ebfb80e80e112eb0ef5300", + "sha256:52964fae0fafef8bd283ad8e9a9665205a9fdf912535434defc0ec3def1da26b", + "sha256:36aa6c8db83bc27346ddcd8c2a60846a7178ecd702672689d3ea1828eb1a4d11", + "sha256:9824e15b387d331c0fc0fef905a539ab69784368a1d6ac3db864b4182e520948", + "sha256:4a678e1b9619a29c51301af61ab84122e2f8cc7a0a6b40854b808ac6be604300", + "sha256:8bb7c8dca54109b61013bc4114d96effbf10dea136722c586bce3a5d9fc4e730", + "sha256:1a41d621aa9b6ab6457b557a754d50aaff0813fad3453434de075496fca8a183", + "sha256:0fa423599fc3d9e18177f913552cdb34a8d9ad33efcf52a98c9d4b644edb42c5", + "sha256:e61a4ba0b2686040cb4828297c7e37bcaf3a1a1c0bc0dbe46cc789dde51a80fa", + "sha256:ce9ef0fc99d11d418662e36fd8de6d71b19ec87c2eab961a117cc9d087576e72" + ], + "version": "==4.4.1" + }, + "flake8": { + "hashes": [ + "sha256:f1a9d8886a9cbefb52485f4f4c770832c7fb569c084a9a314fb1eaa37c0c2c86", + "sha256:c20044779ff848f67f89c56a0e4624c04298cd476e25253ac0c36f910a1a11d8" + ], + "version": "==3.4.1" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, + "py": { + "hashes": [ + "sha256:2ccb79b01769d99115aa600d7eed99f524bf752bba8f041dc1c184853514655a", + "sha256:0f2d585d22050e90c7d293b6451c83db097df77871974d90efd5a30dc12fcde3" + ], + "version": "==1.4.34" + }, + "pycodestyle": { + "hashes": [ + "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9", + "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766" + ], + "version": "==2.3.1" + }, + "pyflakes": { + "hashes": [ + "sha256:cc5eadfb38041f8366128786b4ca12700ed05bbf1403d808e89d57d67a3875a7", + "sha256:aa0d4dff45c0cc2214ba158d29280f8fa1129f3e87858ef825930845146337f4" + ], + "version": "==1.5.0" + }, + "pyjokes": { + "hashes": [ + "sha256:01b90474d5c889c21cae88f0d5fc8db1334b2891a16df75cbf9a0886bfdea653", + "sha256:745299c99b7a4015251b4876ecd59dd62803f458a9f0540d036f0f6627dcc67e" + ], + "version": "==0.5.0" + }, + "pytest": { + "hashes": [ + "sha256:b84f554f8ddc23add65c411bf112b2d88e2489fd45f753b1cae5936358bdf314", + "sha256:f46e49e0340a532764991c498244a60e3a37d7424a532b3ff1a6a7653f1a403a" + ], + "version": "==3.2.2" + }, + "pytest-cov": { + "hashes": [ + "sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec", + "sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d" + ], + "version": "==2.5.1" + }, + "pytest-flake8": { + "hashes": [ + "sha256:8efaf4595a13079197ac740a12e6a87e3403f08133a42d3ac5984474f6f91681", + "sha256:aa10a6db147485d71dad391d4149388904c3072194d51755f64784ff128845fd" + ], + "version": "==0.8.1" + } + } +} From 70bc31a97d87dbf9d3665213b1f84bfd37a09fe2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 5 Oct 2017 15:56:58 +0800 Subject: [PATCH 022/508] Update pytest from 3.2.2 to 3.2.3 --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 27e8fba7..e40c11cf 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.1 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.2.2 +pytest==3.2.3 pytest-cov==2.5.1 pytest-flake8==0.8.1 From e5b991a6e073c4efdc8100ab760cc852a936bd3d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 9 Oct 2017 07:52:27 +0200 Subject: [PATCH 023/508] Update peewee from 2.10.1 to 2.10.2 (#138) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1299310d..301ea671 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==2.10.1 +peewee==2.10.2 requests==2.18.4 From 626e72f0ea6e989d854170aaaa182f40ae15f46b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 6 Nov 2017 10:23:51 +0800 Subject: [PATCH 024/508] Update coverage from 4.4.1 to 4.4.2 --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index e40c11cf..684a267c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -coverage==4.4.1 +coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 pytest==3.2.3 From 2cb39bedff2ce30832ed299d0ac217cd5cbd4cdf Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 15 Nov 2017 03:06:10 -0600 Subject: [PATCH 025/508] Update pytest from 3.2.3 to 3.2.4 --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 684a267c..20ffed26 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.2.3 +pytest==3.2.4 pytest-cov==2.5.1 pytest-flake8==0.8.1 From 82ff4fa75a96a39fce2de8326ba36b8b284de7a3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 16 Nov 2017 16:12:12 +0100 Subject: [PATCH 026/508] Update pytest from 3.2.4 to 3.2.5 (#145) --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 20ffed26..eacf693b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.2.4 +pytest==3.2.5 pytest-cov==2.5.1 pytest-flake8==0.8.1 From 154bcd17dbaaad517049e77cabef1e64f95fa26b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 28 Nov 2017 17:32:04 +0100 Subject: [PATCH 027/508] Update pytest from 3.2.5 to 3.3.0 (#146) --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index eacf693b..8963edeb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.2.5 +pytest==3.3.0 pytest-cov==2.5.1 pytest-flake8==0.8.1 From b871cd6c8a6a71f595fe93132cc9d5c9a71eb82d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 7 Dec 2017 06:43:19 +0100 Subject: [PATCH 028/508] Update pytest from 3.3.0 to 3.3.1 (#147) --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 8963edeb..96dc9c64 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.3.0 +pytest==3.3.1 pytest-cov==2.5.1 pytest-flake8==0.8.1 From 2ca927c0013e01b3eefe618028331cb2ecea21f0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 5 Jan 2018 14:37:20 +0100 Subject: [PATCH 029/508] Update pytest from 3.3.1 to 3.3.2 (#150) --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 96dc9c64..c865900f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.3.1 +pytest==3.3.2 pytest-cov==2.5.1 pytest-flake8==0.8.1 From 5c5c05f9ba0429ad84e0f77a6ff99ecb2d59fb3e Mon Sep 17 00:00:00 2001 From: dv Date: Fri, 26 Jan 2018 10:52:00 +0800 Subject: [PATCH 030/508] Open pyup support for Pipefile (#151) --- .pyup.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .pyup.yml diff --git a/.pyup.yml b/.pyup.yml new file mode 100644 index 00000000..f14526b0 --- /dev/null +++ b/.pyup.yml @@ -0,0 +1,7 @@ +# see https://pyup.io/docs/configuration/ for all available options + +requirements: + - requirements.txt + - test-requirements.txt + - Pipfile + - Pipfile.lock From 838b4e70d58b4f4fc94507218740c2006f0a07ef Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 26 Jan 2018 09:31:35 +0100 Subject: [PATCH 031/508] Update coverage to 4.4.2 (#153) * Update coverage from 4.4.1 to 4.4.2 --- Pipfile | 12 ++++--- Pipfile.lock | 88 +++++++++++++++++++++++++--------------------------- 2 files changed, 49 insertions(+), 51 deletions(-) diff --git a/Pipfile b/Pipfile index 99dc1c73..14782b0b 100644 --- a/Pipfile +++ b/Pipfile @@ -1,20 +1,22 @@ [[source]] + url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" + [packages] -"beautifulsoup4" = "==4.6.0" +beautifulsoup4 = "==4.6.0" peewee = "==2.10.1" requests = "==2.18.4" [dev-packages] -coverage = "==4.4.1" -"flake8" = "==3.4.1" +coverage = "==4.4.2" +flake8 = "==3.4.1" pyjokes = "==0.5.0" pytest = "==3.2.2" -"pytest-cov" = "==2.5.1" -"pytest-flake8" = "==0.8.1" +pytest-cov = "==2.5.1" +pytest-flake8 = "==0.8.1" diff --git a/Pipfile.lock b/Pipfile.lock index eda72ec6..ee895231 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -80,52 +80,48 @@ "develop": { "coverage": { "hashes": [ - "sha256:c1456f66c536010cf9e4633a8853a9153e8fd588393695295afd4d0fc16c1d74", - "sha256:97a7ec51cdde3a386e390b159b20f247ccb478084d925c75f1faa3d26c01335e", - "sha256:83e955b975666b5a07d217135e7797857ce844eb340a99e46cc25525120417c4", - "sha256:483ed14080c5301048128bb027b77978c632dd9e92e3ecb09b7e28f5b92abfcf", - "sha256:ef574ab9640bcfa2f3c671831faf03f65788945fdf8efa4d4a1fffc034838e2a", - "sha256:c5a205b4da3c624f5119dc4d84240789b5906bb8468902ec22dcc4aad8aa4638", - "sha256:5dea90ed140e7fa9bc00463313f9bc4a6e6aff297b4969615e7a688615c4c4d2", - "sha256:f9e83b39d29c2815a38e4118d776b482d4082b5bf9c9147fbc99a3f83abe480a", - "sha256:700040c354f0230287906b1276635552a3def4b646e0145555bc9e2e5da9e365", - "sha256:7f1eacae700c66c3d7362a433b228599c9d94a5a3a52613dddd9474e04deb6bc", - "sha256:13ef9f799c8fb45c446a239df68034de3a6f3de274881b088bebd7f5661f79f8", - "sha256:dfb011587e2b7299112f08a2a60d2601706aac9abde37aa1177ea825adaed923", - "sha256:381be5d31d3f0d912334cf2c159bc7bea6bfe6b0e3df6061a3bf2bf88359b1f6", - "sha256:83a477ac4f55a6ef59552683a0544d47b68a85ce6a80fd0ca6b3dc767f6495fb", - "sha256:dfd35f1979da31bcabbe27bcf78d4284d69870731874af629082590023a77336", - "sha256:9681efc2d310cfc53863cc6f63e88ebe7a48124550fa822147996cb09390b6ab", - "sha256:53770b20ac5b4a12e99229d4bae57af0945be87cc257fce6c6c7571a39f0c5d4", - "sha256:8801880d32f11b6df11c32a961e186774b4634ae39d7c43235f5a24368a85f07", - "sha256:16db2c69a1acbcb3c13211e9f954e22b22a729909d81f983b6b9badacc466eda", - "sha256:ef43a06a960b46c73c018704051e023ee6082030f145841ffafc8728039d5a88", - "sha256:c3e2736664a6074fc9bd54fb643f5af0fc60bfedb2963b3d3f98c7450335e34c", - "sha256:17709e22e4c9f5412ba90f446fb13b245cc20bf4a60377021bbff6c0f1f63e7c", - "sha256:a2f7106d1167825c4115794c2ba57cc3b15feb6183db5328fa66f94c12902d8b", - "sha256:2a08e978f402696c6956eee9d1b7e95d3ad042959b71bafe1f3e4557cbd6e0ac", - "sha256:57f510bb16efaec0b6f371b64a8000c62e7e3b3e48e8b0a5745ade078d849814", - "sha256:0f1883eab9c19aa243f51308751b8a2a547b9b817b721cc0ecf3efb99fafbea7", - "sha256:e00fe141e22ce6e9395aa24d862039eb180c6b7e89df0bbaf9765e9aebe560a9", - "sha256:ec596e4401553caa6dd2e3349ce47f9ef82c1f1bcba5d8ac3342724f0df8d6ff", - "sha256:c820a533a943ebc860acc0ce6a00dd36e0fdf2c6f619ff8225755169428c5fa2", - "sha256:b7f7283eb7badd2b8a9c6a9d6eeca200a0a24db6be79baee2c11398f978edcaa", - "sha256:a5ed27ad3e8420b2d6b625dcbd3e59488c14ccc06030167bcf14ffb0f4189b77", - "sha256:d7b70b7b4eb14d0753d33253fe4f121ca99102612e2719f0993607deb30c6f33", - "sha256:4047dc83773869701bde934fb3c4792648eda7c0e008a77a0aec64157d246801", - "sha256:7a9c44400ee0f3b4546066e0710e1250fd75831adc02ab99dda176ad8726f424", - "sha256:0f649e68db74b1b5b8ca4161d08eb2b8fa8ae11af1ebfb80e80e112eb0ef5300", - "sha256:52964fae0fafef8bd283ad8e9a9665205a9fdf912535434defc0ec3def1da26b", - "sha256:36aa6c8db83bc27346ddcd8c2a60846a7178ecd702672689d3ea1828eb1a4d11", - "sha256:9824e15b387d331c0fc0fef905a539ab69784368a1d6ac3db864b4182e520948", - "sha256:4a678e1b9619a29c51301af61ab84122e2f8cc7a0a6b40854b808ac6be604300", - "sha256:8bb7c8dca54109b61013bc4114d96effbf10dea136722c586bce3a5d9fc4e730", - "sha256:1a41d621aa9b6ab6457b557a754d50aaff0813fad3453434de075496fca8a183", - "sha256:0fa423599fc3d9e18177f913552cdb34a8d9ad33efcf52a98c9d4b644edb42c5", - "sha256:e61a4ba0b2686040cb4828297c7e37bcaf3a1a1c0bc0dbe46cc789dde51a80fa", - "sha256:ce9ef0fc99d11d418662e36fd8de6d71b19ec87c2eab961a117cc9d087576e72" - ], - "version": "==4.4.1" + "sha256:d1ee76f560c3c3e8faada866a07a32485445e16ed2206ac8378bd90dadffb9f0", + "sha256:007eeef7e23f9473622f7d94a3e029a45d55a92a1f083f0f3512f5ab9a669b05", + "sha256:17307429935f96c986a1b1674f78079528833410750321d22b5fb35d1883828e", + "sha256:845fddf89dca1e94abe168760a38271abfc2e31863fbb4ada7f9a99337d7c3dc", + "sha256:3f4d0b3403d3e110d2588c275540649b1841725f5a11a7162620224155d00ba2", + "sha256:4c4f368ffe1c2e7602359c2c50233269f3abe1c48ca6b288dcd0fb1d1c679733", + "sha256:f8c55dd0f56d3d618dfacf129e010cbe5d5f94b6951c1b2f13ab1a2f79c284da", + "sha256:cdd92dd9471e624cd1d8c1a2703d25f114b59b736b0f1f659a98414e535ffb3d", + "sha256:2ad357d12971e77360034c1596011a03f50c0f9e1ecd12e081342b8d1aee2236", + "sha256:e9a0e1caed2a52f15c96507ab78a48f346c05681a49c5b003172f8073da6aa6b", + "sha256:eea9135432428d3ca7ee9be86af27cb8e56243f73764a9b6c3e0bda1394916be", + "sha256:700d7579995044dc724847560b78ac786f0ca292867447afda7727a6fbaa082e", + "sha256:66f393e10dd866be267deb3feca39babba08ae13763e0fc7a1063cbe1f8e49f6", + "sha256:5ff16548492e8a12e65ff3d55857ccd818584ed587a6c2898a9ebbe09a880674", + "sha256:d00e29b78ff610d300b2c37049a41234d48ea4f2d2581759ebcf67caaf731c31", + "sha256:87d942863fe74b1c3be83a045996addf1639218c2cb89c5da18c06c0fe3917ea", + "sha256:358d635b1fc22a425444d52f26287ae5aea9e96e254ff3c59c407426f44574f4", + "sha256:81912cfe276e0069dca99e1e4e6be7b06b5fc8342641c6b472cb2fed7de7ae18", + "sha256:079248312838c4c8f3494934ab7382a42d42d5f365f0cf7516f938dbb3f53f3f", + "sha256:b0059630ca5c6b297690a6bf57bf2fdac1395c24b7935fd73ee64190276b743b", + "sha256:493082f104b5ca920e97a485913de254cbe351900deed72d4264571c73464cd0", + "sha256:e3ba9b14607c23623cf38f90b23f5bed4a3be87cbfa96e2e9f4eabb975d1e98b", + "sha256:82cbd3317320aa63c65555aa4894bf33a13fb3a77f079059eb5935eea415938d", + "sha256:9721f1b7275d3112dc7ccf63f0553c769f09b5c25a26ee45872c7f5c09edf6c1", + "sha256:bd4800e32b4c8d99c3a2c943f1ac430cbf80658d884123d19639bcde90dad44a", + "sha256:f29841e865590af72c4b90d7b5b8e93fd560f5dea436c1d5ee8053788f9285de", + "sha256:f3a5c6d054c531536a83521c00e5d4004f1e126e2e2556ce399bef4180fbe540", + "sha256:dd707a21332615108b736ef0b8513d3edaf12d2a7d5fc26cd04a169a8ae9b526", + "sha256:2e1a5c6adebb93c3b175103c2f855eda957283c10cf937d791d81bef8872d6ca", + "sha256:f87f522bde5540d8a4b11df80058281ac38c44b13ce29ced1e294963dd51a8f8", + "sha256:a7cfaebd8f24c2b537fa6a271229b051cdac9c1734bb6f939ccfc7c055689baa", + "sha256:309d91bd7a35063ec7a0e4d75645488bfab3f0b66373e7722f23da7f5b0f34cc", + "sha256:0388c12539372bb92d6dde68b4627f0300d948965bbb7fc104924d715fdc0965", + "sha256:ab3508df9a92c1d3362343d235420d08e2662969b83134f8a97dc1451cbe5e84", + "sha256:43a155eb76025c61fc20c3d03b89ca28efa6f5be572ab6110b2fb68eda96bfea", + "sha256:f98b461cb59f117887aa634a66022c0bd394278245ed51189f63a036516e32de", + "sha256:b6cebae1502ce5b87d7c6f532fa90ab345cfbda62b95aeea4e431e164d498a3d", + "sha256:a4497faa4f1c0fc365ba05eaecfb6b5d24e3c8c72e95938f9524e29dadb15e76", + "sha256:2b4d7f03a8a6632598cbc5df15bbca9f778c43db7cf1a838f4fa2c8599a8691a", + "sha256:1afccd7e27cac1b9617be8c769f6d8a6d363699c9b86820f40c74cfb3328921c" + ], + "version": "==4.4.2" }, "flake8": { "hashes": [ From e7a650827938b6e861e30485b8ce3e711d8d83b4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 26 Jan 2018 15:02:12 +0100 Subject: [PATCH 032/508] Update pyflakes from 1.5.0 to 1.6.0 (#157) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index ee895231..e5a2c94b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -153,10 +153,10 @@ }, "pyflakes": { "hashes": [ - "sha256:cc5eadfb38041f8366128786b4ca12700ed05bbf1403d808e89d57d67a3875a7", - "sha256:aa0d4dff45c0cc2214ba158d29280f8fa1129f3e87858ef825930845146337f4" + "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", + "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" ], - "version": "==1.5.0" + "version": "==1.6.0" }, "pyjokes": { "hashes": [ From 492f0963bc7463a0d8f5183f85dbeced9a899885 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 26 Jan 2018 16:42:54 +0100 Subject: [PATCH 033/508] Update certifi from 2017.7.27.1 to 2018.1.18 (#155) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index e5a2c94b..3038340f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -37,10 +37,10 @@ }, "certifi": { "hashes": [ - "sha256:54a07c09c586b0e4c619f02a5e94e36619da8e2b053e20f594348c0611803704", - "sha256:40523d2efb60523e113b44602298f0960e900388cf3bb6043f645cf57ea9e3f5" + "sha256:14131608ad2fd56836d33a71ee60fa1c82bc9d2c8d98b7bdbc631fe1b3cd1296", + "sha256:edbc3f203427eef571f79a7692bb160a2b0f7ccaa31953e99bd17e307cf63f7d" ], - "version": "==2017.7.27.1" + "version": "==2018.1.18" }, "chardet": { "hashes": [ From b899354ecaa962943ff3de7abf6d67875da780a2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 27 Jan 2018 07:07:19 +0100 Subject: [PATCH 034/508] Update peewee to 2.10.2 (#158) * Update peewee from 2.10.1 to 2.10.2 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index 14782b0b..51487835 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==2.10.1" +peewee = "==2.10.2" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 3038340f..8634e2f5 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:a146611e7278bf037b2b400e88d0f10a5a1b0f21bb9a63a60aa5486f7e8de0be" + "sha256:2342067f48a779e35956a44cd547df883dda35153daa9fe994d970585aaec281" ], - "version": "==2.10.1" + "version": "==2.10.2" }, "requests": { "hashes": [ From 9a1359c643de00abd2ab2146b656fccb8dd4ef50 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 27 Jan 2018 10:01:01 +0100 Subject: [PATCH 035/508] Update py from 1.4.34 to 1.5.2 (#156) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 8634e2f5..db5e5ac7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -139,10 +139,10 @@ }, "py": { "hashes": [ - "sha256:2ccb79b01769d99115aa600d7eed99f524bf752bba8f041dc1c184853514655a", - "sha256:0f2d585d22050e90c7d293b6451c83db097df77871974d90efd5a30dc12fcde3" + "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", + "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" ], - "version": "==1.4.34" + "version": "==1.5.2" }, "pycodestyle": { "hashes": [ From cd3ba6438e138612a8715176536f6cbb619ae61f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 27 Jan 2018 13:14:16 +0100 Subject: [PATCH 036/508] Update pytest to 3.3.2 (#160) * Update pytest from 3.2.2 to 3.3.2 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 51487835..84225b0b 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.4.2" flake8 = "==3.4.1" pyjokes = "==0.5.0" -pytest = "==3.2.2" +pytest = "==3.3.2" pytest-cov = "==2.5.1" pytest-flake8 = "==0.8.1" diff --git a/Pipfile.lock b/Pipfile.lock index db5e5ac7..253f2733 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -167,10 +167,10 @@ }, "pytest": { "hashes": [ - "sha256:b84f554f8ddc23add65c411bf112b2d88e2489fd45f753b1cae5936358bdf314", - "sha256:f46e49e0340a532764991c498244a60e3a37d7424a532b3ff1a6a7653f1a403a" + "sha256:b84878865558194630c6147f44bdaef27222a9f153bbd4a08908b16bf285e0b1", + "sha256:53548280ede7818f4dc2ad96608b9f08ae2cc2ca3874f2ceb6f97e3583f25bc4" ], - "version": "==3.2.2" + "version": "==3.3.2" }, "pytest-cov": { "hashes": [ From ca7a7fa9363db66d7eed9fe2187cea177fc3b76e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 1 Feb 2018 14:22:29 +0100 Subject: [PATCH 037/508] Update pytest to 3.4.0 (#168) * Update pytest from 3.3.2 to 3.4.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 84225b0b..eeea3982 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.4.2" flake8 = "==3.4.1" pyjokes = "==0.5.0" -pytest = "==3.3.2" +pytest = "==3.4.0" pytest-cov = "==2.5.1" pytest-flake8 = "==0.8.1" diff --git a/Pipfile.lock b/Pipfile.lock index 253f2733..7e3cf30c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -167,10 +167,10 @@ }, "pytest": { "hashes": [ - "sha256:b84878865558194630c6147f44bdaef27222a9f153bbd4a08908b16bf285e0b1", - "sha256:53548280ede7818f4dc2ad96608b9f08ae2cc2ca3874f2ceb6f97e3583f25bc4" + "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", + "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" ], - "version": "==3.3.2" + "version": "==3.4.0" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index c865900f..14cdcb2d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.4.2 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.3.2 +pytest==3.4.0 pytest-cov==2.5.1 pytest-flake8==0.8.1 From 1792289ca77d6c83e35a5ebc4d46d368875a237c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 5 Feb 2018 14:51:47 +0100 Subject: [PATCH 038/508] Update coverage to 4.5 (#173) * Update coverage from 4.4.2 to 4.5 --- Pipfile | 2 +- Pipfile.lock | 80 ++++++++++++++++++++----------------------- test-requirements.txt | 2 +- 3 files changed, 40 insertions(+), 44 deletions(-) diff --git a/Pipfile b/Pipfile index eeea3982..928aba5e 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ requests = "==2.18.4" [dev-packages] -coverage = "==4.4.2" +coverage = "==4.5" flake8 = "==3.4.1" pyjokes = "==0.5.0" pytest = "==3.4.0" diff --git a/Pipfile.lock b/Pipfile.lock index 7e3cf30c..c7db2835 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -80,48 +80,44 @@ "develop": { "coverage": { "hashes": [ - "sha256:d1ee76f560c3c3e8faada866a07a32485445e16ed2206ac8378bd90dadffb9f0", - "sha256:007eeef7e23f9473622f7d94a3e029a45d55a92a1f083f0f3512f5ab9a669b05", - "sha256:17307429935f96c986a1b1674f78079528833410750321d22b5fb35d1883828e", - "sha256:845fddf89dca1e94abe168760a38271abfc2e31863fbb4ada7f9a99337d7c3dc", - "sha256:3f4d0b3403d3e110d2588c275540649b1841725f5a11a7162620224155d00ba2", - "sha256:4c4f368ffe1c2e7602359c2c50233269f3abe1c48ca6b288dcd0fb1d1c679733", - "sha256:f8c55dd0f56d3d618dfacf129e010cbe5d5f94b6951c1b2f13ab1a2f79c284da", - "sha256:cdd92dd9471e624cd1d8c1a2703d25f114b59b736b0f1f659a98414e535ffb3d", - "sha256:2ad357d12971e77360034c1596011a03f50c0f9e1ecd12e081342b8d1aee2236", - "sha256:e9a0e1caed2a52f15c96507ab78a48f346c05681a49c5b003172f8073da6aa6b", - "sha256:eea9135432428d3ca7ee9be86af27cb8e56243f73764a9b6c3e0bda1394916be", - "sha256:700d7579995044dc724847560b78ac786f0ca292867447afda7727a6fbaa082e", - "sha256:66f393e10dd866be267deb3feca39babba08ae13763e0fc7a1063cbe1f8e49f6", - "sha256:5ff16548492e8a12e65ff3d55857ccd818584ed587a6c2898a9ebbe09a880674", - "sha256:d00e29b78ff610d300b2c37049a41234d48ea4f2d2581759ebcf67caaf731c31", - "sha256:87d942863fe74b1c3be83a045996addf1639218c2cb89c5da18c06c0fe3917ea", - "sha256:358d635b1fc22a425444d52f26287ae5aea9e96e254ff3c59c407426f44574f4", - "sha256:81912cfe276e0069dca99e1e4e6be7b06b5fc8342641c6b472cb2fed7de7ae18", - "sha256:079248312838c4c8f3494934ab7382a42d42d5f365f0cf7516f938dbb3f53f3f", - "sha256:b0059630ca5c6b297690a6bf57bf2fdac1395c24b7935fd73ee64190276b743b", - "sha256:493082f104b5ca920e97a485913de254cbe351900deed72d4264571c73464cd0", - "sha256:e3ba9b14607c23623cf38f90b23f5bed4a3be87cbfa96e2e9f4eabb975d1e98b", - "sha256:82cbd3317320aa63c65555aa4894bf33a13fb3a77f079059eb5935eea415938d", - "sha256:9721f1b7275d3112dc7ccf63f0553c769f09b5c25a26ee45872c7f5c09edf6c1", - "sha256:bd4800e32b4c8d99c3a2c943f1ac430cbf80658d884123d19639bcde90dad44a", - "sha256:f29841e865590af72c4b90d7b5b8e93fd560f5dea436c1d5ee8053788f9285de", - "sha256:f3a5c6d054c531536a83521c00e5d4004f1e126e2e2556ce399bef4180fbe540", - "sha256:dd707a21332615108b736ef0b8513d3edaf12d2a7d5fc26cd04a169a8ae9b526", - "sha256:2e1a5c6adebb93c3b175103c2f855eda957283c10cf937d791d81bef8872d6ca", - "sha256:f87f522bde5540d8a4b11df80058281ac38c44b13ce29ced1e294963dd51a8f8", - "sha256:a7cfaebd8f24c2b537fa6a271229b051cdac9c1734bb6f939ccfc7c055689baa", - "sha256:309d91bd7a35063ec7a0e4d75645488bfab3f0b66373e7722f23da7f5b0f34cc", - "sha256:0388c12539372bb92d6dde68b4627f0300d948965bbb7fc104924d715fdc0965", - "sha256:ab3508df9a92c1d3362343d235420d08e2662969b83134f8a97dc1451cbe5e84", - "sha256:43a155eb76025c61fc20c3d03b89ca28efa6f5be572ab6110b2fb68eda96bfea", - "sha256:f98b461cb59f117887aa634a66022c0bd394278245ed51189f63a036516e32de", - "sha256:b6cebae1502ce5b87d7c6f532fa90ab345cfbda62b95aeea4e431e164d498a3d", - "sha256:a4497faa4f1c0fc365ba05eaecfb6b5d24e3c8c72e95938f9524e29dadb15e76", - "sha256:2b4d7f03a8a6632598cbc5df15bbca9f778c43db7cf1a838f4fa2c8599a8691a", - "sha256:1afccd7e27cac1b9617be8c769f6d8a6d363699c9b86820f40c74cfb3328921c" - ], - "version": "==4.4.2" + "sha256:464d85d6959497cc4adfa9f0d36fca809e2ca7ec5f4625f548317892cac6ed7c", + "sha256:e958ab5b6a7f3b88289a25c95d031f2b62bc73219141c09d261fd97f244c124c", + "sha256:67288f8834a0a64c1af66286b22fd325b5524ceaa153a51c3e2e30f7e8b3f826", + "sha256:cfb6b7035c6605e2a87abe7d84ea35a107e6c432014a3f1ca243ab57a558fbcd", + "sha256:c86a12b3dc004bcbe97a3849354bd1f93eb6fb69b0e4eb58831fd7adba7740ec", + "sha256:8ddcf308f894d01a1a0ae01283d19b613751815b7190113266a0b7f9d076e86d", + "sha256:adab01e4c63a01bdf036f57f0114497994aa2195d8659d12a3d69673c3f27939", + "sha256:54d73fe68a7ac9c847af69a234a7461bbaf3cad95f258317d4584d14dd53f679", + "sha256:a0d98c71d026c1757c7393a99d24c6e42091ff41e20e68238b17e145252c2d0a", + "sha256:464e0eda175c7fe2dc730d9d02acde5b8a8518d9417413dee6ca187d1f65ef89", + "sha256:2890cb40464686c0c1dccc1223664bbc34d85af053bc5dbcd71ea13959e264f2", + "sha256:0f2315c793b1360f80a9119fff76efb7b4e5ab5062651dff515e681719f29689", + "sha256:85c028e959312285225040cdac5ad3db6189e958a234f09ae6b4ba5f539c842d", + "sha256:da6585339fc8a25086003a2b2c0167438b8ab0cd0ccae468d22ed603e414bba1", + "sha256:e837865a7b20c01a8a2f904c05fba36e8406b146649ff9174cbddf32e217b777", + "sha256:b718efb33097c7651a60a03b4b38b14776f92194bc0e9e598ce05ddaef7c70e7", + "sha256:7413f078fbba267de44814584593a729f88fc37f2d938263844b7f4daf1e36ec", + "sha256:47ad00a0c025f87a7528cc13d013c54e4691ae8730430e49ec9c7ace7e0e1fba", + "sha256:95f9f5072afeb2204401401cbd0ab978a9f86ef1ebc5cd267ba431cfa581cc4d", + "sha256:ca8827a5dad1176a8da6bf5396fd07e66549d1bc842047b76cdf69e196597a80", + "sha256:c68164c4f49cfc2e66ca1ded62e4a1092a6bd4b2c65222059b867700ad19151c", + "sha256:61e0bcf15aa0385e15d1fe4a86022a6b813d08c785855e3fab56ba6d7ac3dd21", + "sha256:981a64063242a2c6c88dda33ccafe3583026847961fe56636b6a00c47674e258", + "sha256:21e47d2ff9c75e25880dd12b316db11379e9afc98b39e9516149d189c15c564b", + "sha256:f6b822c68f68f48d480d23fcfcd1d4df7d42ff03cf5d7b574d09e662c0b95b43", + "sha256:53fa7aa7643a22eeadcf8b781b97a51f37d43ba1d897a05238aa7e4d11bc0667", + "sha256:95ce1a70323d47c0f6b8d6cfd3c14c38cb30d51fd1ab4f6414734fa33a78b17e", + "sha256:b7a06a523dfeaf417da630d46ad4f4e11ca1bae6202c9312c4cb987dde5792fc", + "sha256:585e8db44b8f3af2a4152b00dd8a7a36bc1d2aba7de5e50fc17a54178428f0d6", + "sha256:102933e14b726bd4fdfafb541e122ad36c150732aee36db409d8c8766e11537e", + "sha256:15f92238487d93f7f34a3ba03be3bd4615c69cffc88388b4dd1ea99af74fc1bf", + "sha256:319190dd7fa08c23332215782b563a9ef12b76fb15e4a325915592b825eca9ed", + "sha256:af14e9628c0a3152b6a1fbba4471e6a3e5f5567ecae614f84b84ff3441c58692", + "sha256:72bc3f91a25a87fd87eb57983c8cefbb8aa5bacd50d73516ade398271d652d77", + "sha256:c3905f10786dcf386f3f6cebe0ae4a36f47e5e256471161fb944ca537e97e928", + "sha256:3344079d73a4849341aaaecd9b391141824b8c9a96732fbd6ef95ba9566895d3" + ], + "version": "==4.5" }, "flake8": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 14cdcb2d..7ef4111c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -coverage==4.4.2 +coverage==4.5 flake8==3.4.1 pyjokes==0.5.0 pytest==3.4.0 From 8618df572f396ec8ca2091c72aa0d4ec19a47296 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 11 Feb 2018 15:59:08 +0100 Subject: [PATCH 039/508] Update coverage to 4.5.1 (#181) * Update coverage from 4.5 to 4.5.1 --- Pipfile | 2 +- Pipfile.lock | 76 +++++++++++++++++++++---------------------- test-requirements.txt | 2 +- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Pipfile b/Pipfile index 928aba5e..a9bb2d37 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ requests = "==2.18.4" [dev-packages] -coverage = "==4.5" +coverage = "==4.5.1" flake8 = "==3.4.1" pyjokes = "==0.5.0" pytest = "==3.4.0" diff --git a/Pipfile.lock b/Pipfile.lock index c7db2835..e7e59583 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -80,44 +80,44 @@ "develop": { "coverage": { "hashes": [ - "sha256:464d85d6959497cc4adfa9f0d36fca809e2ca7ec5f4625f548317892cac6ed7c", - "sha256:e958ab5b6a7f3b88289a25c95d031f2b62bc73219141c09d261fd97f244c124c", - "sha256:67288f8834a0a64c1af66286b22fd325b5524ceaa153a51c3e2e30f7e8b3f826", - "sha256:cfb6b7035c6605e2a87abe7d84ea35a107e6c432014a3f1ca243ab57a558fbcd", - "sha256:c86a12b3dc004bcbe97a3849354bd1f93eb6fb69b0e4eb58831fd7adba7740ec", - "sha256:8ddcf308f894d01a1a0ae01283d19b613751815b7190113266a0b7f9d076e86d", - "sha256:adab01e4c63a01bdf036f57f0114497994aa2195d8659d12a3d69673c3f27939", - "sha256:54d73fe68a7ac9c847af69a234a7461bbaf3cad95f258317d4584d14dd53f679", - "sha256:a0d98c71d026c1757c7393a99d24c6e42091ff41e20e68238b17e145252c2d0a", - "sha256:464e0eda175c7fe2dc730d9d02acde5b8a8518d9417413dee6ca187d1f65ef89", - "sha256:2890cb40464686c0c1dccc1223664bbc34d85af053bc5dbcd71ea13959e264f2", - "sha256:0f2315c793b1360f80a9119fff76efb7b4e5ab5062651dff515e681719f29689", - "sha256:85c028e959312285225040cdac5ad3db6189e958a234f09ae6b4ba5f539c842d", - "sha256:da6585339fc8a25086003a2b2c0167438b8ab0cd0ccae468d22ed603e414bba1", - "sha256:e837865a7b20c01a8a2f904c05fba36e8406b146649ff9174cbddf32e217b777", - "sha256:b718efb33097c7651a60a03b4b38b14776f92194bc0e9e598ce05ddaef7c70e7", - "sha256:7413f078fbba267de44814584593a729f88fc37f2d938263844b7f4daf1e36ec", - "sha256:47ad00a0c025f87a7528cc13d013c54e4691ae8730430e49ec9c7ace7e0e1fba", - "sha256:95f9f5072afeb2204401401cbd0ab978a9f86ef1ebc5cd267ba431cfa581cc4d", - "sha256:ca8827a5dad1176a8da6bf5396fd07e66549d1bc842047b76cdf69e196597a80", - "sha256:c68164c4f49cfc2e66ca1ded62e4a1092a6bd4b2c65222059b867700ad19151c", - "sha256:61e0bcf15aa0385e15d1fe4a86022a6b813d08c785855e3fab56ba6d7ac3dd21", - "sha256:981a64063242a2c6c88dda33ccafe3583026847961fe56636b6a00c47674e258", - "sha256:21e47d2ff9c75e25880dd12b316db11379e9afc98b39e9516149d189c15c564b", - "sha256:f6b822c68f68f48d480d23fcfcd1d4df7d42ff03cf5d7b574d09e662c0b95b43", - "sha256:53fa7aa7643a22eeadcf8b781b97a51f37d43ba1d897a05238aa7e4d11bc0667", - "sha256:95ce1a70323d47c0f6b8d6cfd3c14c38cb30d51fd1ab4f6414734fa33a78b17e", - "sha256:b7a06a523dfeaf417da630d46ad4f4e11ca1bae6202c9312c4cb987dde5792fc", - "sha256:585e8db44b8f3af2a4152b00dd8a7a36bc1d2aba7de5e50fc17a54178428f0d6", - "sha256:102933e14b726bd4fdfafb541e122ad36c150732aee36db409d8c8766e11537e", - "sha256:15f92238487d93f7f34a3ba03be3bd4615c69cffc88388b4dd1ea99af74fc1bf", - "sha256:319190dd7fa08c23332215782b563a9ef12b76fb15e4a325915592b825eca9ed", - "sha256:af14e9628c0a3152b6a1fbba4471e6a3e5f5567ecae614f84b84ff3441c58692", - "sha256:72bc3f91a25a87fd87eb57983c8cefbb8aa5bacd50d73516ade398271d652d77", - "sha256:c3905f10786dcf386f3f6cebe0ae4a36f47e5e256471161fb944ca537e97e928", - "sha256:3344079d73a4849341aaaecd9b391141824b8c9a96732fbd6ef95ba9566895d3" - ], - "version": "==4.5" + "sha256:7608a3dd5d73cb06c531b8925e0ef8d3de31fed2544a7de6c63960a1e73ea4bc", + "sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694", + "sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80", + "sha256:0b136648de27201056c1869a6c0d4e23f464750fd9a9ba9750b8336a244429ed", + "sha256:337ded681dd2ef9ca04ef5d93cfc87e52e09db2594c296b4a0a3662cb1b41249", + "sha256:3eb42bf89a6be7deb64116dd1cc4b08171734d721e7a7e57ad64cc4ef29ed2f1", + "sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9", + "sha256:69bf008a06b76619d3c3f3b1983f5145c75a305a0fea513aca094cae5c40a8f5", + "sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508", + "sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f", + "sha256:701cd6093d63e6b8ad7009d8a92425428bc4d6e7ab8d75efbb665c806c1d79ba", + "sha256:5a13ea7911ff5e1796b6d5e4fbbf6952381a611209b736d48e675c2756f3f74e", + "sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd", + "sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba", + "sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162", + "sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d", + "sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558", + "sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c", + "sha256:6bc583dc18d5979dc0f6cec26a8603129de0304d5ae1f17e57a12834e7235062", + "sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640", + "sha256:7aa36d2b844a3e4a4b356708d79fd2c260281a7390d678a10b91ca595ddc9e99", + "sha256:3d72c20bd105022d29b14a7d628462ebdc61de2f303322c0212a054352f3b287", + "sha256:4635a184d0bbe537aa185a34193898eee409332a8ccb27eea36f262566585000", + "sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", + "sha256:76ecd006d1d8f739430ec50cc872889af1f9c1b6b8f48e29941814b09b0fd3cc", + "sha256:7d3f553904b0c5c016d1dad058a7554c7ac4c91a789fca496e7d8347ad040653", + "sha256:3c79a6f7b95751cdebcd9037e4d06f8d5a9b60e4ed0cd231342aa8ad7124882a", + "sha256:56e448f051a201c5ebbaa86a5efd0ca90d327204d8b059ab25ad0f35fbfd79f1", + "sha256:ac4fef68da01116a5c117eba4dd46f2e06847a497de5ed1d64bb99a5fda1ef91", + "sha256:1c383d2ef13ade2acc636556fd544dba6e14fa30755f26812f54300e401f98f2", + "sha256:b8815995e050764c8610dbc82641807d196927c3dbed207f0a079833ffcf588d", + "sha256:104ab3934abaf5be871a583541e8829d6c19ce7bde2923b2751e0d3ca44db60a", + "sha256:9e112fcbe0148a6fa4f0a02e8d58e94470fc6cb82a5481618fea901699bf34c4", + "sha256:15b111b6a0f46ee1a485414a52a7ad1d703bdf984e9ed3c288a4414d3871dcbd", + "sha256:e4d96c07229f58cb686120f168276e434660e4358cc9cf3b0464210b04913e77", + "sha256:f8a923a85cb099422ad5a2e345fe877bbc89a8a8b23235824a93488150e45f6e" + ], + "version": "==4.5.1" }, "flake8": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 7ef4111c..a1067cfa 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -coverage==4.5 +coverage==4.5.1 flake8==3.4.1 pyjokes==0.5.0 pytest==3.4.0 From fbbf2d46b79cda3d0906b5dbdd058b60be910ba0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 24 Feb 2018 09:30:56 +0100 Subject: [PATCH 040/508] Update pytest to 3.4.1 (#183) * Update pytest from 3.4.0 to 3.4.1 --- Pipfile | 2 +- Pipfile.lock | 7 ++----- test-requirements.txt | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index a9bb2d37..5f60f2d2 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.5.1" flake8 = "==3.4.1" pyjokes = "==0.5.0" -pytest = "==3.4.0" +pytest = "==3.4.1" pytest-cov = "==2.5.1" pytest-flake8 = "==0.8.1" diff --git a/Pipfile.lock b/Pipfile.lock index e7e59583..f5625fc3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -162,11 +162,8 @@ "version": "==0.5.0" }, "pytest": { - "hashes": [ - "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", - "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" - ], - "version": "==3.4.0" + "hashes": [], + "version": "==3.4.1" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index a1067cfa..00bcead1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.4.1 pyjokes==0.5.0 -pytest==3.4.0 +pytest==3.4.1 pytest-cov==2.5.1 pytest-flake8==0.8.1 From 62deca91bf08b8038a08b53cc9ee0785afd5179e Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 24 Feb 2018 18:05:08 +0800 Subject: [PATCH 041/508] Upgrade version to 0.10.1 + Solved issue #130 on GitHub + Solved issue #98 on GitHub + Added pipenv + Use newew version of peewee, coverage, pytest, pyflakes, certifi, py. ref: --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index c55a3f66..bb2cb54a 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.10.0' +VERSION = '0.10.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.getenv('HOME'), BASE_DIR_NAME) From 58894e2b0c7f1f1ec3dfdca8e3cbbe62cca4173c Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sat, 24 Feb 2018 22:56:24 +0800 Subject: [PATCH 042/508] README: remove useless badge (#187) --- README.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 4982b9b2..24c428cb 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ zdict ======================================== -|issues| |travis| |coveralls| |pypi-dm| +|issues| |travis| |coveralls| |license| @@ -262,6 +262,3 @@ Related Projects .. |coveralls| image:: https://coveralls.io/repos/zdict/zdict/badge.svg :target: https://coveralls.io/github/zdict/zdict - -.. |pypi-dm| image:: https://img.shields.io/pypi/dm/zdict.svg - :target: https://pypi.python.org/pypi/zdict From 22e1aff4a083bb1c97680802d22ffc790e896f19 Mon Sep 17 00:00:00 2001 From: shunyi Date: Thu, 7 Dec 2017 17:21:58 +0800 Subject: [PATCH 043/508] [#148] Fix the bug when getting user home dir on Windows Use `os.path.expanduser` instead of using `os.path.join` directly, since the formmer is better handled for Windows. ref: --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index bb2cb54a..57fa50d1 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -4,7 +4,7 @@ VERSION = '0.10.1' BASE_DIR_NAME = '.zdict' -BASE_DIR = os.path.join(os.getenv('HOME'), BASE_DIR_NAME) +BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) DB_NAME = 'zdict.db' DB_FILE = os.path.join(BASE_DIR, DB_NAME) From 320992948901c8e2a5cf4e6df062f6760dffd4a9 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 25 Feb 2018 00:51:22 +0800 Subject: [PATCH 044/508] Upgrade to v0.10.2 --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 57fa50d1..b4b46325 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.10.1' +VERSION = '0.10.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 9e349911eb12ee83417c87eed2b40b7a520e1f6f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 24 Feb 2018 18:58:19 +0100 Subject: [PATCH 045/508] Update peewee to 3.1.0 (#185) * Upgrade peewee from 2.10.2 to 3.1.0 * Change Database.get_conn() to Database.connection() ref: --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- zdict/completer.py | 2 +- zdict/dictionary.py | 2 +- zdict/tests/test_completer.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index 5f60f2d2..94ed4c20 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==2.10.2" +peewee = "==3.1.0" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index f5625fc3..810f9177 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:2342067f48a779e35956a44cd547df883dda35153daa9fe994d970585aaec281" + "sha256:e2df2de859ca366525430c7f2e4cd5a95029d45872dadc02f9a3403b16fb165e" ], - "version": "==2.10.2" + "version": "==3.1.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 301ea671..ed9b5371 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==2.10.2 +peewee==3.1.0 requests==2.18.4 diff --git a/zdict/completer.py b/zdict/completer.py index 42346bbe..5425f436 100644 --- a/zdict/completer.py +++ b/zdict/completer.py @@ -4,7 +4,7 @@ class DictCompleter: def __init__(self): self.db = db - self.db.get_conn() + self.db.connection() def __del__(self): self.db.close() diff --git a/zdict/dictionary.py b/zdict/dictionary.py index e1fad9f7..5e9e1330 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -20,7 +20,7 @@ def __init__(self, args): self.db = db try: - self.db.get_conn() + self.db.connection() except: self.db = None raise diff --git a/zdict/tests/test_completer.py b/zdict/tests/test_completer.py index d2181c13..134579ec 100644 --- a/zdict/tests/test_completer.py +++ b/zdict/tests/test_completer.py @@ -14,7 +14,7 @@ def test_DictCompleter_db_connect(db): ''' # init completer = DictCompleter() - assert db.get_conn.called + assert db.connection.called # del del completer From 32433c24fb153c6cc9c9eea165dcbc654d4f925e Mon Sep 17 00:00:00 2001 From: dv Date: Sun, 25 Feb 2018 02:36:37 +0800 Subject: [PATCH 046/508] Update flake8 to 3.5.0, pytest-flake8 to 0.9.1 (#188) * Update flake8 to 3.5.0, pytest-flake8 to 0.9.1 * Ignore the bare except check from flake8 for now --- test-requirements.txt | 4 ++-- zdict/dictionaries/template.py | 2 +- zdict/dictionaries/yahoo.py | 4 ++-- zdict/dictionary.py | 4 ++-- zdict/loader.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 00bcead1..55b24cd8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 -flake8==3.4.1 +flake8==3.5.0 pyjokes==0.5.0 pytest==3.4.1 pytest-cov==2.5.1 -pytest-flake8==0.8.1 +pytest-flake8==0.9.1 diff --git a/zdict/dictionaries/template.py b/zdict/dictionaries/template.py index 12b882cd..360654d5 100644 --- a/zdict/dictionaries/template.py +++ b/zdict/dictionaries/template.py @@ -38,7 +38,7 @@ def show(self, record: Record): try: # Get the addtional information if it exists. pass - except: + except Exception: return else: # Define how to print the additional information diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index e38e6980..7327e280 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -142,7 +142,7 @@ def query(self, word: str): else: try: sentence += w - except: + except Exception: pass pack.append((sentence.strip())) @@ -198,7 +198,7 @@ def query(self, word: str): else: try: sentence += w - except: + except Exception: pass pack.append((sentence.strip())) diff --git a/zdict/dictionary.py b/zdict/dictionary.py index 5e9e1330..7feec7f4 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -21,7 +21,7 @@ def __init__(self, args): try: self.db.connection() - except: + except Exception: self.db = None raise else: @@ -168,7 +168,7 @@ def _get_raw(self, word: str) -> str: raise eval(exception) else: raise exceptions.UnexpectedError() - except: + except Exception: raise exceptions.UnexpectedError() if res.status_code != 200: diff --git a/zdict/loader.py b/zdict/loader.py index 9c689b82..2f24e1a5 100644 --- a/zdict/loader.py +++ b/zdict/loader.py @@ -40,5 +40,5 @@ def get_dictionary_map(): def _is_dict(cls): try: return issubclass(cls, DictBase) and not (cls is DictBase) - except: + except Exception: return False From 235ef64fdace55e548248f8c4b4441dff091050c Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 25 Feb 2018 02:59:21 +0800 Subject: [PATCH 047/508] Upgrade to v0.10.3 + Update peewee to 3.1.0 (#185) + Update flake8 to 3.5.0, pytest-flake8 to 0.9.1 (#188) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index b4b46325..3530e543 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.10.2' +VERSION = '0.10.3' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From c01d95359bfa1623f7ca365b8158697eb0217efa Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 28 Feb 2018 04:38:38 +0100 Subject: [PATCH 048/508] Update peewee to 3.1.1 (#189) * Update peewee from 3.1.0 to 3.1.1 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 94ed4c20..baa6fcba 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.1.0" +peewee = "==3.1.1" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 810f9177..0ceab69d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:e2df2de859ca366525430c7f2e4cd5a95029d45872dadc02f9a3403b16fb165e" + "sha256:721d4d221bebdc0ed82484c36185dd83d048cc2553df7f91047bf5a53f6c3066" ], - "version": "==3.1.0" + "version": "==3.1.1" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index ed9b5371..7f849b23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.1.0 +peewee==3.1.1 requests==2.18.4 From f347d6205a4eee6be199ed84bdc7c7dc6a91e912 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 1 Mar 2018 15:20:15 +0100 Subject: [PATCH 049/508] Update peewee to 3.1.2 (#190) * Update peewee from 3.1.1 to 3.1.2 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index baa6fcba..f6682ba1 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.1.1" +peewee = "==3.1.2" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 0ceab69d..93e785cc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:721d4d221bebdc0ed82484c36185dd83d048cc2553df7f91047bf5a53f6c3066" + "sha256:46d96502ea6f84f8e66c055282ac2d6fd332ccd62c8c3c93d68a43d055cd2450" ], - "version": "==3.1.1" + "version": "==3.1.2" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 7f849b23..b21e1545 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.1.1 +peewee==3.1.2 requests==2.18.4 From ff07ecce8fd642d88ffff0f0d8995f5ef04b799d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 14 Mar 2018 06:15:53 +0100 Subject: [PATCH 050/508] Update pytest to 3.4.2 (#191) * Update pytest from 3.4.1 to 3.4.2 * Update pytest from 3.4.1 to 3.4.2 * Update pytest from 3.4.1 to 3.4.2 --- Pipfile | 2 +- Pipfile.lock | 2 +- test-requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index f6682ba1..154ddc11 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.5.1" flake8 = "==3.4.1" pyjokes = "==0.5.0" -pytest = "==3.4.1" +pytest = "==3.4.2" pytest-cov = "==2.5.1" pytest-flake8 = "==0.8.1" diff --git a/Pipfile.lock b/Pipfile.lock index 93e785cc..2997be27 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -163,7 +163,7 @@ }, "pytest": { "hashes": [], - "version": "==3.4.1" + "version": "==3.4.2" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 55b24cd8..bb317f43 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.4.1 +pytest==3.4.2 pytest-cov==2.5.1 pytest-flake8==0.9.1 From a97a9b3fa8ff2732627f27d4d179c4d82e37354a Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sat, 17 Mar 2018 16:33:14 +0800 Subject: [PATCH 051/508] ydict: new dictionary format (#195) Update to Yahoo's new dictionary (provided by Dr.eye) --- zdict/dictionaries/yahoo.py | 365 ++++++++++++++++--------- zdict/tests/dictionaries/test_yahoo.py | 2 +- 2 files changed, 231 insertions(+), 136 deletions(-) diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index 7327e280..88c87288 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -1,7 +1,8 @@ -import itertools import json import re +from collections import deque + from bs4 import BeautifulSoup from zdict.dictionary import DictBase @@ -9,9 +10,17 @@ from zdict.models import Record +def text(x): + return x.text + + +def foreach(f: 'function', i: iter) -> None: + deque(map(f, i), 0) + + class YahooDict(DictBase): - API = 'https://tw.dictionary.search.yahoo.com/search?p={word}' + API = 'https://tw.dictionary.yahoo.com/dictionary?p={word}' @property def provider(self): @@ -26,7 +35,9 @@ def _get_url(self, word) -> str: def show(self, record: Record): content = json.loads(record.content) + getattr(self, 'show_v{}'.format(content.get('version', 1)))(content) + def show_v1(self, content): # legacy # print word self.color.print(content['word'], 'yellow') @@ -61,149 +72,133 @@ def show(self, record: Record): print() print() + def show_v2(self, content): + self.show_v2_summary(content['summary']) + self.show_v2_explain(content.get('explain')) + self.show_v2_verbose(content.get('verbose')) + print() + + def show_v2_summary(self, summary): + # word + self.color.print(summary['word'], 'yellow') + # pronounce + pronounce = summary.get('pronounce', []) + for k, v in pronounce: + self.color.print(k, end='') + self.color.print(v, 'lwhite', end=' ') + print() if pronounce else None + # explain + indent = True + for (t, s) in summary.get('explain', []): + if t == 'explain': + self.color.print(s, indent=2 * indent) + indent = True + elif t == 'pos': + self.color.print(s, 'lred', end=' ', indent=2 * indent) + indent = False + # grammar + grammar = summary.get('grammar', []) + print() if grammar else None + for s in grammar: + self.color.print(s, indent=2) + + def show_v2_explain(self, explain): + if not explain: + return + + print() + # explain + for exp in explain: + type_ = exp['type'] + if type_ == 'PoS': + self.color.print(exp['text'], 'lred') + + elif type_ == 'item': + self.color.print(exp['text'], indent=2) + sentence = exp.get('sentence') + + if not sentence: + continue + + indent = True + for s in sentence: + if isinstance(s, str) and s != '\n': + self.color.print(s, 'indigo', end='', + indent=indent * 4) + elif isinstance(s, list) and s[0] == 'b': + self.color.print(s[1], 'lindigo', end='', + indent=indent * 4) + elif s == '\n': + print() + indent = True + continue + + indent = False + + def show_v2_verbose(self, verbose): + if not self.args.verbose: + return + if not verbose: + return + + print() + color = {'title': 'lred', 'explain': 'org', 'item': 'indigo'} + indent = {'title': 0, 'explain': 2, 'item': 4} + foreach( + lambda x: self.color.print(x[1], color[x[0]], indent[x[0]]), + verbose) + def query(self, word: str): webpage = self._get_raw(word) data = BeautifulSoup(webpage, "html.parser") content = {} - # handle record.word + # Please bump version if the format changes again. + # the `show` function will act with respect to version number. + + content['version'] = 2 + + # Here are details of each version. + # + # The original one, in the old era, there wasn't any concept of + # version number: + # content = { + # 'word': ..., + # 'pronounce': ..., + # 'sound': (optional), + # 'explain': [...], + # 'verbose': [...], + # } + # + # Verion 2, yahoo dictionary content is provided by Dy.eye + # at that moment: + # content = { + # 'version': 2, + # 'summary': { + # 'word': ..., + # 'pronounce': [('KK', '...'), (...)], // optional. + # // e.g. 'google' + # 'explain': [(optional)], # 'hospitalized' is summary-only + # 'grammar': [(optional)], + # }, + # 'explain': [...], + # 'verbose': [(optional)], + # } + + # Construct summary (required) try: - content['word'] = data.find('span', id='term').text + content['summary'] = self.parse_summary(data, word) except AttributeError: raise NotFoundError(word) - # handle pronounce - pronu_value = data.find('span', id='pronunciation_pos').text - if pronu_value: - content['pronounce'] = [] - for match in re.finditer('(\w+)(\[.*?\])', pronu_value): - content['pronounce'].append(match.group(1, 2)) - - # handle sound - proun_sound = data.find( - 'span', - style="display: none;", - id="iconStyle", - class_="tri", - title="http://product.dreye.com.tw/", - ) - if proun_sound: - content['sound'] = {} - d = json.loads(proun_sound.text) - - sound_types_and_urls = ( - d.get('sound_url_1', []) + d.get('sound_url_2', []) - ) - sound_accents = ( - d.get('sound_type_1', []) + d.get('sound_type_2', []) - ) - - for sound_type_and_url, sound_accent in zip( - sound_types_and_urls, sound_accents - ): - if sound_type_and_url: - sound_type, sound_url = list(sound_type_and_url.items())[0] - content['sound'].setdefault( - sound_type, {} - ).setdefault( - sound_accent, [] - ).append(sound_url) - - # Handle explain - main_explanations = data.find( - class_='dd algo explain mt-20 lst DictionaryResults' - ) - if main_explanations: - main_explanations = itertools.zip_longest( - main_explanations.find_all(class_='compTitle mb-10'), - main_explanations.find_all( - class_='compArticleList mb-15 ml-10', - ) - ) - else: - main_explanations = "" - - content['explain'] = [] - for part_of_speech, meaning in main_explanations: - node = [part_of_speech.text] if part_of_speech else [''] - - for item in meaning.find_all('li', class_='ov-a'): - pack = [item.find('h4').text] - - for example in ( - tag for tag in item.find_all('span') - if 'line-height: 17px;' not in tag.get('style', {}) - ): - sentence = '' - - for w in example.contents: - if w.name == 'b': - sentence += '*' + w.text + '*' - else: - try: - sentence += w - except Exception: - pass - - pack.append((sentence.strip())) - node.append(pack) - content['explain'].append(node) - - # verbose info - part_of_speech_list, meaning_list = [], [] - content['verbose'] = [] - - variation_explanations = data.find( - class_='dd algo variation fst DictionaryResults' - ) - if variation_explanations: - part_of_speech_list.extend( - variation_explanations.find_all(class_='compTitle') - ) - meaning_list.extend( - variation_explanations.find_all(class_='compArticleList') - ) - - additional_explanations = data.find( - class_='dd algo othersNew lst DictionaryResults' - ) - if additional_explanations: - part_of_speech_list.extend( - additional_explanations.find_all(class_='compTitle mt-26') - ) - meaning_list.extend( - additional_explanations.find_all(class_='compArticleList') - ) - - more_explanations = itertools.zip_longest( - part_of_speech_list, meaning_list - ) - - for part_of_speech, meaning in more_explanations: - node = [part_of_speech.text] if part_of_speech else [''] - - if meaning: - for item in meaning.find_all('li', class_='ov-a'): - pack = [item.find('h4').text] - - for example in ( - tag for tag in item.find_all('span') - if 'line-height: 17px;' not in tag['style'] - ): - sentence = '' - - for w in example.contents: - if w.name == 'b': - sentence += '*' + w.text + '*' - else: - try: - sentence += w - except Exception: - pass + # Handle explain (required) + try: + content['explain'] = self.parse_explain(data) + except IndexError: + raise NotFoundError(word) - pack.append((sentence.strip())) - node.append(pack) - content['verbose'].append(node) + # Extract verbose (optional) + content['verbose'] = self.parse_verbose(data) record = Record( word=word, @@ -211,3 +206,103 @@ def query(self, word: str): source=self.provider, ) return record + + def parse_summary(self, data, word): + def gete(x: 'bs4 node'): + def f(ks): + return ( + 'pos' if 'pos_button' in ks else + 'explain' if 'dictionaryExplanation' in ks else + '?') + + return [ + (f(m.attrs['class']), m.text) + for n in x.select('ul > li') for m in n.select('div')] + + def getp(p): + return list(map( + lambda x: re.match('(.*)(\[.*\])', x).groups(), + p.find('ul').text.strip().split())) + + def getg(d): + s = ('div#web ol.searchCenterMiddle ' + 'div.dictionaryWordCard > ul > li') + return list(map(text, data.select(s))) + + node = data.select_one('div#web ol.searchCenterMiddle > li > div') + node = node.select('> div') + + p = None # optional + if len(node) == 5: + _, w, p, _, e = node + elif len(node) == 4: # e.g. "hold on" + _, w, _, e = node + elif len(node) == 3: # e.g. "google" + _, w, e = node + elif len(node) <= 2: # e.g. "fabor" + raise NotFoundError(word) + + return { + 'word': w.find('span').text.strip(), + 'pronounce': getp(p) if p else [], # optional + 'explain': gete(e), + 'grammar': getg(data), # optional + } + + def parse_explain(self, data): + def getitem(node) -> {'type': 'item', 'text': '...'}: + s = node.select_one('span') + exp = { + 'type': 'item', + 'text': s.text, + 'sentence': [], + } + + for s in node.select('p'): + sentence = list(map( + lambda x: ('b', x.text) if x.name == 'b' else str(x), + s.span.contents)) + if isinstance(sentence[-1], str): + hd, _, tl = sentence.pop().rpartition(' ') + sentence.extend([hd, '\n', tl]) + sentence.append('\n') + exp['sentence'].extend(sentence) + + return exp + + ret = [] + nodes = data.select('div.tab-content-explanation ul li') + + for node in nodes: + if re.match('\d', node.text.strip()): + exp = getitem(node) + else: + exp = { + 'type': 'PoS', # part of speech + 'text': node.text.strip(), + } + ret.append(exp) + + return ret + + def parse_verbose(self, data): + ret = [] + nodes = data.select_one('div.tab-content-synonyms') + for node in nodes if nodes else []: + name = node.name + if name == 'div': + if node.span is None: + continue + + cls = node.span.attrs.get('class') + if cls is None: + continue + + s = node.span.text.strip() + 'fw-xl' in cls and ret.append(('title', s)) + 'fw-500' in cls and ret.append(('explain', s)) + + elif name == 'ul': + for li in node.select('> li'): + ret.append(('item', li.span.text)) + return ret diff --git a/zdict/tests/dictionaries/test_yahoo.py b/zdict/tests/dictionaries/test_yahoo.py index d999975a..2e4f051a 100644 --- a/zdict/tests/dictionaries/test_yahoo.py +++ b/zdict/tests/dictionaries/test_yahoo.py @@ -26,7 +26,7 @@ def test_title(self): assert self.dict.title == 'Yahoo Dictionary' def test__get_url(self): - url = 'https://tw.dictionary.search.yahoo.com/search?p=test' + url = 'https://tw.dictionary.yahoo.com/dictionary?p=test' assert url == self.dict._get_url('test') def test_show(self): From f2d4d5e526f6300fb9c15c2d8d8e7a70546acfb2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 17 Mar 2018 10:00:27 +0100 Subject: [PATCH 052/508] Update peewee to 3.1.5 (#194) * Update peewee from 3.1.2 to 3.1.5 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 154ddc11..7754f794 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.1.2" +peewee = "==3.1.5" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 2997be27..acf50a95 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:46d96502ea6f84f8e66c055282ac2d6fd332ccd62c8c3c93d68a43d055cd2450" + "sha256:c57fa818062a4137e79619a40e97c19c839b54381bceec3e7bd040b3252e7867" ], - "version": "==3.1.2" + "version": "==3.1.5" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index b21e1545..4caedb7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.1.2 +peewee==3.1.5 requests==2.18.4 From 053ec2f0e11e13641c16d836a143d0781f4fa3e5 Mon Sep 17 00:00:00 2001 From: dv Date: Sat, 17 Mar 2018 17:08:55 +0800 Subject: [PATCH 053/508] Upgrade to v0.11.0 (#197) * Fix Yahoo dictionary for new format (#195) * Update peewee to 3.1.5 (#194) * Update pytest to 3.4.2 (#191) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 3530e543..600c860b 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.10.3' +VERSION = '0.11.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 01dc415f9dfbd459780a56b992f822a02cfc173c Mon Sep 17 00:00:00 2001 From: dv Date: Sat, 17 Mar 2018 17:46:37 +0800 Subject: [PATCH 054/508] Upgrade OSX CI test version to CPython 3.4.8/3.5.5/3.6.4 (#198) --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4753b0f8..bbf76b41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,13 +15,13 @@ matrix: # https://github.com/travis-ci/travis-ci/issues/2312 - os: osx language: generic - env: PYTHON_VERSION=3.4.7 + env: PYTHON_VERSION=3.4.8 - os: osx language: generic - env: PYTHON_VERSION=3.5.4 + env: PYTHON_VERSION=3.5.5 - os: osx language: generic - env: PYTHON_VERSION=3.6.2 + env: PYTHON_VERSION=3.6.4 allow_failures: - python: "nightly" From 0f94522443cd7e1330d8473f653356f6b1cf8693 Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 19 Mar 2018 12:26:29 +0800 Subject: [PATCH 055/508] [travis.yml] Make it up to date with the doc about pypi deployment doc: --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbf76b41..528e370a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,5 +56,4 @@ deploy: on: branch: master tags: true - distributions: sdist bdist_wheel - repo: zdict/zdict + distributions: "sdist bdist_wheel" From 2863c8c3d74a2d8989e5136dfe300c5570433a9f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 20 Mar 2018 01:56:48 +0100 Subject: [PATCH 056/508] Update pytest-flake8 to 1.0.0 (#200) * Update pytest-flake8 from 0.9.1 to 1.0.0 * Update pytest-flake8 from 0.8.1 to 1.0.0 * Update pytest-flake8 from 0.8.1 to 1.0.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 7754f794..f3d52fe1 100644 --- a/Pipfile +++ b/Pipfile @@ -19,4 +19,4 @@ flake8 = "==3.4.1" pyjokes = "==0.5.0" pytest = "==3.4.2" pytest-cov = "==2.5.1" -pytest-flake8 = "==0.8.1" +pytest-flake8 = "==1.0.0" diff --git a/Pipfile.lock b/Pipfile.lock index acf50a95..2fa31ef5 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -174,10 +174,10 @@ }, "pytest-flake8": { "hashes": [ - "sha256:8efaf4595a13079197ac740a12e6a87e3403f08133a42d3ac5984474f6f91681", - "sha256:aa10a6db147485d71dad391d4149388904c3072194d51755f64784ff128845fd" + "sha256:43598dfa211242525897866ff35fa553ebd88177383783079099057c7ad04331", + "sha256:3996de65a1219697596acac755090c70c47ec901edc438ea88ce1aa6098fb905" ], - "version": "==0.8.1" + "version": "==1.0.0" } } } diff --git a/test-requirements.txt b/test-requirements.txt index bb317f43..79ec243c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,4 +3,4 @@ flake8==3.5.0 pyjokes==0.5.0 pytest==3.4.2 pytest-cov==2.5.1 -pytest-flake8==0.9.1 +pytest-flake8==1.0.0 From 786fd28ba2abe46c85d30810a158a86f7faf5991 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 24 Mar 2018 09:26:03 +0100 Subject: [PATCH 057/508] Update pytest to 3.5.0 (#202) * Update pytest from 3.4.2 to 3.5.0 * Update pytest from 3.4.2 to 3.5.0 * Update pytest from 3.4.2 to 3.5.0 --- Pipfile | 2 +- Pipfile.lock | 2 +- test-requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index f3d52fe1..70190ca5 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.5.1" flake8 = "==3.4.1" pyjokes = "==0.5.0" -pytest = "==3.4.2" +pytest = "==3.5.0" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.0" diff --git a/Pipfile.lock b/Pipfile.lock index 2fa31ef5..b79df193 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -163,7 +163,7 @@ }, "pytest": { "hashes": [], - "version": "==3.4.2" + "version": "==3.5.0" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 79ec243c..03878a5e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.4.2 +pytest==3.5.0 pytest-cov==2.5.1 pytest-flake8==1.0.0 From 6933147e192211b271b85b852bea653b8890ed4a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 28 Mar 2018 03:50:30 +0200 Subject: [PATCH 058/508] Update peewee to 3.1.7 (#204) * Update peewee from 3.1.5 to 3.1.7 * Update peewee from 3.1.5 to 3.1.7 * Update peewee from 3.1.5 to 3.1.7 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 70190ca5..18e75d12 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.1.5" +peewee = "==3.1.7" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index b79df193..d6f508f6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:c57fa818062a4137e79619a40e97c19c839b54381bceec3e7bd040b3252e7867" + "sha256:5c0d3ff909a7c9e402494646528dcc55534504ff7f4aabbdc9d36065de286c66" ], - "version": "==3.1.5" + "version": "==3.1.7" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 4caedb7d..158ca0df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.1.5 +peewee==3.1.7 requests==2.18.4 From 157d8d92b18b316983be63b61c08dca471ee1220 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 30 Mar 2018 19:09:39 +0200 Subject: [PATCH 059/508] Update py to 1.5.3 (#201) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index d6f508f6..47a87609 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -135,10 +135,10 @@ }, "py": { "hashes": [ - "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", - "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" + "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a", + "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881" ], - "version": "==1.5.2" + "version": "==1.5.3" }, "pycodestyle": { "hashes": [ From 35cf5e1efdd5df124cdffc4988a6b03a06bd5bb3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 31 Mar 2018 19:35:51 +0200 Subject: [PATCH 060/508] Update peewee to 3.2.0 (#205) * Update peewee from 3.1.7 to 3.2.0 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 18e75d12..2e381834 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.1.7" +peewee = "==3.2.0" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 47a87609..666c5a1f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,9 +58,9 @@ }, "peewee": { "hashes": [ - "sha256:5c0d3ff909a7c9e402494646528dcc55534504ff7f4aabbdc9d36065de286c66" + "sha256:34000900eedfcce5a38eb84d8d197f41a537e10a36419aba0c407215dd87afeb" ], - "version": "==3.1.7" + "version": "==3.2.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 158ca0df..97ef2f86 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.1.7 +peewee==3.2.0 requests==2.18.4 From 2f5b24616b319675b6a96cad8ab9329a4daac9ea Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 1 Apr 2018 09:54:02 +0200 Subject: [PATCH 061/508] Update peewee to 3.2.1 (#206) * Update peewee from 3.1.7 to 3.2.1 * Update peewee from 3.1.7 to 3.2.1 * Update peewee from 3.1.7 to 3.2.1 --- Pipfile | 4 ++-- Pipfile.lock | 6 +++--- requirements.txt | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index 2e381834..46ca79cf 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.2.0" +peewee = "==3.2.1" requests = "==2.18.4" @@ -19,4 +19,4 @@ flake8 = "==3.4.1" pyjokes = "==0.5.0" pytest = "==3.5.0" pytest-cov = "==2.5.1" -pytest-flake8 = "==1.0.0" +pytest-flake8 = "==1.0.0" \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index 666c5a1f..97a6d14f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -57,10 +57,10 @@ "version": "==2.6" }, "peewee": { - "hashes": [ - "sha256:34000900eedfcce5a38eb84d8d197f41a537e10a36419aba0c407215dd87afeb" + "hashes": + "sha256:ac72ea1e4c2060d10de6c6f6b5fefb6c0434f9fd60766227d8b8e44b1898e1ba" ], - "version": "==3.2.0" + "version": "==3.2.1" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 97ef2f86..fb94f468 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.2.0 -requests==2.18.4 +peewee==3.2.1 +requests==2.18.4 \ No newline at end of file From 99ea290c8dfa925833d983d49ee2ceb9f529f344 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 1 Apr 2018 11:04:03 +0200 Subject: [PATCH 062/508] Update flake8 to 3.5.0 (#207) --- Pipfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 46ca79cf..716cb4ab 100644 --- a/Pipfile +++ b/Pipfile @@ -15,8 +15,8 @@ requests = "==2.18.4" [dev-packages] coverage = "==4.5.1" -flake8 = "==3.4.1" +flake8 = "==3.5.0" pyjokes = "==0.5.0" pytest = "==3.5.0" pytest-cov = "==2.5.1" -pytest-flake8 = "==1.0.0" \ No newline at end of file +pytest-flake8 = "==1.0.0" From 0b81bb15f65a21eaf16f91f749dde68de1836738 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 1 Apr 2018 18:30:01 +0200 Subject: [PATCH 063/508] Update peewee to 3.2.2 (#208) * Update peewee from 3.2.1 to 3.2.2 --- Pipfile | 2 +- Pipfile.lock | 145 ++++++++++++++++++++++++++++------------------- requirements.txt | 2 +- 3 files changed, 88 insertions(+), 61 deletions(-) diff --git a/Pipfile b/Pipfile index 716cb4ab..ae337a53 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.2.1" +peewee = "==3.2.2" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 97a6d14f..380fdaf7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,20 +1,7 @@ { "_meta": { "hash": { - "sha256": "925fb4fb7b4fb6227dfc9730e817d95a220e00b5510b170b1b8e58757f3e3919" - }, - "host-environment-markers": { - "implementation_name": "cpython", - "implementation_version": "3.6.2", - "os_name": "posix", - "platform_machine": "x86_64", - "platform_python_implementation": "CPython", - "platform_release": "4.13.3-1-zen", - "platform_system": "Linux", - "platform_version": "#1 ZEN SMP PREEMPT Wed Sep 20 07:17:03 UTC 2017", - "python_full_version": "3.6.2", - "python_version": "3.6", - "sys_platform": "linux" + "sha256": "5f7b6afc62cf57780cae75d95ee578ec874c564e43bef61b1ffb5e2ee2653653" }, "pipfile-spec": 6, "requires": {}, @@ -29,10 +16,11 @@ "default": { "beautifulsoup4": { "hashes": [ - "sha256:7015e76bf32f1f574636c4288399a6de66ce08fb7b2457f628a8d70c0fbabb11", "sha256:11a9a27b7d3bddc6d86f59fb76afb70e921a25ac2d6cc55b40d072bd68435a76", + "sha256:7015e76bf32f1f574636c4288399a6de66ce08fb7b2457f628a8d70c0fbabb11", "sha256:808b6ac932dccb0a4126558f7dfdcf41710dd44a4ef497a0bb59a77f9f078e89" ], + "index": "pypi", "version": "==4.6.0" }, "certifi": { @@ -44,29 +32,31 @@ }, "chardet": { "hashes": [ - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" ], "version": "==3.0.4" }, "idna": { "hashes": [ - "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4", - "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" + "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f", + "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4" ], "version": "==2.6" }, "peewee": { - "hashes": - "sha256:ac72ea1e4c2060d10de6c6f6b5fefb6c0434f9fd60766227d8b8e44b1898e1ba" + "hashes": [ + "sha256:e31771a5a18576336eaf7883d1b4bfd9478d0af02ff5a8f932ec1c5ef56ca7e5" ], - "version": "==3.2.1" + "index": "pypi", + "version": "==3.2.2" }, "requests": { "hashes": [ "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" ], + "index": "pypi", "version": "==2.18.4" }, "urllib3": { @@ -78,53 +68,62 @@ } }, "develop": { + "attrs": { + "hashes": [ + "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9", + "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450" + ], + "version": "==17.4.0" + }, "coverage": { "hashes": [ - "sha256:7608a3dd5d73cb06c531b8925e0ef8d3de31fed2544a7de6c63960a1e73ea4bc", - "sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694", - "sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80", + "sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba", "sha256:0b136648de27201056c1869a6c0d4e23f464750fd9a9ba9750b8336a244429ed", + "sha256:104ab3934abaf5be871a583541e8829d6c19ce7bde2923b2751e0d3ca44db60a", + "sha256:15b111b6a0f46ee1a485414a52a7ad1d703bdf984e9ed3c288a4414d3871dcbd", + "sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640", + "sha256:1c383d2ef13ade2acc636556fd544dba6e14fa30755f26812f54300e401f98f2", + "sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162", + "sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508", "sha256:337ded681dd2ef9ca04ef5d93cfc87e52e09db2594c296b4a0a3662cb1b41249", + "sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694", + "sha256:3c79a6f7b95751cdebcd9037e4d06f8d5a9b60e4ed0cd231342aa8ad7124882a", + "sha256:3d72c20bd105022d29b14a7d628462ebdc61de2f303322c0212a054352f3b287", "sha256:3eb42bf89a6be7deb64116dd1cc4b08171734d721e7a7e57ad64cc4ef29ed2f1", - "sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9", - "sha256:69bf008a06b76619d3c3f3b1983f5145c75a305a0fea513aca094cae5c40a8f5", - "sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508", - "sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f", - "sha256:701cd6093d63e6b8ad7009d8a92425428bc4d6e7ab8d75efbb665c806c1d79ba", + "sha256:4635a184d0bbe537aa185a34193898eee409332a8ccb27eea36f262566585000", + "sha256:56e448f051a201c5ebbaa86a5efd0ca90d327204d8b059ab25ad0f35fbfd79f1", "sha256:5a13ea7911ff5e1796b6d5e4fbbf6952381a611209b736d48e675c2756f3f74e", - "sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd", - "sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba", - "sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162", - "sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d", - "sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558", - "sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c", + "sha256:69bf008a06b76619d3c3f3b1983f5145c75a305a0fea513aca094cae5c40a8f5", "sha256:6bc583dc18d5979dc0f6cec26a8603129de0304d5ae1f17e57a12834e7235062", - "sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640", - "sha256:7aa36d2b844a3e4a4b356708d79fd2c260281a7390d678a10b91ca595ddc9e99", - "sha256:3d72c20bd105022d29b14a7d628462ebdc61de2f303322c0212a054352f3b287", - "sha256:4635a184d0bbe537aa185a34193898eee409332a8ccb27eea36f262566585000", - "sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", + "sha256:701cd6093d63e6b8ad7009d8a92425428bc4d6e7ab8d75efbb665c806c1d79ba", + "sha256:7608a3dd5d73cb06c531b8925e0ef8d3de31fed2544a7de6c63960a1e73ea4bc", "sha256:76ecd006d1d8f739430ec50cc872889af1f9c1b6b8f48e29941814b09b0fd3cc", + "sha256:7aa36d2b844a3e4a4b356708d79fd2c260281a7390d678a10b91ca595ddc9e99", "sha256:7d3f553904b0c5c016d1dad058a7554c7ac4c91a789fca496e7d8347ad040653", - "sha256:3c79a6f7b95751cdebcd9037e4d06f8d5a9b60e4ed0cd231342aa8ad7124882a", - "sha256:56e448f051a201c5ebbaa86a5efd0ca90d327204d8b059ab25ad0f35fbfd79f1", + "sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c", + "sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558", + "sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f", + "sha256:9e112fcbe0148a6fa4f0a02e8d58e94470fc6cb82a5481618fea901699bf34c4", "sha256:ac4fef68da01116a5c117eba4dd46f2e06847a497de5ed1d64bb99a5fda1ef91", - "sha256:1c383d2ef13ade2acc636556fd544dba6e14fa30755f26812f54300e401f98f2", "sha256:b8815995e050764c8610dbc82641807d196927c3dbed207f0a079833ffcf588d", - "sha256:104ab3934abaf5be871a583541e8829d6c19ce7bde2923b2751e0d3ca44db60a", - "sha256:9e112fcbe0148a6fa4f0a02e8d58e94470fc6cb82a5481618fea901699bf34c4", - "sha256:15b111b6a0f46ee1a485414a52a7ad1d703bdf984e9ed3c288a4414d3871dcbd", + "sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9", + "sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd", + "sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d", + "sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", "sha256:e4d96c07229f58cb686120f168276e434660e4358cc9cf3b0464210b04913e77", + "sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80", "sha256:f8a923a85cb099422ad5a2e345fe877bbc89a8a8b23235824a93488150e45f6e" ], + "index": "pypi", "version": "==4.5.1" }, "flake8": { "hashes": [ - "sha256:f1a9d8886a9cbefb52485f4f4c770832c7fb569c084a9a314fb1eaa37c0c2c86", - "sha256:c20044779ff848f67f89c56a0e4624c04298cd476e25253ac0c36f910a1a11d8" + "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", + "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" ], - "version": "==3.4.1" + "index": "pypi", + "version": "==3.5.0" }, "mccabe": { "hashes": [ @@ -133,17 +132,31 @@ ], "version": "==0.6.1" }, + "more-itertools": { + "hashes": [ + "sha256:0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea", + "sha256:11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e", + "sha256:c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44" + ], + "version": "==4.1.0" + }, + "pluggy": { + "hashes": [ + "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" + ], + "version": "==0.6.0" + }, "py": { "hashes": [ - "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a", - "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881" + "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881", + "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a" ], "version": "==1.5.3" }, "pycodestyle": { "hashes": [ - "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9", - "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766" + "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", + "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" ], "version": "==2.3.1" }, @@ -159,25 +172,39 @@ "sha256:01b90474d5c889c21cae88f0d5fc8db1334b2891a16df75cbf9a0886bfdea653", "sha256:745299c99b7a4015251b4876ecd59dd62803f458a9f0540d036f0f6627dcc67e" ], + "index": "pypi", "version": "==0.5.0" }, "pytest": { - "hashes": [], + "hashes": [ + "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c", + "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1" + ], + "index": "pypi", "version": "==3.5.0" }, "pytest-cov": { "hashes": [ - "sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec", - "sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d" + "sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d", + "sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec" ], + "index": "pypi", "version": "==2.5.1" }, "pytest-flake8": { "hashes": [ - "sha256:43598dfa211242525897866ff35fa553ebd88177383783079099057c7ad04331", - "sha256:3996de65a1219697596acac755090c70c47ec901edc438ea88ce1aa6098fb905" + "sha256:3996de65a1219697596acac755090c70c47ec901edc438ea88ce1aa6098fb905", + "sha256:43598dfa211242525897866ff35fa553ebd88177383783079099057c7ad04331" ], + "index": "pypi", "version": "==1.0.0" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" } } } diff --git a/requirements.txt b/requirements.txt index fb94f468..65bc01fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.2.1 +peewee==3.2.2 requests==2.18.4 \ No newline at end of file From 7cfaa26fe6f6d1e9b6e265947472cad8aeaa7b82 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 10 Apr 2018 08:43:47 +0800 Subject: [PATCH 064/508] [travis.yml] Fix distributions part of PyPI deployment distributions should not be in `on:` ref: --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 528e370a..a7deb9c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ deploy: user: M157q password: secure: fTh18TIYqUsyGEg4vIEmxcxYPFCW5VDp4Ma+kuUjDh6qBpcY4akS6M16iOEGJp2QLndJiFdjW2JSOY7TR+HUCBEm6VTU7uYITPlNtYbMSKo0QjTkuLM/6/rufFwUMiDaw/mGSUuW04T6/+2RGFXFU9/JrRJqa96Le3Q9FqnVaQg= + distributions: "sdist bdist_wheel" on: branch: master tags: true - distributions: "sdist bdist_wheel" From 65a22dd91b63f3847b6d49c5e54fb578b9b83858 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 10 Apr 2018 08:46:24 +0800 Subject: [PATCH 065/508] [travis.yml] Don't deploy to PyPI when the build is cron Added daily cron build on Travis CI for checking whether zdict works fine regularly. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a7deb9c2..4442d104 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,3 +57,4 @@ deploy: on: branch: master tags: true + condition: $TRAVIS_EVENT_TYPE != cron From f74cec4629d7f495f2285d2b15aa7be66cfd7523 Mon Sep 17 00:00:00 2001 From: Tzu-ting Date: Tue, 10 Apr 2018 23:04:04 +0800 Subject: [PATCH 066/508] Add Oxford Dictionaries support (#209), thanks @tzing NOTICE: users need to register API key to use this dictionary --- README.rst | 10 + zdict/dictionaries/oxford.py | 187 +++++++++++++ zdict/dictionary.py | 7 +- zdict/exceptions.py | 8 + zdict/tests/dictionaries/test_oxford.py | 357 ++++++++++++++++++++++++ 5 files changed, 567 insertions(+), 2 deletions(-) create mode 100644 zdict/dictionaries/oxford.py create mode 100644 zdict/tests/dictionaries/test_oxford.py diff --git a/README.rst b/README.rst index 24c428cb..dacd31ca 100644 --- a/README.rst +++ b/README.rst @@ -176,6 +176,16 @@ Screenshots .. image:: https://user-images.githubusercontent.com/2716047/29741879-ca1a3826-8a3a-11e7-9701-4a7e9a15971a.png +`Oxford Dictionary `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: http://i.imgur.com/VkPEfKh.png + +To use this source, you should first `apply `_ an API key and place it under ``~/.zdict/oxford.key`` in the format:: + + app_id, app_key + + Development & Contributing --------------------------- diff --git a/zdict/dictionaries/oxford.py b/zdict/dictionaries/oxford.py new file mode 100644 index 00000000..eb873248 --- /dev/null +++ b/zdict/dictionaries/oxford.py @@ -0,0 +1,187 @@ +import json +import os +import re + +from zdict.constants import BASE_DIR +from zdict.dictionary import DictBase +from zdict.exceptions import NotFoundError, QueryError, APIKeyError +from zdict.models import Record + + +class OxfordDictionary(DictBase): + """ + Docs: + + * https://developer.oxforddictionaries.com/documentation/ + """ + + KEY_FILE = os.path.join(BASE_DIR, 'oxford.key') + + API = 'https://od-api.oxforddictionaries.com/api/v1/entries/en/{word}' + + # https://developer.oxforddictionaries.com/documentation/response-codes + status_code = { + 200: 'Success!', + 400: 'The request was invalid or cannot be otherwise served.', + 403: 'The request failed due to invalid credentials.', + 404: 'No entry is found.', + 500: 'Something is broken. Please contact the Oxford Dictionaries ' + 'API team to investigate.', + 502: 'Oxford Dictionaries API is down or being upgraded.', + 503: 'The Oxford Dictionaries API servers are up, but overloaded ' + 'with requests. Please try again later.', + 504: 'The Oxford Dictionaries API servers are up, but the request ' + 'couldn’t be serviced due to some failure within our stack. ' + 'Please try again later.' + } + + @property + def provider(self): + return 'oxford' + + @property + def title(self): + return 'Oxford Dictionary' + + def _get_url(self, word) -> str: + return self.API.format(word=word.lower()) + + def show(self, record: Record): + content = json.loads(record.content) + + # results + for headword in content['results']: + # word + self.color.print(headword['word'], 'lyellow') + + for lex_ent in headword['lexicalEntries']: + # lexical category + print() + self.color.print(lex_ent['lexicalCategory'], 'lred', end='') + + # pronunciation + if 'pronunciations' in lex_ent: + pronunciations = [ + '/' + pronun['phoneticSpelling'] + '/' + for pronun in lex_ent['pronunciations'] + ] + pronunciations_str = ' '.join(pronunciations) + self.color.print(' ' + pronunciations_str) + else: + print() + + # entry + idx = 1 + for entry in lex_ent['entries']: + for sense in entry['senses']: + line_prefix = '{idx}.'.format(idx=idx) + self._show_sense(sense, line_prefix) + idx += 1 + + print() + + def _show_sense(self, sense: dict, prefix='', indent=1): + print() + self.color.print(prefix, end=' ', indent=indent) + + # regions + if 'regions' in sense: + regions_str = ', '.join(sense['regions']) + regions_str = '(' + regions_str + ')' + self.color.print(regions_str, 'yellow', end=' ') + + # register + if 'registers' in sense: + registers_str = ', '.join(sense['registers']) + self.color.print(registers_str, 'red', end=' ') + + # domain + if 'domains' in sense: + domains_str = ', '.join(sense['domains']) + domains_str = '(' + domains_str + ') ' + self.color.print(domains_str, 'green', end='') + + # notes + if 'notes' in sense: + notes = [note['text'] for note in sense['notes']] + notes_str = ', '.join(notes) + notes_str = '[' + notes_str + '] ' + self.color.print(notes_str, 'magenta', end='') + + # definition + if 'definitions' in sense: + definition_str = '. '.join(sense['definitions']) + print(definition_str) + + # cross ref + if 'crossReferenceMarkers' in sense: + xref_marker_str = '. '.join(sense['crossReferenceMarkers']) + print(xref_marker_str) + + # example + for example in sense.get('examples', []): + print() + print(' ' * (indent + 1), end=' ') + self.color.print(example['text'], 'indigo', indent=indent+2) + + # subsenses + if self.args.verbose and 'subsenses' in sense: + for idx, subsense in enumerate(sense['subsenses'], 1): + line_prefix = '{prefix}{idx}.'.format(prefix=prefix, idx=idx) + self._show_sense(subsense, line_prefix, indent=indent + 1) + + def _get_app_key(self): + """ + Get the app id & key for query + + .. note:: app key storage + The API key should placed in ``KEY_FILE`` in the ``~/.zdict`` with + the format:: + + app_id,app_key + + .. note:: request limit + request limit: per minute is 60, per month is 3000. + """ + if not os.path.exists(self.KEY_FILE): + self.color.print('You can get an API key by the following steps:', + 'yellow') + print('1. Register a developer account at ' + 'https://developer.oxforddictionaries.com/') + print('2. Get the application id & keys in the `credentials` page') + print('3. Paste the API key at `{key_file}` in the foramt:'.format( + key_file=self.KEY_FILE + )) + print(' app_id, app_key') + raise APIKeyError('Oxford: API key not found') + + with open(self.KEY_FILE) as fp: + keys = fp.read() + + keys = re.sub('\s', '', keys).split(',') + if len(keys) != 2: + print('The API key should be placed in the format:') + print(' app_id, app_key') + raise APIKeyError('Oxford: API key file format not correct.') + + return keys + + def query(self, word: str): + try: + app_id, app_key = self._get_app_key() + content = self._get_raw(word, headers={ + 'app_id': app_id, + 'app_key': app_key + }) + except QueryError as exception: + msg = self.status_code.get(exception.status_code, + 'Some bad thing happened') + self.color.print('Oxford: ' + msg, 'red') + raise NotFoundError(exception.word) + + record = Record( + word=word, + content=content, + source=self.provider, + ) + return record diff --git a/zdict/dictionary.py b/zdict/dictionary.py index 7feec7f4..d5d85fde 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -135,6 +135,9 @@ def lookup(self, word): except exceptions.TimeoutError as e: self.color.print(e, 'red') print() + except exceptions.APIKeyError as e: + self.color.print(e, 'red') + print() except exceptions.NotFoundError as e: self.color.print(e, 'yellow') print() @@ -143,7 +146,7 @@ def lookup(self, word): self.show(record) return - def _get_raw(self, word: str) -> str: + def _get_raw(self, word: str, **kwargs) -> str: ''' Get raw data from http request @@ -152,7 +155,7 @@ def _get_raw(self, word: str) -> str: try: res = requests.get( - self._get_url(word), timeout=self.args.query_timeout + self._get_url(word), timeout=self.args.query_timeout, **kwargs ) except requests.exceptions.ReadTimeout as e: raise exceptions.TimeoutError() diff --git a/zdict/exceptions.py b/zdict/exceptions.py index ab88b6a5..3f9dae2c 100644 --- a/zdict/exceptions.py +++ b/zdict/exceptions.py @@ -38,3 +38,11 @@ def __init__(self): '', )) ) + + +class APIKeyError(Exception): + def __init__(self, msg): + self.msg = msg + + def __str__(self): + return self.msg diff --git a/zdict/tests/dictionaries/test_oxford.py b/zdict/tests/dictionaries/test_oxford.py new file mode 100644 index 00000000..f2212f19 --- /dev/null +++ b/zdict/tests/dictionaries/test_oxford.py @@ -0,0 +1,357 @@ +from pytest import raises +from unittest.mock import Mock, mock_open, patch + +from zdict.dictionaries.oxford import OxfordDictionary +from zdict.exceptions import NotFoundError, QueryError +from zdict.models import Record +from zdict.zdict import get_args + + +class TestOxfordDictionary: + def setup_method(self, method): + self.dict = OxfordDictionary(get_args()) + + def teardown_method(self, method): + del self.dict + + def test_provider(self): + assert self.dict.provider == 'oxford' + + def test__get_url(self): + uri = 'https://od-api.oxforddictionaries.com/api/v1/entries/en/mock' + assert self.dict._get_url('mock') == uri + + @patch('os.path.exists') + def test__get_app_key(self, exists): + key_file = mock_open(read_data=""" + test_app_id, + test_app_key """) + + with patch('builtins.open', key_file): + app_id, app_key = self.dict._get_app_key() + + assert app_id == 'test_app_id' + assert app_key == 'test_app_key' + + def test_query_notfound(self): + self.dict._get_raw = Mock(side_effect=QueryError('mock', 404)) + self.dict._get_app_key = Mock(return_value=('id', 'key')) + + with raises(NotFoundError): + self.dict.query('mock') + + self.dict._get_raw.assert_called_with('mock', headers={ + 'app_id': 'id', + 'app_key': 'key' + }) + + @patch('zdict.dictionaries.oxford.Record') + def test_query_normal(self, Record): + self.dict._get_raw = Mock(return_value=SAMPLE_RESPONSE) + self.dict._get_app_key = Mock(return_value=('id', 'key')) + + self.dict.query('string') + + Record.assert_called_with(word='string', + content=SAMPLE_RESPONSE, + source='oxford') + + def test_show(self): + r = Record(word='string', + content=SAMPLE_RESPONSE, + source=self.dict.provider) + self.dict.show(r) + + +# the sample response copied from the official website +SAMPLE_RESPONSE = """ +{ + "metadata": {}, + "results": [ + { + "id": "string", + "language": "string", + "lexicalEntries": [ + { + "derivativeOf": [ + { + "domains": [ + "string" + ], + "id": "string", + "language": "string", + "regions": [ + "string" + ], + "registers": [ + "string" + ], + "text": "string" + } + ], + "derivatives": [ + { + "domains": [ + "string" + ], + "id": "string", + "language": "string", + "regions": [ + "string" + ], + "registers": [ + "string" + ], + "text": "string" + } + ], + "entries": [ + { + "etymologies": [ + "string" + ], + "grammaticalFeatures": [ + { + "text": "string", + "type": "string" + } + ], + "homographNumber": "string", + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + "string" + ] + } + ], + "senses": [ + { + "crossReferenceMarkers": [ + "string" + ], + "crossReferences": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "definitions": [ + "string" + ], + "domains": [ + "string" + ], + "examples": [ + { + "definitions": [ + "string" + ], + "domains": [ + "string" + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "regions": [ + "string" + ], + "registers": [ + "string" + ], + "senseIds": [ + "string" + ], + "text": "string", + "translations": [ + { + "domains": [ + "string" + ], + "grammaticalFeatures": [ + { + "text": "string", + "type": "string" + } + ], + "language": "string", + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "regions": [ + "string" + ], + "registers": [ + "string" + ], + "text": "string" + } + ] + } + ], + "id": "string", + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + "string" + ] + } + ], + "regions": [ + "string" + ], + "registers": [ + "string" + ], + "short_definitions": [ + "string" + ], + "subsenses": [ + {} + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "string" + } + ], + "translations": [ + { + "domains": [ + "string" + ], + "grammaticalFeatures": [ + { + "text": "string", + "type": "string" + } + ], + "language": "string", + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "regions": [ + "string" + ], + "registers": [ + "string" + ], + "text": "string" + } + ], + "variantForms": [ + { + "regions": [ + "string" + ], + "text": "string" + } + ] + } + ], + "variantForms": [ + { + "regions": [ + "string" + ], + "text": "string" + } + ] + } + ], + "grammaticalFeatures": [ + { + "text": "string", + "type": "string" + } + ], + "language": "string", + "lexicalCategory": "string", + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + "string" + ] + } + ], + "text": "string", + "variantForms": [ + { + "regions": [ + "string" + ], + "text": "string" + } + ] + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + "string" + ] + } + ], + "type": "string", + "word": "string" + } + ] +} +""" From 3e0bb014dd2c2e2f3c19a6b261d34a141fc31ba5 Mon Sep 17 00:00:00 2001 From: dv Date: Tue, 10 Apr 2018 23:15:04 +0800 Subject: [PATCH 067/508] Upgrade to v0.12.0 (#211) * Upgrade OSX CI test version to CPython 3.4.8/3.5.5/3.6.4 (#198) * Update pytest-flake8 to 1.0.0 (#200) * Update pytest to 3.5.0 (#202) * Update py to 1.5.3 (#201) * Update peewee to 3.2.2 (#208) * Update flake8 to 3.5.0 (#207) * Update Travis CI setting (65a22dd, 7cfaa26, 0f94522) * Add Oxford Dictionaries support (#209), thanks @tzing --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 600c860b..754cd0a0 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.11.0' +VERSION = '0.12.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 7567afa2f4c4f78a5afd778ab3ad34410cd4e1c6 Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 11 Apr 2018 00:09:50 +0800 Subject: [PATCH 068/508] [travis.yml] Only build for master branch --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4442d104..b4613249 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ +branches: + only: + - master + language: python matrix: From a746d5c7f9875b845a173bc9926b3eaef53a02ab Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 11 Apr 2018 01:09:14 +0800 Subject: [PATCH 069/508] [travis.yml] Use Trvis Build Stage (beta feature) for deploy + To avoid deploy muiltiple times when using Travis CI build matrix. + Should deploy after all tests passed. ref: --- .travis.yml | 57 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index b4613249..74a53440 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,31 +4,51 @@ branches: language: python -matrix: +jobs: + fast_finish: true + allow_failures: + - python: "nightly" include: - - os: linux + - stage: test + os: linux python: 3.4 - - os: linux + - stage: test + os: linux python: 3.5 - - os: linux + - stage: test + os: linux python: 3.6 - - os: linux - python: nightly - + - stage: test + os: linux + python: "nightly" # Python runtime is not yet available on OS X # https://github.com/travis-ci/travis-ci/issues/2312 - - os: osx + - stage: test + os: osx language: generic env: PYTHON_VERSION=3.4.8 - - os: osx + - stage: test + os: osx language: generic env: PYTHON_VERSION=3.5.5 - - os: osx + - stage: test + os: osx language: generic env: PYTHON_VERSION=3.6.4 - - allow_failures: - - python: "nightly" + - stage: deploy + os: linux + python: 3.4 + script: skip + deploy: &pypi + provider: pypi + user: M157q + password: + secure: fTh18TIYqUsyGEg4vIEmxcxYPFCW5VDp4Ma+kuUjDh6qBpcY4akS6M16iOEGJp2QLndJiFdjW2JSOY7TR+HUCBEm6VTU7uYITPlNtYbMSKo0QjTkuLM/6/rufFwUMiDaw/mGSUuW04T6/+2RGFXFU9/JrRJqa96Le3Q9FqnVaQg= + distributions: "sdist bdist_wheel" + on: + branch: master + tags: true + condition: $TRAVIS_EVENT_TYPE != cron before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi @@ -51,14 +71,3 @@ notifications: webhooks: urls: - https://webhooks.gitter.im/e/7498c1d7f0e50c212e1a - -deploy: - provider: pypi - user: M157q - password: - secure: fTh18TIYqUsyGEg4vIEmxcxYPFCW5VDp4Ma+kuUjDh6qBpcY4akS6M16iOEGJp2QLndJiFdjW2JSOY7TR+HUCBEm6VTU7uYITPlNtYbMSKo0QjTkuLM/6/rufFwUMiDaw/mGSUuW04T6/+2RGFXFU9/JrRJqa96Le3Q9FqnVaQg= - distributions: "sdist bdist_wheel" - on: - branch: master - tags: true - condition: $TRAVIS_EVENT_TYPE != cron From da9d7b8f41a2af90836dd2cb1d976885f998e3f5 Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 11 Apr 2018 02:38:37 +0800 Subject: [PATCH 070/508] [travis.yml] Change deploy conditions into stages ref: --- .travis.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 74a53440..787d13f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,11 @@ branches: language: python +stages: + - test + - name: deploy + if: branch = master AND tag =~ ^v\d+\.\d+\.\d+.*$ AND type IN (push, pull_request) + jobs: fast_finish: true allow_failures: @@ -23,18 +28,18 @@ jobs: python: "nightly" # Python runtime is not yet available on OS X # https://github.com/travis-ci/travis-ci/issues/2312 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.4.8 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.5.5 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.6.4 + # - stage: test + # os: osx + # language: generic + # env: PYTHON_VERSION=3.4.8 + # - stage: test + # os: osx + # language: generic + # env: PYTHON_VERSION=3.5.5 + # - stage: test + # os: osx + # language: generic + # env: PYTHON_VERSION=3.6.4 - stage: deploy os: linux python: 3.4 @@ -45,10 +50,6 @@ jobs: password: secure: fTh18TIYqUsyGEg4vIEmxcxYPFCW5VDp4Ma+kuUjDh6qBpcY4akS6M16iOEGJp2QLndJiFdjW2JSOY7TR+HUCBEm6VTU7uYITPlNtYbMSKo0QjTkuLM/6/rufFwUMiDaw/mGSUuW04T6/+2RGFXFU9/JrRJqa96Le3Q9FqnVaQg= distributions: "sdist bdist_wheel" - on: - branch: master - tags: true - condition: $TRAVIS_EVENT_TYPE != cron before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi From 2b469d785da4fe2bff291b83d9392f440793e965 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 10 Apr 2018 21:01:11 +0200 Subject: [PATCH 071/508] Update pycodestyle from 2.3.1 to 2.4.0 (#210) --- Pipfile.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 380fdaf7..e05a9ab4 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -155,10 +155,11 @@ }, "pycodestyle": { "hashes": [ - "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", - "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" + "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", + "sha256:74abc4e221d393ea5ce1f129ea6903209940c1ecd29e002e8c6933c2b21026e0", + "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" ], - "version": "==2.3.1" + "version": "==2.4.0" }, "pyflakes": { "hashes": [ From 2209204aa70e80720823f6c60d4be82d25a49232 Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 11 Apr 2018 03:02:10 +0800 Subject: [PATCH 072/508] [travis.yml] Add back OSX testings --- .travis.yml | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 787d13f9..6aa33e66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,5 @@ -branches: - only: - - master - language: python -stages: - - test - - name: deploy - if: branch = master AND tag =~ ^v\d+\.\d+\.\d+.*$ AND type IN (push, pull_request) - jobs: fast_finish: true allow_failures: @@ -28,18 +19,19 @@ jobs: python: "nightly" # Python runtime is not yet available on OS X # https://github.com/travis-ci/travis-ci/issues/2312 - # - stage: test - # os: osx - # language: generic - # env: PYTHON_VERSION=3.4.8 - # - stage: test - # os: osx - # language: generic - # env: PYTHON_VERSION=3.5.5 - # - stage: test - # os: osx - # language: generic - # env: PYTHON_VERSION=3.6.4 + - stage: test + os: osx + language: generic + env: PYTHON_VERSION=3.4.8 + - stage: test + os: osx + language: generic + env: PYTHON_VERSION=3.5.5 + - stage: test + os: osx + language: generic + env: PYTHON_VERSION=3.6.4 + - stage: deploy os: linux python: 3.4 @@ -50,6 +42,10 @@ jobs: password: secure: fTh18TIYqUsyGEg4vIEmxcxYPFCW5VDp4Ma+kuUjDh6qBpcY4akS6M16iOEGJp2QLndJiFdjW2JSOY7TR+HUCBEm6VTU7uYITPlNtYbMSKo0QjTkuLM/6/rufFwUMiDaw/mGSUuW04T6/+2RGFXFU9/JrRJqa96Le3Q9FqnVaQg= distributions: "sdist bdist_wheel" + on: + branch: master + tags: true + condition: $TRAVIS_EVENT_TYPE != cron before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi From c6c235a8d50972c7c41e0a450309f45972477297 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 15 Apr 2018 21:33:17 +0800 Subject: [PATCH 073/508] [setup.py] Fix parse_requirements for pip 10 --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 91a392ee..5d356d93 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,12 @@ from setuptools import find_packages, setup from setuptools.command.test import test as TestCommand -from pip.req import parse_requirements +try: + # for pip >= 10 + from pip._internal.req import parse_requirements +except ImportError: + # for pip <= 9.0.3 + from pip.req import parse_requirements ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) From 79a8711a1bbeac13922d02280712c00b6b147d44 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 15 Apr 2018 22:15:30 +0800 Subject: [PATCH 074/508] Upgrade to v0.12.1 + Support pip 10.0.0 --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 754cd0a0..1c0cd402 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.12.0' +VERSION = '0.12.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 892bdc4130ee62b7e4edd2c8378b23bec6e444f0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 18 Apr 2018 10:24:35 +0200 Subject: [PATCH 075/508] Update certifi to 2018.4.16 (#212) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index e05a9ab4..750daa29 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -25,10 +25,10 @@ }, "certifi": { "hashes": [ - "sha256:14131608ad2fd56836d33a71ee60fa1c82bc9d2c8d98b7bdbc631fe1b3cd1296", - "sha256:edbc3f203427eef571f79a7692bb160a2b0f7ccaa31953e99bd17e307cf63f7d" + "sha256:9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0", + "sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7" ], - "version": "==2018.1.18" + "version": "==2018.4.16" }, "chardet": { "hashes": [ From 7a3968d25b9886d96fc7b73ae27706dfac59893d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 19 Apr 2018 06:02:48 +0200 Subject: [PATCH 076/508] Update peewee to 3.2.4 (#213) * Update peewee from 3.2.2 to 3.2.4 --- Pipfile | 2 +- Pipfile.lock | 5 ++--- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index ae337a53..4fcb2919 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.2.2" +peewee = "==3.2.4" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 750daa29..ad0a261e 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,10 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:e31771a5a18576336eaf7883d1b4bfd9478d0af02ff5a8f932ec1c5ef56ca7e5" + "sha256:f82785b4c0a12b162808f44ec36b6bda23e8cad78ff3def41c37d0d455163db9" ], - "index": "pypi", - "version": "==3.2.2" + "version": "==3.2.4" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 65bc01fc..34a4df91 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.2.2 +peewee==3.2.4 requests==2.18.4 \ No newline at end of file From 57b5f337a64ba175155cb855bc1cc55f7b4a475a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 19 Apr 2018 19:57:48 +0200 Subject: [PATCH 077/508] Update peewee to 3.2.5 (#214) * Update peewee from 3.2.4 to 3.2.5 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 4fcb2919..76d1c25a 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.2.4" +peewee = "==3.2.5" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index ad0a261e..feba123a 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:f82785b4c0a12b162808f44ec36b6bda23e8cad78ff3def41c37d0d455163db9" + "sha256:2dc2895d5ef6680e3f27926740e0d1679ca946d8705a5a51f7145c05c2d9556e" ], - "version": "==3.2.4" + "version": "==3.2.5" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 34a4df91..de20d37e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.2.4 +peewee==3.2.5 requests==2.18.4 \ No newline at end of file From 835181ad9edb66fa7f22b73d03a36968f62e5d44 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 25 Apr 2018 10:29:50 +0200 Subject: [PATCH 078/508] Update pytest to 3.5.1 (#216) * Update pytest from 3.5.0 to 3.5.1 --- Pipfile | 2 +- Pipfile.lock | 7 +++---- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 76d1c25a..6d741924 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.5.0" +pytest = "==3.5.1" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.0" diff --git a/Pipfile.lock b/Pipfile.lock index feba123a..24469c20 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,11 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c", - "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1" + "sha256:829230122facf05a5f81a6d4dfe6454a04978ea3746853b2b84567ecf8e5c526", + "sha256:54713b26c97538db6ff0703a12b19aeaeb60b5e599de542e7fca0ec83b9038e8" ], - "index": "pypi", - "version": "==3.5.0" + "version": "==3.5.1" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 03878a5e..28036307 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.5.0 +pytest==3.5.1 pytest-cov==2.5.1 pytest-flake8==1.0.0 From d8607eae5a7641df755ffaf60ec97d177df855c9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 25 Apr 2018 10:30:13 +0200 Subject: [PATCH 079/508] Update peewee to 3.3.0 (#215) * Update peewee from 3.2.5 to 3.3.0 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 6d741924..b68650da 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.2.5" +peewee = "==3.3.0" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 24469c20..83ce14d1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:2dc2895d5ef6680e3f27926740e0d1679ca946d8705a5a51f7145c05c2d9556e" + "sha256:3f3887e705f8856d73305a8fd400d4bf25839a9560c4c16063ccc026f1f27885" ], - "version": "==3.2.5" + "version": "==3.3.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index de20d37e..99ec606c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.2.5 +peewee==3.3.0 requests==2.18.4 \ No newline at end of file From 9e088c129574b782ccb7a3920eca06a49ce8ab59 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 27 Apr 2018 06:45:23 +0200 Subject: [PATCH 080/508] Update peewee to 3.3.1 (#217) * Update peewee from 3.3.0 to 3.3.1 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index b68650da..c6b74912 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.3.0" +peewee = "==3.3.1" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 83ce14d1..e7d285d4 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:3f3887e705f8856d73305a8fd400d4bf25839a9560c4c16063ccc026f1f27885" + "sha256:b6d3addeee72513b954dc14371e6af397ac0d1c9b825b68221b95aa64b53de1f" ], - "version": "==3.3.0" + "version": "==3.3.1" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 99ec606c..620341c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.3.0 +peewee==3.3.1 requests==2.18.4 \ No newline at end of file From 01bd8f59e9cd2354ec3745acc4232ccb857bbf23 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 1 May 2018 05:27:07 +0200 Subject: [PATCH 081/508] Update pytest-flake8 to 1.0.1 (#218) * Update pytest-flake8 from 1.0.0 to 1.0.1 --- Pipfile | 2 +- Pipfile.lock | 7 +++---- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index c6b74912..f0ad42e7 100644 --- a/Pipfile +++ b/Pipfile @@ -19,4 +19,4 @@ flake8 = "==3.5.0" pyjokes = "==0.5.0" pytest = "==3.5.1" pytest-cov = "==2.5.1" -pytest-flake8 = "==1.0.0" +pytest-flake8 = "==1.0.1" diff --git a/Pipfile.lock b/Pipfile.lock index e7d285d4..baad5c78 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -192,11 +192,10 @@ }, "pytest-flake8": { "hashes": [ - "sha256:3996de65a1219697596acac755090c70c47ec901edc438ea88ce1aa6098fb905", - "sha256:43598dfa211242525897866ff35fa553ebd88177383783079099057c7ad04331" + "sha256:ec248d4a215d6c7cd9d3ca48f365ece0e3892b46d626c22a95ccc80188ff35ed", + "sha256:e5cdc4f459c9436ac6c649e428a014bb5988605858549397374ec29a776cae68" ], - "index": "pypi", - "version": "==1.0.0" + "version": "==1.0.1" }, "six": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 28036307..79ff1b13 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,4 +3,4 @@ flake8==3.5.0 pyjokes==0.5.0 pytest==3.5.1 pytest-cov==2.5.1 -pytest-flake8==1.0.0 +pytest-flake8==1.0.1 From dad4543ddb170ce85dee53f238faaa3c7ff30684 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 1 May 2018 11:59:21 +0800 Subject: [PATCH 082/508] [README] PyPi => PyPI --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index dacd31ca..cbb0de9d 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ So, we decided to create a new project. Installation ------------------------------ -from `PyPi `_ : +from `PyPI `_ : .. code-block:: sh From 5dea89532c8f552dc1ffed09f9f3904b6f49100f Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 1 May 2018 12:04:40 +0800 Subject: [PATCH 083/508] [README] Update link of PyPI --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index cbb0de9d..1f9d8c28 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ So, we decided to create a new project. Installation ------------------------------ -from `PyPI `_ : +from `PyPI `_ : .. code-block:: sh From 57ebac248b1d368b44967b7ac6f8b185a5bebd2b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 1 May 2018 19:36:40 +0200 Subject: [PATCH 084/508] Update peewee to 3.3.2 (#219) * Update peewee from 3.3.1 to 3.3.2 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index f0ad42e7..0ab904ed 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.3.1" +peewee = "==3.3.2" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index baad5c78..177ed6d6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:b6d3addeee72513b954dc14371e6af397ac0d1c9b825b68221b95aa64b53de1f" + "sha256:178e86f7cdc53b4d982caa2304f82b1eba598c0283700eec931d33c9605080c8" ], - "version": "==3.3.1" + "version": "==3.3.2" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 620341c6..9277d90e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.3.1 +peewee==3.3.2 requests==2.18.4 \ No newline at end of file From 6eb6a53476c91e7c6b4d953d7c7af4f9cf648583 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 3 May 2018 20:51:18 +0200 Subject: [PATCH 085/508] Update peewee to 3.3.3 (#220) * Update peewee from 3.3.2 to 3.3.3 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 0ab904ed..7b7a911d 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.3.2" +peewee = "==3.3.3" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 177ed6d6..a707f13c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:178e86f7cdc53b4d982caa2304f82b1eba598c0283700eec931d33c9605080c8" + "sha256:518375df27e0209081c2794b4f562cc632402c169047ef594827da1647f585ce" ], - "version": "==3.3.2" + "version": "==3.3.3" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 9277d90e..2c8e659d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.3.2 +peewee==3.3.3 requests==2.18.4 \ No newline at end of file From bbcfbbf4b5b7b45963a5aa3a056936a03994241a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 3 May 2018 21:21:57 +0200 Subject: [PATCH 086/508] Update attrs to 18.1.0 (#221) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index a707f13c..bb8b7e10 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -69,10 +69,10 @@ "develop": { "attrs": { "hashes": [ - "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9", - "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450" + "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", + "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" ], - "version": "==17.4.0" + "version": "==18.1.0" }, "coverage": { "hashes": [ From ab3d83427313aae07ab8e2ce73ff96f16213067c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 4 May 2018 19:59:59 +0200 Subject: [PATCH 087/508] Update peewee to 3.3.4 (#222) * Update peewee from 3.3.3 to 3.3.4 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 7b7a911d..6fca1edc 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.3.3" +peewee = "==3.3.4" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index bb8b7e10..9a850758 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:518375df27e0209081c2794b4f562cc632402c169047ef594827da1647f585ce" + "sha256:0b9527ec3c09388f739c9dc6b465a7ea6e3cc6906f4a294ecd43467cdbb48272" ], - "version": "==3.3.3" + "version": "==3.3.4" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 2c8e659d..dc812b36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.3.3 +peewee==3.3.4 requests==2.18.4 \ No newline at end of file From e9be7176d18acfe417238077a87ede76dfcd7681 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 23 May 2018 16:27:16 +0200 Subject: [PATCH 088/508] Update pyflakes from 1.6.0 to 2.0.0 (#224) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 9a850758..3513aee3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -162,10 +162,10 @@ }, "pyflakes": { "hashes": [ - "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", - "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" + "sha256:f661252913bc1dbe7fcfcbf0af0db3f42ab65aabd1a6ca68fe5d466bace94dae", + "sha256:9a7662ec724d0120012f6e29d6248ae3727d821bba522a0e6b356eff19126a49" ], - "version": "==1.6.0" + "version": "==2.0.0" }, "pyjokes": { "hashes": [ From fa949b8a8aeec24cab728cf23192aa9f6dabc612 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 23 May 2018 17:08:17 +0200 Subject: [PATCH 089/508] Update pytest to 3.6.0 (#225) This PR updates [pytest](https://pypi.org/project/pytest) from **3.5.1** to **3.6.0**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 6fca1edc..9544d4bf 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.5.1" +pytest = "==3.6.0" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.1" diff --git a/Pipfile.lock b/Pipfile.lock index 3513aee3..f1193462 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:829230122facf05a5f81a6d4dfe6454a04978ea3746853b2b84567ecf8e5c526", - "sha256:54713b26c97538db6ff0703a12b19aeaeb60b5e599de542e7fca0ec83b9038e8" + "sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a", + "sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d" ], - "version": "==3.5.1" + "version": "==3.6.0" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 79ff1b13..850e0477 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.5.1 +pytest==3.6.0 pytest-cov==2.5.1 pytest-flake8==1.0.1 From b1d72e8a7f870545d95c5e7b4f4c50641fd24e28 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 23 May 2018 17:08:43 +0200 Subject: [PATCH 090/508] Update peewee to 3.4.0 (#223) * Update peewee from 3.3.4 to 3.4.0 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 9544d4bf..a246f41f 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.3.4" +peewee = "==3.4.0" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index f1193462..db246380 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:0b9527ec3c09388f739c9dc6b465a7ea6e3cc6906f4a294ecd43467cdbb48272" + "sha256:7344f317cc0cc0e9acf43eb493bf4dc5963a94ccd6867f27795abc85a972e265" ], - "version": "==3.3.4" + "version": "==3.4.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index dc812b36..e66b996e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.3.4 +peewee==3.4.0 requests==2.18.4 \ No newline at end of file From 9d3b627d0971aa240456d8ae316d2ff5cf04297d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 6 Jun 2018 10:56:36 +0200 Subject: [PATCH 091/508] Update pytest to 3.6.1 (#228) * Update pytest from 3.6.0 to 3.6.1 * Update pytest from 3.6.0 to 3.6.1 * Update pytest from 3.6.0 to 3.6.1 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index a246f41f..cc65abbd 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.18.4" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.6.0" +pytest = "==3.6.1" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.1" diff --git a/Pipfile.lock b/Pipfile.lock index db246380..573d10d0 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a", - "sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d" + "sha256:26838b2bc58620e01675485491504c3aa7ee0faf335c37fcd5f8731ca4319591", + "sha256:32c49a69566aa7c333188149ad48b58ac11a426d5352ea3d8f6ce843f88199cb" ], - "version": "==3.6.0" + "version": "==3.6.1" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 850e0477..0904dc85 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.6.0 +pytest==3.6.1 pytest-cov==2.5.1 pytest-flake8==1.0.1 From ad26983a44b7db592e3ab3d0b6aef9bb6963f4ff Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 8 Jun 2018 04:05:49 +0200 Subject: [PATCH 092/508] Update peewee to 3.5.0 (#227) * Update peewee from 3.4.0 to 3.5.0 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index cc65abbd..dbde9b3e 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.4.0" +peewee = "==3.5.0" requests = "==2.18.4" diff --git a/Pipfile.lock b/Pipfile.lock index 573d10d0..ad02b694 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:7344f317cc0cc0e9acf43eb493bf4dc5963a94ccd6867f27795abc85a972e265" + "sha256:7bd76cf2f7fdda898ed5235774f6edd8104a712ecad9883ba91dfef8ad85d3e3" ], - "version": "==3.4.0" + "version": "==3.5.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index e66b996e..62b5d2fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.4.0 +peewee==3.5.0 requests==2.18.4 \ No newline at end of file From e356d0fa4b6f1aeca5d9a55948066b7479a63b63 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 8 Jun 2018 04:07:53 +0200 Subject: [PATCH 093/508] Update more-itertools from 4.1.0 to 4.2.0 (#226) --- Pipfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index ad02b694..d4b18bdc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -133,11 +133,11 @@ }, "more-itertools": { "hashes": [ - "sha256:0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea", - "sha256:11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e", - "sha256:c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44" + "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0", + "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", + "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8" ], - "version": "==4.1.0" + "version": "==4.2.0" }, "pluggy": { "hashes": [ From 8a94678484f7fcb8c72f6a4fac949f30e3af3dd4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 12 Jun 2018 03:05:48 +0200 Subject: [PATCH 094/508] Update idna from 2.6 to 2.7 (#229) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index d4b18bdc..2fc06e5f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -39,10 +39,10 @@ }, "idna": { "hashes": [ - "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f", - "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4" + "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", + "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" ], - "version": "==2.6" + "version": "==2.7" }, "peewee": { "hashes": [ From 956feba1b46e3974d54047cc409c22af6bcfd4e0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 15 Jun 2018 06:46:28 +0200 Subject: [PATCH 095/508] Update requests to 2.19.1 (#231) * Update requests from 2.18.4 to 2.19.1 --- Pipfile | 2 +- Pipfile.lock | 7 +++---- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index dbde9b3e..6b0d6c67 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" beautifulsoup4 = "==4.6.0" peewee = "==3.5.0" -requests = "==2.18.4" +requests = "==2.19.1" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 2fc06e5f..01a3fdd2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -52,11 +52,10 @@ }, "requests": { "hashes": [ - "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", - "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" + "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1", + "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a" ], - "index": "pypi", - "version": "==2.18.4" + "version": "==2.19.1" }, "urllib3": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 62b5d2fd..440e5e94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 peewee==3.5.0 -requests==2.18.4 \ No newline at end of file +requests==2.19.1 \ No newline at end of file From 48abcac12df75367cc3c45d41ec08c2e52ee4f11 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 21 Jun 2018 10:55:10 +0200 Subject: [PATCH 096/508] Update pytest to 3.6.2 (#232) This PR updates [pytest](https://pypi.org/project/pytest) from **3.6.1** to **3.6.2**. *The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*
Links - PyPI: https://pypi.org/project/pytest - Changelog: https://pyup.io/changelogs/pytest/ - Repo: https://github.com/pytest-dev/pytest/issues - Homepage: http://pytest.org
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 6b0d6c67..3c1ed2fe 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.6.1" +pytest = "==3.6.2" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.1" diff --git a/Pipfile.lock b/Pipfile.lock index 01a3fdd2..8617e9f2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -176,10 +176,10 @@ }, "pytest": { "hashes": [ - "sha256:26838b2bc58620e01675485491504c3aa7ee0faf335c37fcd5f8731ca4319591", - "sha256:32c49a69566aa7c333188149ad48b58ac11a426d5352ea3d8f6ce843f88199cb" + "sha256:90898786b3d0b880b47645bae7b51aa9bbf1e9d1e4510c2cfd15dd65c70ea0cd", + "sha256:8ea01fc4fcc8e1b1e305252b4bc80a1528019ab99fd3b88666c9dc38d754406c" ], - "version": "==3.6.1" + "version": "==3.6.2" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 0904dc85..0b0617ae 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.6.1 +pytest==3.6.2 pytest-cov==2.5.1 pytest-flake8==1.0.1 From 45d7913b0fa4ab6abb971368e135db68f302d85a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 29 Jun 2018 04:08:40 +0200 Subject: [PATCH 097/508] Update py to 1.5.4 (#233) This PR updates [py](https://pypi.org/project/py) from **1.5.3** to **1.5.4**.
Changelog ### 1.5.4 ``` ================== - fix pytest-dev/pytest3451: don't make assumptions about fs case sensitivity in ``make_numbered_dir``. ```
Links - PyPI: https://pypi.org/project/py - Changelog: https://pyup.io/changelogs/py/ - Repo: https://github.com/pytest-dev/py/issues - Docs: http://py.readthedocs.io/
--- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 8617e9f2..8434d746 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -146,10 +146,10 @@ }, "py": { "hashes": [ - "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881", - "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a" + "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e", + "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7" ], - "version": "==1.5.3" + "version": "==1.5.4" }, "pycodestyle": { "hashes": [ From d63534bdce189353d68d6bc25e115dcb63bdc073 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 29 Jun 2018 04:08:57 +0200 Subject: [PATCH 098/508] Update peewee to 3.5.1 (#234) * Update peewee from 3.5.0 to 3.5.1 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 3c1ed2fe..c87d6771 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.5.0" +peewee = "==3.5.1" requests = "==2.19.1" diff --git a/Pipfile.lock b/Pipfile.lock index 8434d746..1ffaacca 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:7bd76cf2f7fdda898ed5235774f6edd8104a712ecad9883ba91dfef8ad85d3e3" + "sha256:70bd475e8d45d73ff27d26f21c7833d901311bb64b29ccc70474c5843bab5227" ], - "version": "==3.5.0" + "version": "==3.5.1" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 440e5e94..8a1280c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.5.0 +peewee==3.5.1 requests==2.19.1 \ No newline at end of file From 85139278c941a9b4475ed81eb65e0de5029ab5e0 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 1 Jul 2018 17:15:20 +0800 Subject: [PATCH 099/508] =?UTF-8?q?=F0=9F=94=A5=20Add=20a=20log=20and=20li?= =?UTF-8?q?nk=20to=20GitHub=20issue=20when=20query=20goes=20wrong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zdict/dictionary.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zdict/dictionary.py b/zdict/dictionary.py index d5d85fde..f66d8a9d 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -141,6 +141,16 @@ def lookup(self, word): except exceptions.NotFoundError as e: self.color.print(e, 'yellow') print() + except Exception as e: + import traceback + traceback.print_exc() + print() + print("We have problem for this word 😢") + print("Please report this word to https://github.com/zdict/zdict/issues") + print("Dictionary: {}".format(self.title)) + print("Word: '{}'".format(word)) + import sys + sys.exit(1) else: self.save(record, word) self.show(record) From 38280da9f5e4db6f27ad4fe8519e556b2b4ce093 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 1 Jul 2018 17:19:21 +0800 Subject: [PATCH 100/508] =?UTF-8?q?=F0=9F=90=9B=20Fix=20exception=20for=20?= =?UTF-8?q?Yahoo=20dictionary=20when=20querying=20"metadata"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zdict/dictionaries/yahoo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index 88c87288..7f52bcc9 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -233,7 +233,9 @@ def getg(d): node = node.select('> div') p = None # optional - if len(node) == 5: + if len(node) == 6: # e.g. "metadata" + _, w, p, _, _, e = node + elif len(node) == 5: _, w, p, _, e = node elif len(node) == 4: # e.g. "hold on" _, w, _, e = node From 969c5c16a880582c304585acc89fbd462e18f805 Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Sun, 1 Jul 2018 20:33:33 +0800 Subject: [PATCH 101/508] =?UTF-8?q?=F0=9F=94=A7=20Fix=20flake8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zdict/dictionary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zdict/dictionary.py b/zdict/dictionary.py index f66d8a9d..c45bd15a 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -144,9 +144,10 @@ def lookup(self, word): except Exception as e: import traceback traceback.print_exc() + url = "https://github.com/zdict/zdict/issues" print() print("We have problem for this word 😢") - print("Please report this word to https://github.com/zdict/zdict/issues") + print("Please report this word to {}".format(url)) print("Dictionary: {}".format(self.title)) print("Word: '{}'".format(word)) import sys From b10403cbfae7fb43e7c1c05d4f527d5295892ae1 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 1 Jul 2018 22:10:23 +0800 Subject: [PATCH 102/508] [Dockefile] Shrink Docker image size and use non-root user + Shrink Docker image size by using Python 3.6.5 alpine. + From 470MB to 103MB + Use `zdict` user instead of default `root` user. --- Dockerfile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2d2d5ca1..45a71d25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,11 @@ -FROM ubuntu:16.04 +FROM python:3.6.5-alpine -# Set the locale -RUN apt-get clean && apt-get update && apt-get install -y locales -RUN locale-gen en_US.UTF-8 -ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_ALL="en_US.UTF-8" - -# Install Python3 & pip3 -RUN apt-get install -y python3 python3-pip -RUN pip3 install --upgrade pip - -# Install zdict WORKDIR /srv/work/ ADD . /srv/work/ RUN pip3 install -e . +RUN addgroup -S zdict && adduser -S -G zdict zdict +USER zdict +WORKDIR /home/zdict + ENTRYPOINT ["zdict"] From 1cfaeb24317857285d62d227ad8d4158e7f2f373 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 1 Jul 2018 22:30:44 +0800 Subject: [PATCH 103/508] [#236] Add 'metadata' into yahoo_dict testings --- zdict/tests/dictionaries/test_yahoo.py | 48 +++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/zdict/tests/dictionaries/test_yahoo.py b/zdict/tests/dictionaries/test_yahoo.py index 2e4f051a..130bb901 100644 --- a/zdict/tests/dictionaries/test_yahoo.py +++ b/zdict/tests/dictionaries/test_yahoo.py @@ -10,14 +10,14 @@ class TestyDict: @classmethod def setup_class(cls): cls.dict = YahooDict(get_args()) - cls.word = 'style' - cls.record = cls.dict.query(cls.word) + cls.words = ['style', 'metadata'] + cls.records = [cls.dict.query(word) for word in cls.words] @classmethod def teardown_class(cls): del cls.dict - del cls.word - del cls.record + del cls.words + del cls.records def test_provider(self): assert self.dict.provider == 'yahoo' @@ -32,35 +32,43 @@ def test__get_url(self): def test_show(self): # god bless this method, hope that it do not raise any exception self.dict.args.verbose = False - self.dict.show(self.record) + + for record in self.records: + self.dict.show(record) def test_show_verbose(self): # god bless this method, hope that it do not raise any exception self.dict.args.verbose = True - self.dict.show(self.record) + + for record in self.records: + self.dict.show(record) @patch('zdict.dictionaries.yahoo.Record') def test_query_normal(self, Record): self.dict.args.verbose = False - self.dict.query(self.word) - Record.assert_called_with( - word=self.word, - content=self.record.content, - source='yahoo', - ) + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.records[i].content, + source='yahoo', + ) @patch('zdict.dictionaries.yahoo.Record') def test_query_verbose(self, Record): self.dict.args.verbose = True - self.dict.query(self.word) - Record.assert_called_with( - word=self.word, - content=self.record.content, - source='yahoo', - ) + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.records[i].content, + source='yahoo', + ) def test_query_not_found(self): self.dict._get_raw = Mock(return_value='{"data": []}') with raises(NotFoundError): - self.dict.query(self.word) - self.dict._get_raw.assert_called_with(self.word) + self.dict.query(self.words[0]) + self.dict._get_raw.assert_called_with(self.words[0]) From 640df9ce01125e7b65d6190b6508e598452f40e8 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 1 Jul 2018 22:48:02 +0800 Subject: [PATCH 104/508] Bump version to v0.12.2 + Update dependencies versions. + Fix yahoo_dict bug. [#236] + Shrink Docker image size. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 1c0cd402..c94cf244 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.12.1' +VERSION = '0.12.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 51814ed459f9d3bf578f8dab1ad1af1592b21dde Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 1 Jul 2018 22:48:02 +0800 Subject: [PATCH 105/508] Update PyPI deployment settings Try to fix authentication error. ref: --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6aa33e66..2d5a113e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ jobs: provider: pypi user: M157q password: - secure: fTh18TIYqUsyGEg4vIEmxcxYPFCW5VDp4Ma+kuUjDh6qBpcY4akS6M16iOEGJp2QLndJiFdjW2JSOY7TR+HUCBEm6VTU7uYITPlNtYbMSKo0QjTkuLM/6/rufFwUMiDaw/mGSUuW04T6/+2RGFXFU9/JrRJqa96Le3Q9FqnVaQg= + secure: SxXAmsEixEw9bIiSTFiRxU4JiILsLZ/wMRys+w5zwmHftyI6+div5j1FcwtxsmAGcSSzsNgKvF9OBCcKuaJ6rlHf87pf13CxsCeZubKKHod7aMywjTtSKRGA70fKB5h+p0qomRgpV1njvgPwLcLeEbr9rHTxjIXBiE77P4E59zk= distributions: "sdist bdist_wheel" on: branch: master From 7dc69c153391e8f5dbf2d73bc6246cecc6922c95 Mon Sep 17 00:00:00 2001 From: dv Date: Mon, 2 Jul 2018 21:39:31 +0800 Subject: [PATCH 106/508] =?UTF-8?q?=F0=9F=93=96=20Add=20table=20of=20conte?= =?UTF-8?q?nt=20to=20README=20(#237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.rst b/README.rst index 1f9d8c28..7efc6ed7 100644 --- a/README.rst +++ b/README.rst @@ -8,6 +8,14 @@ zdict |gitter| + +---- + +.. contents:: Table of Contents + +---- + + *Note: This project is working in progress.* zdict is a CLI dictionary framework mainly focus on any kind of online dictionary. From 5155f864f97582d4746d837905590972544ca135 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 2 Jul 2018 21:48:57 +0800 Subject: [PATCH 107/508] [README] Move table of content under NOTE --- README.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 7efc6ed7..cc451ee1 100644 --- a/README.rst +++ b/README.rst @@ -8,14 +8,8 @@ zdict |gitter| - ---- -.. contents:: Table of Contents - ----- - - *Note: This project is working in progress.* zdict is a CLI dictionary framework mainly focus on any kind of online dictionary. @@ -29,6 +23,13 @@ After heavily refactoring the original project including: So, we decided to create a new project. +---- + +.. contents:: Table of Contents + +---- + + Installation ------------------------------ From c4fdbe75c96538b459bb62806f175888e3455ced Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 2 Jul 2018 21:53:56 +0800 Subject: [PATCH 108/508] [README] Update image url of Travis CI badge --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index cc451ee1..a2cc0cfc 100644 --- a/README.rst +++ b/README.rst @@ -269,7 +269,7 @@ Related Projects .. |issues| image:: https://img.shields.io/github/issues/zdict/zdict.svg :target: https://github.com/zdict/zdict/issues -.. |travis| image:: https://img.shields.io/travis/zdict/zdict.svg +.. |travis| image:: https://api.travis-ci.org/zdict/zdict.svg?branch=master :target: https://travis-ci.org/zdict/zdict .. |license| image:: https://img.shields.io/github/license/zdict/zdict.svg From d40a8d527cf00744874e3a85c734079a04125711 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 3 Jul 2018 16:05:09 +0800 Subject: [PATCH 109/508] [README] Add Stargazers over time chart --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index a2cc0cfc..de4882de 100644 --- a/README.rst +++ b/README.rst @@ -266,6 +266,12 @@ Related Projects * A collection of shell completion scripts for zdict. +Stargazers over time +--------------------- + +|stargazers| + + .. |issues| image:: https://img.shields.io/github/issues/zdict/zdict.svg :target: https://github.com/zdict/zdict/issues @@ -281,3 +287,6 @@ Related Projects .. |coveralls| image:: https://coveralls.io/repos/zdict/zdict/badge.svg :target: https://coveralls.io/github/zdict/zdict + +.. |stargazers| image:: https://starcharts.herokuapp.com/zdict/zdict.svg + :target: https://starcharts.herokuapp.com/zdict/zdict From 495adf375472e6859681c44b46127c7b1ca784b3 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 4 Jul 2018 04:33:00 +0800 Subject: [PATCH 110/508] Update peewee from 3.5.1 to 3.5.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8a1280c4..122d9197 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.5.1 +peewee==3.5.2 requests==2.19.1 \ No newline at end of file From 230343a539cb9a65548a1ff91d649f89bb0e131e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 4 Jul 2018 04:33:02 +0800 Subject: [PATCH 111/508] Update peewee from 3.5.1 to 3.5.2 --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index c87d6771..96d9cf99 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.5.1" +peewee = "==3.5.2" requests = "==2.19.1" From f2317261c5d2321b036ff557cf534aa3b584ac55 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 4 Jul 2018 04:33:04 +0800 Subject: [PATCH 112/508] Update peewee from 3.5.1 to 3.5.2 --- Pipfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 1ffaacca..234e8c79 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:70bd475e8d45d73ff27d26f21c7833d901311bb64b29ccc70474c5843bab5227" + "sha256:202dc27fcf520364ad5407a3b62ba81630f70e5d734ed827e356c40165bc165b" ], - "version": "==3.5.1" + "version": "==3.5.2" }, "requests": { "hashes": [ From 6e725686bea51c5a1f5e699a2aeb63617770736a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 5 Jul 2018 23:20:38 +0200 Subject: [PATCH 113/508] Update pytest to 3.6.3 (#239) This PR updates [pytest](https://pypi.org/project/pytest) from **3.6.2** to **3.6.3**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 96d9cf99..7ced7668 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.6.2" +pytest = "==3.6.3" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.1" diff --git a/Pipfile.lock b/Pipfile.lock index 234e8c79..749868f3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -176,10 +176,10 @@ }, "pytest": { "hashes": [ - "sha256:90898786b3d0b880b47645bae7b51aa9bbf1e9d1e4510c2cfd15dd65c70ea0cd", - "sha256:8ea01fc4fcc8e1b1e305252b4bc80a1528019ab99fd3b88666c9dc38d754406c" + "sha256:4b208614ae6d98195430ad6bde03641c78553acee7c83cec2e85d613c0cd383d", + "sha256:0453c8676c2bee6feb0434748b068d5510273a916295fd61d306c4f22fbfd752" ], - "version": "==3.6.2" + "version": "==3.6.3" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 0b0617ae..ed7c6c24 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.6.2 +pytest==3.6.3 pytest-cov==2.5.1 pytest-flake8==1.0.1 From 97afd924c86f550fe9dec6b86c0f28808a27255a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 22 Jul 2018 09:16:24 +0200 Subject: [PATCH 114/508] Update peewee to 3.6.4 (#242) This PR updates [peewee](https://pypi.org/project/peewee) from **3.5.2** to **3.6.4**.
Changelog ### 3.6.4 ``` Take a whole new approach, following what `simplejson` does. Allow the `build_ext` command class to fail, and retry without extensions in the event we run into issues building extensions. References 1676. [View commits](https://github.com/coleifer/peewee/compare/3.6.3...3.6.4) ``` ### 3.6.3 ``` Add check in `setup.py` to determine if a C compiler is available before building C extensions. References 1676. [View commits](https://github.com/coleifer/peewee/compare/3.6.2...3.6.3) ``` ### 3.6.2 ``` Use `ctypes.util.find_library` to determine if `libsqlite3` is installed. Should fix problems people are encountering installing when SQLite3 is not available. [View commits](https://github.com/coleifer/peewee/compare/3.6.1...3.6.2) ``` ### 3.6.1 ``` Fixed issue with setup script. [View commits](https://github.com/coleifer/peewee/compare/3.6.0...3.6.1) ``` ### 3.6.0 ``` * Support for Python 3.7, including bugfixes related to new StopIteration handling inside of generators. * Support for specifying `ROWS` or `RANGE` window frame types. For more information, see the new [frame type documentation](http://docs.peewee-orm.com/en/latest/peewee/querying.htmlframe-types-range-vs-rows). * Add APIs for user-defined window functions if using [pysqlite3](https://github.com/coleifer/pysqlite3) and sqlite 3.25.0 or newer. * `TimestampField` now uses 64-bit integer data-type for storage. * Added support to `pwiz` and `playhouse.reflection` to enable generating models from VIEWs. * Added lower-level database API for introspecting VIEWs. * Revamped continuous integration setup for better coverage, including 3.7 and 3.8-dev. * Allow building C extensions even if Cython is not installed, by distributing pre-generated C source files. * Switch to using `setuptools` for packaging. [View commits](https://github.com/coleifer/peewee/compare/3.5.2...3.6.0) ```
Links - PyPI: https://pypi.org/project/peewee - Changelog: https://pyup.io/changelogs/peewee/ - Repo: http://github.com/coleifer/peewee/
--- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 7ced7668..6a18c1d7 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.0" -peewee = "==3.5.2" +peewee = "==3.6.4" requests = "==2.19.1" diff --git a/Pipfile.lock b/Pipfile.lock index 749868f3..55237970 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,9 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:202dc27fcf520364ad5407a3b62ba81630f70e5d734ed827e356c40165bc165b" + "sha256:538d7b7f892e59ecbef6eeefb867fd37f20ac77e602b4ee94b2766836cfa24ba" ], - "version": "==3.5.2" + "version": "==3.6.4" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 122d9197..29c8eff5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.0 -peewee==3.5.2 +peewee==3.6.4 requests==2.19.1 \ No newline at end of file From 6d3b5d4f9b1945d27a318107eb68e2ff73e9678e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 26 Jul 2018 22:06:35 +0200 Subject: [PATCH 115/508] Update pytest-flake8 to 1.0.2 (#243) This PR updates [pytest-flake8](https://pypi.org/project/pytest-flake8) from **1.0.1** to **1.0.2**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 6a18c1d7..f089e890 100644 --- a/Pipfile +++ b/Pipfile @@ -19,4 +19,4 @@ flake8 = "==3.5.0" pyjokes = "==0.5.0" pytest = "==3.6.3" pytest-cov = "==2.5.1" -pytest-flake8 = "==1.0.1" +pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 55237970..4328518c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -191,10 +191,10 @@ }, "pytest-flake8": { "hashes": [ - "sha256:ec248d4a215d6c7cd9d3ca48f365ece0e3892b46d626c22a95ccc80188ff35ed", - "sha256:e5cdc4f459c9436ac6c649e428a014bb5988605858549397374ec29a776cae68" + "sha256:4f30f5be3efb89755f38f11bdb2a5e22d19a6f5faa73428f703a3292a9572cd3", + "sha256:c740ad6aa19e3958947d2118f70bed218caf1d2097039fb7318573a2a72f89a1" ], - "version": "==1.0.1" + "version": "==1.0.2" }, "six": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index ed7c6c24..7cafebd2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,4 +3,4 @@ flake8==3.5.0 pyjokes==0.5.0 pytest==3.6.3 pytest-cov==2.5.1 -pytest-flake8==1.0.1 +pytest-flake8==1.0.2 From 5933dbcdb6bf41880f9731f44fb018859942a7dd Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 29 Jul 2018 13:42:13 +0200 Subject: [PATCH 116/508] Update pytest to 3.6.4 (#245) * Update pytest from 3.6.3 to 3.6.4 * Update pytest from 3.6.3 to 3.6.4 * Update pytest from 3.6.3 to 3.6.4 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index f089e890..9abe0d1c 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.6.3" +pytest = "==3.6.4" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 4328518c..1271a1c2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -176,10 +176,10 @@ }, "pytest": { "hashes": [ - "sha256:4b208614ae6d98195430ad6bde03641c78553acee7c83cec2e85d613c0cd383d", - "sha256:0453c8676c2bee6feb0434748b068d5510273a916295fd61d306c4f22fbfd752" + "sha256:952c0389db115437f966c4c2079ae9d54714b9455190e56acebe14e8c38a7efa", + "sha256:341ec10361b64a24accaec3c7ba5f7d5ee1ca4cebea30f76fad3dd12db9f0541" ], - "version": "==3.6.3" + "version": "==3.6.4" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 7cafebd2..a2205d8f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.6.3 +pytest==3.6.4 pytest-cov==2.5.1 pytest-flake8==1.0.2 From 2735f6ad9595720c85cffde301dbc752fa6757a9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 29 Jul 2018 15:12:03 +0200 Subject: [PATCH 117/508] Update pluggy from 0.6.0 to 0.7.1 (#246) --- Pipfile.lock | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 1271a1c2..137c1bbf 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -140,9 +140,10 @@ }, "pluggy": { "hashes": [ - "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" + "sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1", + "sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1" ], - "version": "==0.6.0" + "version": "==0.7.1" }, "py": { "hashes": [ From 1c65cb5a0322a4b43497d691411e8abf9c9abfc3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 29 Jul 2018 15:13:00 +0200 Subject: [PATCH 118/508] Update beautifulsoup4 to 4.6.1 (#244) * Update beautifulsoup4 from 4.6.0 to 4.6.1 * Update beautifulsoup4 from 4.6.0 to 4.6.1 * Update beautifulsoup4 from 4.6.0 to 4.6.1 --- Pipfile | 2 +- Pipfile.lock | 11 ++++++----- requirements.txt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index 9abe0d1c..baf71bd6 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.6.0" +beautifulsoup4 = "==4.6.1" peewee = "==3.6.4" requests = "==2.19.1" diff --git a/Pipfile.lock b/Pipfile.lock index 137c1bbf..7ac28816 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,12 +16,13 @@ "default": { "beautifulsoup4": { "hashes": [ - "sha256:11a9a27b7d3bddc6d86f59fb76afb70e921a25ac2d6cc55b40d072bd68435a76", - "sha256:7015e76bf32f1f574636c4288399a6de66ce08fb7b2457f628a8d70c0fbabb11", - "sha256:808b6ac932dccb0a4126558f7dfdcf41710dd44a4ef497a0bb59a77f9f078e89" + "sha256:2545357585a6cc7d050d3c43a86eba2c0b91b9e7ac8a3965e64a6ead6a1a9a3d", + "sha256:5a3d659840960a4107047b6328d6d4cdaaee69939bf11adc07466a1856c99a80", + "sha256:4ddc90ad88bccc005a71d8ef32f7b1cd8f935475cd561c4122b2f87de45d28ab", + "sha256:272081ad78c5495ba67083a0e50920163701fa6fe67fbb5eefeb21b5dd88c40b", + "sha256:bd43a3b26d2886acd63070c43da821b60dea603eb6d45bab0294aac6129adbfa" ], - "index": "pypi", - "version": "==4.6.0" + "version": "==4.6.1" }, "certifi": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 29c8eff5..c5eb2ac8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.6.0 +beautifulsoup4==4.6.1 peewee==3.6.4 requests==2.19.1 \ No newline at end of file From c237a7b09c9ea6e0edc6baa3966b0154f8e17e67 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 1 Aug 2018 15:22:35 +0200 Subject: [PATCH 119/508] Update more-itertools from 4.2.0 to 4.3.0 (#248) --- Pipfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 7ac28816..556e4eb5 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -133,11 +133,11 @@ }, "more-itertools": { "hashes": [ - "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0", - "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", - "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8" + "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d", + "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", + "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e" ], - "version": "==4.2.0" + "version": "==4.3.0" }, "pluggy": { "hashes": [ From ba59b31aea4e654bdde6f9f0e3c8802d7c3d5059 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 2 Aug 2018 13:58:56 +0200 Subject: [PATCH 120/508] Update pytest to 3.7.0 (#247) This PR updates [pytest](https://pypi.org/project/pytest) from **3.6.4** to **3.7.0**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index baf71bd6..d84a018c 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.6.4" +pytest = "==3.7.0" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 556e4eb5..4b4eea77 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -178,10 +178,10 @@ }, "pytest": { "hashes": [ - "sha256:952c0389db115437f966c4c2079ae9d54714b9455190e56acebe14e8c38a7efa", - "sha256:341ec10361b64a24accaec3c7ba5f7d5ee1ca4cebea30f76fad3dd12db9f0541" + "sha256:e2b2c6e1560b8f9dc8dd600b0923183fbd68ba3d9bdecde04467be6dd296a384", + "sha256:8214ab8446104a1d0c17fbd218ec6aac743236c6ffbe23abc038e40213c60b88" ], - "version": "==3.6.4" + "version": "==3.7.0" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index a2205d8f..be7de342 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.6.4 +pytest==3.7.0 pytest-cov==2.5.1 pytest-flake8==1.0.2 From 8409d93b11d53528dd4ab26a19f3ee35f1039759 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 3 Aug 2018 17:48:26 +0200 Subject: [PATCH 121/508] Update pytest to 3.7.1 (#249) This PR updates [pytest](https://pypi.org/project/pytest) from **3.7.0** to **3.7.1**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index d84a018c..001f1876 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.7.0" +pytest = "==3.7.1" pytest-cov = "==2.5.1" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 4b4eea77..eb9a6d80 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -178,10 +178,10 @@ }, "pytest": { "hashes": [ - "sha256:e2b2c6e1560b8f9dc8dd600b0923183fbd68ba3d9bdecde04467be6dd296a384", - "sha256:8214ab8446104a1d0c17fbd218ec6aac743236c6ffbe23abc038e40213c60b88" + "sha256:e74466e97ac14582a8188ff4c53e6cc3810315f342f6096899332ae864c1d432", + "sha256:86a8dbf407e437351cef4dba46736e9c5a6e3c3ac71b2e942209748e76ff2086" ], - "version": "==3.7.0" + "version": "==3.7.1" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index be7de342..42bb6796 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.7.0 +pytest==3.7.1 pytest-cov==2.5.1 pytest-flake8==1.0.2 From 5005c7fce752aa241e22ca7b1ceca09bd4b6c8a7 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 13 Aug 2018 20:08:04 +0200 Subject: [PATCH 122/508] Update certifi to 2018.8.13 (#250) This PR updates [certifi](https://pypi.org/project/certifi) from **2018.4.16** to **2018.8.13**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index eb9a6d80..c17db939 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -26,10 +26,10 @@ }, "certifi": { "hashes": [ - "sha256:9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0", - "sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7" + "sha256:b6e8b28b2b7e771a41ecdd12d4d43262ecab52adebbafa42c77d6b57fb6ad3a4", + "sha256:4c1d68a1408dd090d2f3a869aa94c3947cc1d967821d1ed303208c9f41f0f2f4" ], - "version": "==2018.4.16" + "version": "==2018.8.13" }, "chardet": { "hashes": [ From 6f894993d04163c1cf1c8a439bdfce9b3a2ca079 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 24 Aug 2018 18:12:33 -0700 Subject: [PATCH 123/508] Update certifi to 2018.8.24 (#251) This PR updates [certifi](https://pypi.org/project/certifi) from **2018.8.13** to **2018.8.24**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index c17db939..779f7b42 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -26,10 +26,10 @@ }, "certifi": { "hashes": [ - "sha256:b6e8b28b2b7e771a41ecdd12d4d43262ecab52adebbafa42c77d6b57fb6ad3a4", - "sha256:4c1d68a1408dd090d2f3a869aa94c3947cc1d967821d1ed303208c9f41f0f2f4" + "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a", + "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638" ], - "version": "==2018.8.13" + "version": "==2018.8.24" }, "chardet": { "hashes": [ From d152aa58b706437ae9db67f5cc3d72490c5522b6 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 27 Aug 2018 19:22:52 -0700 Subject: [PATCH 124/508] Update py to 1.6.0 (#252) This PR updates [py](https://pypi.org/project/py) from **1.5.4** to **1.6.0**. - add ``TerminalWriter.width_of_current_line`` (i18n version of ``TerminalWriter.chars_on_current_line``), a read-only property that tracks how wide the current line is, attempting to take into account international characters in the calculation. ``` --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 779f7b42..15958f24 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -148,10 +148,10 @@ }, "py": { "hashes": [ - "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e", - "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7" + "sha256:50402e9d1c9005d759426988a492e0edaadb7f4e68bcddfea586bc7432d009c6", + "sha256:06a30435d058473046be836d3fc4f27167fd84c45b99704f2fb5509ef61f9af1" ], - "version": "==1.5.4" + "version": "==1.6.0" }, "pycodestyle": { "hashes": [ From d6e084fc63acad7a5e5ab517a8a63c3448f68b94 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 28 Aug 2018 10:44:21 +0800 Subject: [PATCH 125/508] Update pytest from 3.7.1 to 3.7.3 (#253) --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 42bb6796..f2041c63 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.7.1 +pytest==3.7.3 pytest-cov==2.5.1 pytest-flake8==1.0.2 From 910bbf25e6810e121887527562c4c875f4e41fe6 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 28 Aug 2018 12:58:29 +0800 Subject: [PATCH 126/508] Update beautifulsoup4 from 4.6.1 to 4.6.3 (#254) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c5eb2ac8..f3792c10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.6.1 +beautifulsoup4==4.6.3 peewee==3.6.4 requests==2.19.1 \ No newline at end of file From 1cfa8d594bc756d1544b6900828977d6663bae12 Mon Sep 17 00:00:00 2001 From: shunyi Date: Thu, 30 Aug 2018 03:40:26 +0800 Subject: [PATCH 127/508] Bump version to 0.12.3 + Update README + Update dependencies --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index c94cf244..7ee276c0 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.12.2' +VERSION = '0.12.3' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 1b78b852fe399d9e073daa656e390d99d5ce14cf Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 2 Sep 2018 18:08:43 -0700 Subject: [PATCH 128/508] Update attrs from 18.1.0 to 18.2.0 (#255) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 15958f24..cffb4d59 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -69,10 +69,10 @@ "develop": { "attrs": { "hashes": [ - "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", - "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb", + "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69" ], - "version": "==18.1.0" + "version": "==18.2.0" }, "coverage": { "hashes": [ From 8d83e769deff8554193a6b633b3bc252f2812739 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 4 Sep 2018 06:38:22 -0700 Subject: [PATCH 129/508] Update pytest-cov to 2.6.0 (#256) * Update pytest-cov from 2.5.1 to 2.6.0 * Update pytest-cov from 2.5.1 to 2.6.0 * Update pytest-cov from 2.5.1 to 2.6.0 --- Pipfile | 2 +- Pipfile.lock | 7 +++---- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 001f1876..1da9d50e 100644 --- a/Pipfile +++ b/Pipfile @@ -18,5 +18,5 @@ coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" pytest = "==3.7.1" -pytest-cov = "==2.5.1" +pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index cffb4d59..ed56532b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -185,11 +185,10 @@ }, "pytest-cov": { "hashes": [ - "sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d", - "sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec" + "sha256:513c425e931a0344944f84ea47f3956be0e416d95acbd897a44970c8d926d5d7", + "sha256:e360f048b7dae3f2f2a9a4d067b2dd6b6a015d384d1577c994a43f3f7cbad762" ], - "index": "pypi", - "version": "==2.5.1" + "version": "==2.6.0" }, "pytest-flake8": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index f2041c63..9f8961e2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,5 +2,5 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 pytest==3.7.3 -pytest-cov==2.5.1 +pytest-cov==2.6.0 pytest-flake8==1.0.2 From a41d9227d96cda2478ac79567fc4708aa9d97919 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 6 Sep 2018 18:18:52 -0700 Subject: [PATCH 130/508] Update pytest to 3.8.0 (#258) This PR updates [pytest](https://pypi.org/project/pytest) from **3.7.3** to **3.8.0**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 1da9d50e..f74ae929 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.7.1" +pytest = "==3.8.0" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index ed56532b..90394005 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -178,10 +178,10 @@ }, "pytest": { "hashes": [ - "sha256:e74466e97ac14582a8188ff4c53e6cc3810315f342f6096899332ae864c1d432", - "sha256:86a8dbf407e437351cef4dba46736e9c5a6e3c3ac71b2e942209748e76ff2086" + "sha256:453cbbbe5ce6db38717d282b758b917de84802af4288910c12442984bde7b823", + "sha256:a8a07f84e680482eb51e244370aaf2caa6301ef265f37c2bdefb3dd3b663f99d" ], - "version": "==3.7.1" + "version": "==3.8.0" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 9f8961e2..12cb3388 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.7.3 +pytest==3.8.0 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 4506e328310212655cef4a4c3be96fa8b1981f7c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 6 Sep 2018 18:19:31 -0700 Subject: [PATCH 131/508] Update peewee to 3.7.0 (#257) This PR updates [peewee](https://pypi.org/project/peewee) from **3.6.4** to **3.7.0**. --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index f74ae929..0fa8c785 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.1" -peewee = "==3.6.4" +peewee = "==3.7.0" requests = "==2.19.1" diff --git a/Pipfile.lock b/Pipfile.lock index 90394005..310c22c3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -47,9 +47,9 @@ }, "peewee": { "hashes": [ - "sha256:538d7b7f892e59ecbef6eeefb867fd37f20ac77e602b4ee94b2766836cfa24ba" + "sha256:bb9ee5e2ca601c82f5e3c8327f19af4b5f9941ae74ec520674165692d3d6ae7a" ], - "version": "==3.6.4" + "version": "==3.7.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index f3792c10..17784a84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 -peewee==3.6.4 +peewee==3.7.0 requests==2.19.1 \ No newline at end of file From c7fe9afd80bc57470ccac8844025e5e9a9c5f4d3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 24 Sep 2018 00:28:16 -0700 Subject: [PATCH 132/508] Update pytest to 3.8.1 (#259) This PR updates [pytest](https://pypi.org/project/pytest) from **3.8.0** to **3.8.1**.
Changelog ### 3.8.1 ``` ========================= Bug Fixes --------- - `3286 <https://github.com/pytest-dev/pytest/issues/3286>`_: ``.pytest_cache`` directory is now automatically ignored by Git. Users who would like to contribute a solution for other SCMs please consult/comment on this issue. - `3749 <https://github.com/pytest-dev/pytest/issues/3749>`_: Fix the following error during collection of tests inside packages:: TypeError: object of type 'Package' has no len() - `3941 <https://github.com/pytest-dev/pytest/issues/3941>`_: Fix bug where indirect parametrization would consider the scope of all fixtures used by the test function to determine the parametrization scope, and not only the scope of the fixtures being parametrized. - `3973 <https://github.com/pytest-dev/pytest/issues/3973>`_: Fix crash of the assertion rewriter if a test changed the current working directory without restoring it afterwards. - `3998 <https://github.com/pytest-dev/pytest/issues/3998>`_: Fix issue that prevented some caplog properties (for example ``record_tuples``) from being available when entering the debugger with ``--pdb``. - `3999 <https://github.com/pytest-dev/pytest/issues/3999>`_: Fix ``UnicodeDecodeError`` in python2.x when a class returns a non-ascii binary ``__repr__`` in an assertion which also contains non-ascii text. Improved Documentation ---------------------- - `3996 <https://github.com/pytest-dev/pytest/issues/3996>`_: New `Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`_ page shows all currently deprecated features, the rationale to do so, and alternatives to update your code. It also list features removed from pytest in past major releases to help those with ancient pytest versions to upgrade. Trivial/Internal Changes ------------------------ - `3955 <https://github.com/pytest-dev/pytest/issues/3955>`_: Improve pre-commit detection for changelog filenames - `3975 <https://github.com/pytest-dev/pytest/issues/3975>`_: Remove legacy code around im_func as that was python2 only ```
Links - PyPI: https://pypi.org/project/pytest - Changelog: https://pyup.io/changelogs/pytest/ - Homepage: https://docs.pytest.org/en/latest/
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 0fa8c785..c9b1c40a 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.8.0" +pytest = "==3.8.1" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 310c22c3..ff4954c5 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -178,10 +178,10 @@ }, "pytest": { "hashes": [ - "sha256:453cbbbe5ce6db38717d282b758b917de84802af4288910c12442984bde7b823", - "sha256:a8a07f84e680482eb51e244370aaf2caa6301ef265f37c2bdefb3dd3b663f99d" + "sha256:0a72d8a9f559c006ba153e0c9b4838efd7b656cf1f993747ba7128770d6eb12c", + "sha256:95529588ff4e85114a0b0ad8e9cf0131ca47d46b28230e25366c5aba66b1d854" ], - "version": "==3.8.0" + "version": "==3.8.1" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 12cb3388..572723b6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.8.0 +pytest==3.8.1 pytest-cov==2.6.0 pytest-flake8==1.0.2 From b4d26ba78de1d24b33d16c0336ccdd51ce85021f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 3 Oct 2018 19:35:17 -0700 Subject: [PATCH 133/508] Update pytest to 3.8.2 (#260) * Update pytest from 3.8.1 to 3.8.2 * Update pytest from 3.8.1 to 3.8.2 * Update pytest from 3.8.1 to 3.8.2 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index c9b1c40a..4da0a56e 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.8.1" +pytest = "==3.8.2" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index ff4954c5..90a18134 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -178,10 +178,10 @@ }, "pytest": { "hashes": [ - "sha256:0a72d8a9f559c006ba153e0c9b4838efd7b656cf1f993747ba7128770d6eb12c", - "sha256:95529588ff4e85114a0b0ad8e9cf0131ca47d46b28230e25366c5aba66b1d854" + "sha256:7e258ee50338f4e46957f9e09a0f10fb1c2d05493fa901d113a8dafd0790de4e", + "sha256:9332147e9af2dcf46cd7ceb14d5acadb6564744ddff1fe8c17f0ce60ece7d9a2" ], - "version": "==3.8.1" + "version": "==3.8.2" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 572723b6..929455bb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.8.1 +pytest==3.8.2 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 9c21c300276ae81d6d544b1e9542d9609744cdb4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 6 Oct 2018 00:28:03 -0700 Subject: [PATCH 134/508] Update peewee to 3.7.1 (#261) This PR updates [peewee](https://pypi.org/project/peewee) from **3.7.0** to **3.7.1**. --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 4da0a56e..ad74ecfb 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.1" -peewee = "==3.7.0" +peewee = "==3.7.1" requests = "==2.19.1" diff --git a/Pipfile.lock b/Pipfile.lock index 90a18134..985ee8e3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -47,9 +47,9 @@ }, "peewee": { "hashes": [ - "sha256:bb9ee5e2ca601c82f5e3c8327f19af4b5f9941ae74ec520674165692d3d6ae7a" + "sha256:a91c3ccff43ab71f08196aba1d17dd2548079744d54adc33d511db1c30b446ba" ], - "version": "==3.7.0" + "version": "==3.7.1" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 17784a84..cb5ac0a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 -peewee==3.7.0 +peewee==3.7.1 requests==2.19.1 \ No newline at end of file From 698a7b2e2c6c3e614f2f34031a0ba2011b04dfcb Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 11 Oct 2018 20:36:12 -0700 Subject: [PATCH 135/508] Update urllib3 to 1.23 (#263) This PR updates [urllib3](https://pypi.org/project/urllib3) from **1.22** to **1.23**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 985ee8e3..445b91ad 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -60,10 +60,10 @@ }, "urllib3": { "hashes": [ - "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b", - "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" + "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5", + "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf" ], - "version": "==1.22" + "version": "==1.23" } }, "develop": { From c4b3d79317d7f30173e597dd6a5ef3c3162726f5 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 13 Oct 2018 09:25:12 +0800 Subject: [PATCH 136/508] [pyup.yml] Remove Pipfile.lock No need to update individual package in Pipfile.lock. --- .pyup.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pyup.yml b/.pyup.yml index f14526b0..d1ccac56 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -4,4 +4,3 @@ requirements: - requirements.txt - test-requirements.txt - Pipfile - - Pipfile.lock From a730e98195bb4725b428f6cdb484e3af4e02442d Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 13 Oct 2018 12:58:36 +0800 Subject: [PATCH 137/508] Issue 265: Fix test of Jisho (#266) --- zdict/tests/dictionaries/test_jisho.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zdict/tests/dictionaries/test_jisho.py b/zdict/tests/dictionaries/test_jisho.py index 84029103..b5997a49 100644 --- a/zdict/tests/dictionaries/test_jisho.py +++ b/zdict/tests/dictionaries/test_jisho.py @@ -10,12 +10,14 @@ class TestJishoDict: @classmethod def setup_class(cls): cls.dict = JishoDict(get_args()) - cls.word = 'apple' + cls.word = 'bird' + cls.source = 'jisho' cls.record = cls.dict.query(cls.word) @classmethod def teardown_class(cls): del cls.dict + del cls.source del cls.word del cls.record @@ -48,7 +50,7 @@ def test_query_normal(self, Record): Record.assert_called_with( word=self.word, content=self.record.content, - source='jisho', + source=self.source, ) @patch('zdict.dictionaries.jisho.Record') @@ -58,7 +60,7 @@ def test_query_verbose(self, Record): Record.assert_called_with( word=self.word, content=self.record.content, - source='jisho', + source=self.source, ) def test_query_not_found(self): From 020885ee0cd590e12fd6f83a876e02e7bf74c00c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 12 Oct 2018 22:37:04 -0700 Subject: [PATCH 138/508] Update py to 1.7.0 (#264) This PR updates [py](https://pypi.org/project/py) from **1.6.0** to **1.7.0**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 445b91ad..39c3a937 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -148,10 +148,10 @@ }, "py": { "hashes": [ - "sha256:50402e9d1c9005d759426988a492e0edaadb7f4e68bcddfea586bc7432d009c6", - "sha256:06a30435d058473046be836d3fc4f27167fd84c45b99704f2fb5509ef61f9af1" + "sha256:e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6", + "sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694" ], - "version": "==1.6.0" + "version": "==1.7.0" }, "pycodestyle": { "hashes": [ From e46f24e06746953546ad5c420a04fef26b02a3d6 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sun, 14 Oct 2018 14:57:32 +0800 Subject: [PATCH 139/508] Revert "[pyup.yml] Remove Pipfile.lock" This reverts commit c4b3d79317d7f30173e597dd6a5ef3c3162726f5. pyup won't update Pipfile.lock for you when changed Pipfile. So, add back Pipfile.lock into .pyup.yml --- .pyup.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pyup.yml b/.pyup.yml index d1ccac56..f14526b0 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -4,3 +4,4 @@ requirements: - requirements.txt - test-requirements.txt - Pipfile + - Pipfile.lock From 19da8685d4fc4a4e80c51166dd4a7612c0a8d719 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 14 Oct 2018 06:14:54 -0700 Subject: [PATCH 140/508] Update beautifulsoup4 to 4.6.3 (#267) This PR updates [beautifulsoup4](https://pypi.org/project/beautifulsoup4) from **4.6.1** to **4.6.3**. --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index ad74ecfb..02199886 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.6.1" +beautifulsoup4 = "==4.6.3" peewee = "==3.7.1" requests = "==2.19.1" From 3478ba57620361eaa7b137bdd66af9fa7e1844b0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 14 Oct 2018 20:00:46 -0700 Subject: [PATCH 141/508] Update beautifulsoup4 to 4.6.3 (#268) This PR updates [beautifulsoup4](https://pypi.org/project/beautifulsoup4) from **4.6.1** to **4.6.3**. --- Pipfile.lock | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 39c3a937..193e43f7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,13 +16,11 @@ "default": { "beautifulsoup4": { "hashes": [ - "sha256:2545357585a6cc7d050d3c43a86eba2c0b91b9e7ac8a3965e64a6ead6a1a9a3d", - "sha256:5a3d659840960a4107047b6328d6d4cdaaee69939bf11adc07466a1856c99a80", - "sha256:4ddc90ad88bccc005a71d8ef32f7b1cd8f935475cd561c4122b2f87de45d28ab", - "sha256:272081ad78c5495ba67083a0e50920163701fa6fe67fbb5eefeb21b5dd88c40b", - "sha256:bd43a3b26d2886acd63070c43da821b60dea603eb6d45bab0294aac6129adbfa" + "sha256:f0abd31228055d698bb392a826528ea08ebb9959e6bea17c606fd9c9009db938", + "sha256:194ec62a25438adcb3fdb06378b26559eda1ea8a747367d34c33cef9c7f48d57", + "sha256:90f8e61121d6ae58362ce3bed8cd997efb00c914eae0ff3d363c32f9a9822d10" ], - "version": "==4.6.1" + "version": "==4.6.3" }, "certifi": { "hashes": [ From 08b4e08e2f96e3a584241dbd0b83cf32dc135dd0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Oct 2018 06:42:29 -0700 Subject: [PATCH 142/508] Update certifi to 2018.10.15 (#270) This PR updates [certifi](https://pypi.org/project/certifi) from **2018.8.24** to **2018.10.15**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 193e43f7..15184aab 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -24,10 +24,10 @@ }, "certifi": { "hashes": [ - "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a", - "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638" + "sha256:339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c", + "sha256:6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a" ], - "version": "==2018.8.24" + "version": "==2018.10.15" }, "chardet": { "hashes": [ From bbc27086a45123a643ca2e53868987cc211d2c05 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Oct 2018 07:29:33 -0700 Subject: [PATCH 143/508] Update pluggy to 0.8.0 (#271) This PR updates [pluggy](https://pypi.org/project/pluggy) from **0.7.1** to **0.8.0**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 15184aab..f199445f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -139,10 +139,10 @@ }, "pluggy": { "hashes": [ - "sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1", - "sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1" + "sha256:bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f", + "sha256:447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095" ], - "version": "==0.7.1" + "version": "==0.8.0" }, "py": { "hashes": [ From 6019a34b1305386dc4e1d69bd734a671a0844219 Mon Sep 17 00:00:00 2001 From: Aquakor Date: Tue, 16 Oct 2018 16:44:05 +0200 Subject: [PATCH 144/508] Add wiktionary (#269) **_This Pull Request refers to #196 issue._** ### Description: **The API problem.** We can access wiktionary content through [WIKIMEDIA REST API](https://en.wiktionary.org/api/rest_v1/). Unfortunately this does not support ZH language (at least I think so). The [main API](https://en.wiktionary.org/w/api.php) supports it but it requires a ton of work to extract anything from it (Reason: The wiktionary is designed to be human readable). There are APIs that intend to provide wiktionary data but could not find anything that would not require to implement an API key. **Support for more languages** The WIKIMEDIA REST API does provide definitions in other languages, so it is probably a good idea to implement a way to support them using CLI arguments in the future. --- zdict/dictionaries/wiktionary.py | 62 +++++++++++++++++++++ zdict/tests/dictionaries/test_wiktionary.py | 49 ++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 zdict/dictionaries/wiktionary.py create mode 100644 zdict/tests/dictionaries/test_wiktionary.py diff --git a/zdict/dictionaries/wiktionary.py b/zdict/dictionaries/wiktionary.py new file mode 100644 index 00000000..53e06e59 --- /dev/null +++ b/zdict/dictionaries/wiktionary.py @@ -0,0 +1,62 @@ +import json + +from bs4 import BeautifulSoup + +from zdict.dictionary import DictBase +from zdict.exceptions import NotFoundError, QueryError +from zdict.models import Record + + +class WiktionaryDict(DictBase): + + API = 'https://en.wiktionary.org/api/rest_v1/page/definition/{word}' + + @property + def provider(self): + return 'wiktionary' + + @property + def title(self): + return 'Wiktionary' + + def _get_url(self, word) -> str: + return self.API.format(word=word) + + def show(self, record: Record): + content = json.loads(record.content) + + # Render the output. + self.color.print(record.word, 'yellow') + self.color.print( + content['definition'], + 'org', + indent=2, + ) + + def query(self, word: str): + try: + content = self._get_raw(word) + except QueryError as exception: + raise NotFoundError(exception.word) + + content = json.loads(content) + + try: + # Get the first definition string from JSON. + definition = content['en'][0]['definitions'][0]['definition'] + except KeyError as exception: + # API can return JSON that does not contain 'en' language. + raise NotFoundError(word) + else: + # Clean the definition string from HTML tags. + definition = BeautifulSoup(definition, "html.parser").text + content = {} + content['definition'] = definition + + record = Record( + word=word, + content=json.dumps(content), + source=self.provider, + ) + + return record diff --git a/zdict/tests/dictionaries/test_wiktionary.py b/zdict/tests/dictionaries/test_wiktionary.py new file mode 100644 index 00000000..f9726524 --- /dev/null +++ b/zdict/tests/dictionaries/test_wiktionary.py @@ -0,0 +1,49 @@ +from pytest import raises +from unittest.mock import Mock, patch + +from zdict.dictionaries.wiktionary import WiktionaryDict +from zdict.exceptions import NotFoundError, QueryError +from zdict.models import Record +from zdict.zdict import get_args + + +class TestWiktionaryDict: + def setup_method(self, method): + self.dict = WiktionaryDict(get_args()) + + def teardown_method(self, method): + del self.dict + + def test_provider(self): + assert self.dict.provider == 'wiktionary' + + def test__get_url(self): + uri = 'https://en.wiktionary.org/api/rest_v1/page/definition/mock' + assert self.dict._get_url('mock') == uri + + def test_query_notfound(self): + self.dict._get_raw = Mock(side_effect=QueryError('mock', 404)) + + with raises(NotFoundError): + self.dict.query('mock') + + self.dict._get_raw.assert_called_with('mock') + + @patch('zdict.dictionaries.wiktionary.Record') + def test_query_normal(self, Record): + content = '{"en":[{"definitions":[{"definition":"string"}]}]}' + self.dict._get_raw = Mock(return_value=content) + self.dict.query('mock') + Record.assert_called_with( + word='mock', + content='{"definition": "string"}', + source='wiktionary' + ) + + def test_show(self): + content = '{"definition": "string"}' + + r = Record(word="string", + content=content, + source=self.dict.provider) + self.dict.show(r) From 1c6ebc959ca14ebcb0ed084a542b24b2a5a0c26d Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 16 Oct 2018 22:48:06 +0800 Subject: [PATCH 145/508] Version 1.0.0 - [#196] Add wikionary - Via PR #269. Thanks @Aquakor. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 7ee276c0..de6d70ec 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '0.12.3' +VERSION = '1.0.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 75174ff168f2f53d14a0513bb9a650d4a5cc3835 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 16 Oct 2018 23:34:36 +0800 Subject: [PATCH 146/508] Version 1.0.1 - Update README.rst for new dictionary. --- README.rst | 4 ++-- zdict/constants.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index de4882de..26f635a3 100644 --- a/README.rst +++ b/README.rst @@ -88,7 +88,7 @@ Usage :: usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt moe,moe-taiwanese,yahoo,jisho,spanish,yandex,urban,all] + [-dt spanish,yandex,moe,moe-taiwanese,yahoo,wiktionary,urban,jisho,oxford,all] [-ld] [-V] [-c] [--dump [PATTERN]] [-D] [word [word ...]] @@ -108,7 +108,7 @@ Usage the number of CPUs in the system. -sp, --show-provider Show the dictionary provider of the queried word -su, --show-url Show the url of the queried word - -dt moe,moe-taiwanese,yahoo,jisho,spanish,yandex,urban,all, --dict moe,moe-taiwanese,yahoo,jisho,spanish,yandex,urban,all + -dt spanish,yandex,moe,moe-taiwanese,yahoo,wiktionary,urban,jisho,oxford,all, --dict spanish,yandex,moe,moe-taiwanese,yahoo,wiktionary,urban,jisho,oxford,all Must be seperated by comma and no spaces after each comma. Choose the dictionary you want. (default: yahoo) Use 'all' for qureying all dictionaries. If diff --git a/zdict/constants.py b/zdict/constants.py index de6d70ec..bdb8521b 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '1.0.0' +VERSION = '1.0.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From c96ccc59789594a5033d21209ee2c464c54d726f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Oct 2018 22:14:31 -0700 Subject: [PATCH 147/508] Update pytest to 3.9.1 (#272) This PR updates [pytest](https://pypi.org/project/pytest) from **3.8.2** to **3.9.1**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 02199886..0249b57c 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.19.1" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.8.2" +pytest = "==3.9.1" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index f199445f..9ef3bb10 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -176,10 +176,10 @@ }, "pytest": { "hashes": [ - "sha256:7e258ee50338f4e46957f9e09a0f10fb1c2d05493fa901d113a8dafd0790de4e", - "sha256:9332147e9af2dcf46cd7ceb14d5acadb6564744ddff1fe8c17f0ce60ece7d9a2" + "sha256:10e59f84267370ab20cec9305bafe7505ba4d6b93ecbf66a1cce86193ed511d5", + "sha256:8c827e7d4816dfe13e9329c8226aef8e6e75d65b939bc74fda894143b6d1df59" ], - "version": "==3.8.2" + "version": "==3.9.1" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 929455bb..b853362d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.8.2 +pytest==3.9.1 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 0866dd9ab0e32ab4798146d1cc249ecd96d61ce0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Oct 2018 22:15:02 -0700 Subject: [PATCH 148/508] Update urllib3 to 1.24 (#273) This PR updates [urllib3](https://pypi.org/project/urllib3) from **1.23** to **1.24**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 9ef3bb10..cd344f55 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5", - "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf" + "sha256:8819bba37a02d143296a4d032373c4dd4aca11f6d4c9973335ca75f9c8475f59", + "sha256:41c3db2fc01e5b907288010dec72f9d0a74e37d6994e6eb56849f59fea2265ae" ], - "version": "==1.23" + "version": "==1.24" } }, "develop": { From c16ecec0c50fd6ad57762d353ddd8bfc18bce4c1 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 19 Oct 2018 07:17:47 -0700 Subject: [PATCH 149/508] Update requests to 2.20.0 (#275) * Update requests from 2.19.1 to 2.20.0 * Update requests from 2.19.1 to 2.20.0 * Update requests from 2.19.1 to 2.20.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 0249b57c..156cb273 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" beautifulsoup4 = "==4.6.3" peewee = "==3.7.1" -requests = "==2.19.1" +requests = "==2.20.0" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index cd344f55..520ecb10 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -51,10 +51,10 @@ }, "requests": { "hashes": [ - "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1", - "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a" + "sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279", + "sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c" ], - "version": "==2.19.1" + "version": "==2.20.0" }, "urllib3": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index cb5ac0a6..30cea417 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 peewee==3.7.1 -requests==2.19.1 \ No newline at end of file +requests==2.20.0 \ No newline at end of file From 03e0cee3bd54018164738b4a270a89f182a5847a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 23 Oct 2018 21:07:54 -0700 Subject: [PATCH 150/508] Update pytest to 3.9.2 (#276) * Update pytest from 3.9.1 to 3.9.2 * Update pytest from 3.9.1 to 3.9.2 * Update pytest from 3.9.1 to 3.9.2 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 156cb273..e2cb28be 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.20.0" coverage = "==4.5.1" flake8 = "==3.5.0" pyjokes = "==0.5.0" -pytest = "==3.9.1" +pytest = "==3.9.2" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 520ecb10..36130461 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -176,10 +176,10 @@ }, "pytest": { "hashes": [ - "sha256:10e59f84267370ab20cec9305bafe7505ba4d6b93ecbf66a1cce86193ed511d5", - "sha256:8c827e7d4816dfe13e9329c8226aef8e6e75d65b939bc74fda894143b6d1df59" + "sha256:6f6c1efc8d0ccc21f8f6c34d8330baca883cf109b66b3df954b0a117e5528fb4", + "sha256:212be78a6fa5352c392738a49b18f74ae9aeec1040f47c81cadbfd8d1233c310" ], - "version": "==3.9.1" + "version": "==3.9.2" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index b853362d..30978684 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.5.0 pyjokes==0.5.0 -pytest==3.9.1 +pytest==3.9.2 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 643afd1de6c74afd3e0b58b1ea3939e9b5d0c3a3 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 25 Oct 2018 10:07:07 +0800 Subject: [PATCH 151/508] Update flake8 from 3.5.0 to 3.6.0 --- Pipfile | 2 +- Pipfile.lock | 7 +++---- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index e2cb28be..2e658265 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ requests = "==2.20.0" [dev-packages] coverage = "==4.5.1" -flake8 = "==3.5.0" +flake8 = "==3.6.0" pyjokes = "==0.5.0" pytest = "==3.9.2" pytest-cov = "==2.6.0" diff --git a/Pipfile.lock b/Pipfile.lock index 36130461..6e86ac99 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -116,11 +116,10 @@ }, "flake8": { "hashes": [ - "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", - "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" + "sha256:c01f8a3963b3571a8e6bd7a4063359aff90749e160778e03817cd9b71c9e07d2", + "sha256:6a35f5b8761f45c5513e3405f110a86bea57982c3b75b766ce7b65217abe1670" ], - "index": "pypi", - "version": "==3.5.0" + "version": "==3.6.0" }, "mccabe": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index 30978684..c003fd97 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ coverage==4.5.1 -flake8==3.5.0 +flake8==3.6.0 pyjokes==0.5.0 pytest==3.9.2 pytest-cov==2.6.0 From 7f0ef85740c1458aabba69de62802cb3bcf2d00d Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 21:28:23 +0800 Subject: [PATCH 152/508] [#277] Fix syntax for flake8==3.6.0 --- zdict/dictionaries/oxford.py | 2 +- zdict/dictionaries/wiktionary.py | 2 +- zdict/dictionaries/yahoo.py | 49 ++++++++++++++++++-------------- zdict/dictionary.py | 4 +-- 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/zdict/dictionaries/oxford.py b/zdict/dictionaries/oxford.py index eb873248..40d3663d 100644 --- a/zdict/dictionaries/oxford.py +++ b/zdict/dictionaries/oxford.py @@ -158,7 +158,7 @@ def _get_app_key(self): with open(self.KEY_FILE) as fp: keys = fp.read() - keys = re.sub('\s', '', keys).split(',') + keys = re.sub(r'\s', '', keys).split(',') if len(keys) != 2: print('The API key should be placed in the format:') print(' app_id, app_key') diff --git a/zdict/dictionaries/wiktionary.py b/zdict/dictionaries/wiktionary.py index 53e06e59..ab4640b3 100644 --- a/zdict/dictionaries/wiktionary.py +++ b/zdict/dictionaries/wiktionary.py @@ -44,7 +44,7 @@ def query(self, word: str): try: # Get the first definition string from JSON. definition = content['en'][0]['definitions'][0]['definition'] - except KeyError as exception: + except KeyError: # API can return JSON that does not contain 'en' language. raise NotFoundError(word) else: diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index 7f52bcc9..c3893f75 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -1,9 +1,8 @@ import json import re - from collections import deque -from bs4 import BeautifulSoup +import bs4 from zdict.dictionary import DictBase from zdict.exceptions import NotFoundError @@ -14,7 +13,9 @@ def text(x): return x.text -def foreach(f: 'function', i: iter) -> None: +# typing.Callable is new in Python 3.5, +# use type(lambda: None) for function type hints +def foreach(f: type(lambda: None), i: iter) -> None: deque(map(f, i), 0) @@ -146,11 +147,12 @@ def show_v2_verbose(self, verbose): indent = {'title': 0, 'explain': 2, 'item': 4} foreach( lambda x: self.color.print(x[1], color[x[0]], indent[x[0]]), - verbose) + verbose, + ) def query(self, word: str): webpage = self._get_raw(word) - data = BeautifulSoup(webpage, "html.parser") + data = bs4.BeautifulSoup(webpage, "html.parser") content = {} # Please bump version if the format changes again. @@ -208,26 +210,28 @@ def query(self, word: str): return record def parse_summary(self, data, word): - def gete(x: 'bs4 node'): + def get_explain(e: bs4.element.Tag): def f(ks): return ( 'pos' if 'pos_button' in ks else 'explain' if 'dictionaryExplanation' in ks else '?') - return [ (f(m.attrs['class']), m.text) - for n in x.select('ul > li') for m in n.select('div')] + for n in e.select('ul > li') for m in n.select('div')] - def getp(p): - return list(map( - lambda x: re.match('(.*)(\[.*\])', x).groups(), - p.find('ul').text.strip().split())) + def get_pronounce(p: bs4.element.Tag): + return list( + map( + lambda x: re.match(r'(.*)(\[.*\])', x).groups(), + p.find('ul').text.strip().split() + ) + ) - def getg(d): + def get_grammar(d: bs4.element.Tag): s = ('div#web ol.searchCenterMiddle ' 'div.dictionaryWordCard > ul > li') - return list(map(text, data.select(s))) + return list(map(text, d.select(s))) node = data.select_one('div#web ol.searchCenterMiddle > li > div') node = node.select('> div') @@ -246,9 +250,9 @@ def getg(d): return { 'word': w.find('span').text.strip(), - 'pronounce': getp(p) if p else [], # optional - 'explain': gete(e), - 'grammar': getg(data), # optional + 'pronounce': get_pronounce(p) if p else [], # optional + 'explain': get_explain(e), + 'grammar': get_grammar(data), # optional } def parse_explain(self, data): @@ -261,9 +265,12 @@ def getitem(node) -> {'type': 'item', 'text': '...'}: } for s in node.select('p'): - sentence = list(map( - lambda x: ('b', x.text) if x.name == 'b' else str(x), - s.span.contents)) + sentence = list( + map( + lambda x: ('b', x.text) if x.name == 'b' else str(x), + s.span.contents + ) + ) if isinstance(sentence[-1], str): hd, _, tl = sentence.pop().rpartition(' ') sentence.extend([hd, '\n', tl]) @@ -276,7 +283,7 @@ def getitem(node) -> {'type': 'item', 'text': '...'}: nodes = data.select('div.tab-content-explanation ul li') for node in nodes: - if re.match('\d', node.text.strip()): + if re.match(r'\d', node.text.strip()): exp = getitem(node) else: exp = { diff --git a/zdict/dictionary.py b/zdict/dictionary.py index c45bd15a..3ccfd539 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -141,7 +141,7 @@ def lookup(self, word): except exceptions.NotFoundError as e: self.color.print(e, 'yellow') print() - except Exception as e: + except Exception: import traceback traceback.print_exc() url = "https://github.com/zdict/zdict/issues" @@ -168,7 +168,7 @@ def _get_raw(self, word: str, **kwargs) -> str: res = requests.get( self._get_url(word), timeout=self.args.query_timeout, **kwargs ) - except requests.exceptions.ReadTimeout as e: + except requests.exceptions.ReadTimeout: raise exceptions.TimeoutError() except requests.exceptions.ConnectionError as e: errors = { From 53cb86bded42f69178a75b2d4fa2d88cb9b7819f Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:00:05 +0800 Subject: [PATCH 153/508] Rename test-requirements.txt to requirements-test.txt --- test-requirements.txt => requirements-test.txt | 0 setup.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename test-requirements.txt => requirements-test.txt (100%) diff --git a/test-requirements.txt b/requirements-test.txt similarity index 100% rename from test-requirements.txt rename to requirements-test.txt diff --git a/setup.py b/setup.py index 5d356d93..c2b65023 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def get_zdict_version(): def get_test_req(): test_requirements = parse_requirements( - os.path.join(ROOT_DIR, 'test-requirements.txt'), session=False + os.path.join(ROOT_DIR, 'requirements-test.txt'), session=False ) test_requires = [str(tr.req) for tr in test_requirements] From cd672126a8548c0d3957854e4622f8d398cbb1e8 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:07:20 +0800 Subject: [PATCH 154/508] Add JUnit test reports for pytest --- .gitignore | 3 ++- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2b64a1d2..b47d4513 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ build .coverage* .cache .eggs -htmlcov +htmlcov/ +test-reports/ diff --git a/setup.cfg b/setup.cfg index f8202cdf..419c739b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [tool:pytest] -addopts = --flake8 -v --cov zdict --cov-report html --cov-report term +addopts = --flake8 -v --cov zdict --cov-report html --cov-report term --junitxml=test-reports/junit.xml flake8-ignore = zdict/__init__.py F401 zdict/dictionaries/template.py F401 F841 From 2b83d8e5e42e88565b87e33fac044e84566d9453 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:10:47 +0800 Subject: [PATCH 155/508] [#278] Add CircleCI --- .circleci/config.yml | 78 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..e32e66db --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,78 @@ +# eython CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-python/ for more details +# +version: 2 +workflows: + version: 2 + test: + jobs: + - test-3.7 + - test-3.6 + - test-3.5 + - test-3.4 +jobs: + test-3.7: &test-template + docker: + # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + - image: circleci/python:3.7 + working_directory: ~/repo + steps: + - checkout + + - restore_cache: + keys: + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }} + # fallback to using the latest cache if no exact match is found + - pip-cache- + + - run: + name: install dependencies + command: | + python3 -m venv venv + . venv/bin/activate + pip install -r requirements-test.txt + pip install coveralls + + - save_cache: + paths: + - ./venv + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }} + + - run: + name: run tests + command: | + . venv/bin/activate + python setup.py test + + - store_test_results: + path: test-reports + - store_artifacts: + path: test-reports + destination: test-reports + + - store_artifacts: + path: htmlcov + destination: htmlcov + + - run: + name: send coverage to coveralls + command: | + . venv/bin/activate + coveralls + + + test-3.6: + <<: *test-template + docker: + - image: circleci/python:3.6 + + test-3.5: + <<: *test-template + docker: + - image: circleci/python:3.5 + + test-3.4: + <<: *test-template + docker: + - image: circleci/python:3.4 From 4b5e465fbd5d72b244d706e7feac46de83ccccb9 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:35:49 +0800 Subject: [PATCH 156/508] [#278] Fix pip 10 on Python 3.6 Upgrade pip first. --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e32e66db..6b60dac3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,7 @@ jobs: - run: name: install dependencies command: | + pip install -U pip python3 -m venv venv . venv/bin/activate pip install -r requirements-test.txt From 5f9b79998e80f584ff45c196ebe2aea858fc4d2e Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:43:24 +0800 Subject: [PATCH 157/508] [#278] Change CirclCI jobs name --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b60dac3..53c7adc5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,12 +7,12 @@ workflows: version: 2 test: jobs: - - test-3.7 - - test-3.6 - - test-3.5 - - test-3.4 + - linux-python-3.7 + - linux-python-3.6 + - linux-python-3.5 + - linux-python-3.4 jobs: - test-3.7: &test-template + linux-python-3.7: &test-template docker: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - image: circleci/python:3.7 @@ -63,17 +63,17 @@ jobs: coveralls - test-3.6: + linux-python-3.6: <<: *test-template docker: - image: circleci/python:3.6 - test-3.5: + linux-python-3.5: <<: *test-template docker: - image: circleci/python:3.5 - test-3.4: + linux-python-3.4: <<: *test-template docker: - image: circleci/python:3.4 From a57abe3658c6f89d6c6cbccb30c2e7cd27e8fa1f Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:53:10 +0800 Subject: [PATCH 158/508] [#278] Avoid using cache can't be deleted --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53c7adc5..6c11c03a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,8 +23,6 @@ jobs: - restore_cache: keys: - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }} - # fallback to using the latest cache if no exact match is found - - pip-cache- - run: name: install dependencies From bf014e6e97644f72f2e767019b7dbcb9f0875bd2 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 22:56:00 +0800 Subject: [PATCH 159/508] [#278] Make venv cache depends on requirements.txt and requirements-test.txt --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c11c03a..d08c4256 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - run: name: install dependencies @@ -36,7 +36,7 @@ jobs: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - run: name: run tests From db272ae48f5da9193d3bf1be3cd4081bf428f117 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 28 Oct 2018 09:51:53 -0700 Subject: [PATCH 160/508] Update pytest to 3.9.3 (#280) * Update pytest from 3.9.2 to 3.9.3 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- test-requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 2e658265..54abd8f3 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.20.0" coverage = "==4.5.1" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==3.9.2" +pytest = "==3.9.3" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 6e86ac99..2b420363 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -175,10 +175,10 @@ }, "pytest": { "hashes": [ - "sha256:6f6c1efc8d0ccc21f8f6c34d8330baca883cf109b66b3df954b0a117e5528fb4", - "sha256:212be78a6fa5352c392738a49b18f74ae9aeec1040f47c81cadbfd8d1233c310" + "sha256:bf47e8ed20d03764f963f0070ff1c8fda6e2671fc5dd562a4d3b7148ad60f5ca", + "sha256:a9e5e8d7ab9d5b0747f37740276eb362e6a76275d76cebbb52c6049d93b475db" ], - "version": "==3.9.2" + "version": "==3.9.3" }, "pytest-cov": { "hashes": [ diff --git a/test-requirements.txt b/test-requirements.txt index c003fd97..30b7252e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.6.0 pyjokes==0.5.0 -pytest==3.9.2 +pytest==3.9.3 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 3deec3b588351c8821f84eb223b2d5513e069377 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 26 Oct 2018 23:31:32 +0800 Subject: [PATCH 161/508] [#278] Add CircleCI deploy to PyPI part --- .circleci/config.yml | 61 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d08c4256..a0243898 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,12 +5,23 @@ version: 2 workflows: version: 2 - test: + build-test-deploy: jobs: - linux-python-3.7 - linux-python-3.6 - linux-python-3.5 - linux-python-3.4 + - deploy: + requires: + - linux-python-3.7 + - linux-python-3.6 + - linux-python-3.5 + - linux-python-3.4 + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ jobs: linux-python-3.7: &test-template docker: @@ -75,3 +86,51 @@ jobs: <<: *test-template docker: - image: circleci/python:3.4 + + # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ + deploy: + docker: + # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + - image: circleci/python:3.4 + working_directory: ~/repo + steps: + - checkout + + - restore_cache: + keys: + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + + - run: + name: install dependencies + command: | + pip install -U pip + python3 -m venv venv + . venv/bin/activate + pip install -r requirements-test.txt + pip install twine + + - save_cache: + paths: + - ./venv + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + + + - run: + name: init .pypirc + command: | + echo -e "[pypi]" >> ~/.pypirc + echo -e "username = M157q" >> ~/.pypirc + echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + + - run: + name: create packages + command: | + . venv/bin/activate + python setup.py sdist + python setup.py bdist_wheel + + - run: + name: upload to pypi + command: | + . venv/bin/activate + twine upload dist/* From 7d1ecc005a49e513cfdfdd78dfb8d4ef611fe9a2 Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 29 Oct 2018 05:35:33 +0800 Subject: [PATCH 162/508] [#278] Make test-template variable --- .circleci/config.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a0243898..0a478600 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,11 +22,9 @@ workflows: only: /[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ -jobs: - linux-python-3.7: &test-template - docker: - # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - - image: circleci/python:3.7 + +variables: + test-template: &test-template working_directory: ~/repo steps: - checkout @@ -71,6 +69,12 @@ jobs: . venv/bin/activate coveralls +jobs: + # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + linux-python-3.7: + <<: *test-template + docker: + - image: circleci/python:3.7 linux-python-3.6: <<: *test-template @@ -87,6 +91,7 @@ jobs: docker: - image: circleci/python:3.4 + # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ deploy: docker: From 33f16b68f4e15feaea6691b7227de3b0111e1dbe Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 29 Oct 2018 05:37:58 +0800 Subject: [PATCH 163/508] [#278] Only test macOS builds on Travis CI Also remove deploy part on Travis CI because moved deploy job to CircleCI. --- .travis.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d5a113e..37311712 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,21 +2,7 @@ language: python jobs: fast_finish: true - allow_failures: - - python: "nightly" include: - - stage: test - os: linux - python: 3.4 - - stage: test - os: linux - python: 3.5 - - stage: test - os: linux - python: 3.6 - - stage: test - os: linux - python: "nightly" # Python runtime is not yet available on OS X # https://github.com/travis-ci/travis-ci/issues/2312 - stage: test @@ -32,20 +18,6 @@ jobs: language: generic env: PYTHON_VERSION=3.6.4 - - stage: deploy - os: linux - python: 3.4 - script: skip - deploy: &pypi - provider: pypi - user: M157q - password: - secure: SxXAmsEixEw9bIiSTFiRxU4JiILsLZ/wMRys+w5zwmHftyI6+div5j1FcwtxsmAGcSSzsNgKvF9OBCcKuaJ6rlHf87pf13CxsCeZubKKHod7aMywjTtSKRGA70fKB5h+p0qomRgpV1njvgPwLcLeEbr9rHTxjIXBiE77P4E59zk= - distributions: "sdist bdist_wheel" - on: - branch: master - tags: true - condition: $TRAVIS_EVENT_TYPE != cron before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi From 2181c8bf03cf4f07234f5f1435baacfd4e338179 Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 29 Oct 2018 05:44:18 +0800 Subject: [PATCH 164/508] [#278] Set deploy job as manual approval job for CircleCI --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a478600..bba67de3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,7 @@ workflows: - linux-python-3.5 - linux-python-3.4 - deploy: + type: approval requires: - linux-python-3.7 - linux-python-3.6 From 3a9b60e7c2634bb2675a7e78fb5198dfd546702e Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 29 Oct 2018 05:49:31 +0800 Subject: [PATCH 165/508] [#278] Add weekly build on CircleCI --- .circleci/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index bba67de3..9add3a5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,20 @@ workflows: branches: ignore: /.*/ + weekly-build: + triggers: + - schedule: + # At 00:00 on Friday. + cron: "0 0 * * 5" + filters: + branches: + only: master + jobs: + - linux-python-3.7 + - linux-python-3.6 + - linux-python-3.5 + - linux-python-3.4 + variables: test-template: &test-template working_directory: ~/repo From d34cb9de904c98c1158125d3924541c445875cf4 Mon Sep 17 00:00:00 2001 From: Aquakor Date: Sun, 28 Oct 2018 23:36:53 +0100 Subject: [PATCH 166/508] Add verbose mode to Wiktionary (#274) - Add verbose mode to wiktionary - This version does cover every part of speech, definitions and examples provided by the API. - Update README - Added screenshots of Wiktionary. --- README.rst | 8 +++ zdict/dictionaries/wiktionary.py | 67 +++++++++++++++++---- zdict/tests/dictionaries/test_wiktionary.py | 16 ++++- 3 files changed, 75 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index 26f635a3..b7ddebef 100644 --- a/README.rst +++ b/README.rst @@ -195,6 +195,14 @@ To use this source, you should first `apply `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: https://i.imgur.com/5OzIFU3.png + +.. image:: https://i.imgur.com/UO5nQjU.png + + Development & Contributing --------------------------- diff --git a/zdict/dictionaries/wiktionary.py b/zdict/dictionaries/wiktionary.py index ab4640b3..87e73962 100644 --- a/zdict/dictionaries/wiktionary.py +++ b/zdict/dictionaries/wiktionary.py @@ -26,12 +26,28 @@ def show(self, record: Record): content = json.loads(record.content) # Render the output. - self.color.print(record.word, 'yellow') - self.color.print( - content['definition'], - 'org', - indent=2, - ) + self.color.print(record.word, 'lyellow') + + if self.args.verbose: + for d in content: + self.color.print(d['part_of_speech'], 'yellow', indent=2) + for i, defin in enumerate(d['definitions']): + self.color.print("{}. {}".format(i+1, defin['definition']), + 'org', indent=4) + try: + defin['examples'] + except KeyError: + pass + else: + # self.color.print(f"Examples:", 'lindigo', indent=6) + for example in defin['examples']: + self.color.print(example, 'indigo', indent=6) + else: + d = content[0] + self.color.print(d['part_of_speech'], 'yellow', indent=2) + self.color.print(d['definitions'][0]['definition'], + 'org', + indent=4) def query(self, word: str): try: @@ -43,19 +59,44 @@ def query(self, word: str): try: # Get the first definition string from JSON. - definition = content['en'][0]['definitions'][0]['definition'] + content = content['en'] except KeyError: # API can return JSON that does not contain 'en' language. raise NotFoundError(word) - else: - # Clean the definition string from HTML tags. - definition = BeautifulSoup(definition, "html.parser").text - content = {} - content['definition'] = definition + + # Define a list that will be used to create a Record. + r_content = [] + + # For every part of speech append r_content corresponding list. + for i, d in enumerate(content): + # Add what part of speech current definitions refers to. + r_content.append({'part_of_speech': d['partOfSpeech']}) + + # Create a list that will store english_definitions + # of the current part of speech. + r_content[i]['definitions'] = [] + + for j, d2 in enumerate(d['definitions']): + # Parse definition and append definitions list. + definition = BeautifulSoup(d2['definition'], + "html.parser").text + r_content[i]['definitions'].append({'definition': definition}) + + # If API provides examples for the current definition + # create a new list and append them. + try: + d2['examples'] + except KeyError: + pass + else: + r_content[i]['definitions'][j]['examples'] = [] + for ex in d2['examples']: + ex = BeautifulSoup(ex, "html.parser").text + r_content[i]['definitions'][j]['examples'].append(ex) record = Record( word=word, - content=json.dumps(content), + content=json.dumps(r_content), source=self.provider, ) diff --git a/zdict/tests/dictionaries/test_wiktionary.py b/zdict/tests/dictionaries/test_wiktionary.py index f9726524..7d233f3c 100644 --- a/zdict/tests/dictionaries/test_wiktionary.py +++ b/zdict/tests/dictionaries/test_wiktionary.py @@ -1,5 +1,6 @@ from pytest import raises from unittest.mock import Mock, patch +import json from zdict.dictionaries.wiktionary import WiktionaryDict from zdict.exceptions import NotFoundError, QueryError @@ -31,17 +32,26 @@ def test_query_notfound(self): @patch('zdict.dictionaries.wiktionary.Record') def test_query_normal(self, Record): - content = '{"en":[{"definitions":[{"definition":"string"}]}]}' + content = ''' + {"en":[{"partOfSpeech":"part_of_speech", + "definitions":[{"definition":"definition","examples":["example"]}]}]} + ''' self.dict._get_raw = Mock(return_value=content) self.dict.query('mock') + r_content = [{"part_of_speech": "part_of_speech", + "definitions": [{"definition": "definition", + "examples": ["example"]}]}] Record.assert_called_with( word='mock', - content='{"definition": "string"}', + content=json.dumps(r_content), source='wiktionary' ) def test_show(self): - content = '{"definition": "string"}' + content = ''' + [{"part_of_speech":"part_of_speech", + "definitions":[{"definition": "definition","examples":["example"]}]}] + ''' r = Record(word="string", content=content, From aa0796ce8493bfa1c244e032fa1b0666adb9136c Mon Sep 17 00:00:00 2001 From: shunyi Date: Mon, 29 Oct 2018 06:48:45 +0800 Subject: [PATCH 167/508] Version 1.0.2 - [#274] Add verbose mode for wikitionary. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index bdb8521b..f9858b8c 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '1.0.1' +VERSION = '1.0.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 1c825aade810a60776a074d808094d6500bd7257 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 31 Oct 2018 04:58:49 +0800 Subject: [PATCH 168/508] Update README.rst Add CircleCI status badge --- README.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index b7ddebef..97677b65 100644 --- a/README.rst +++ b/README.rst @@ -2,11 +2,11 @@ zdict ======================================== -|issues| |travis| |coveralls| +|issues| -|license| +|travis| |circleci| -|gitter| +|coveralls| |license| |gitter| ---- @@ -286,6 +286,9 @@ Stargazers over time .. |travis| image:: https://api.travis-ci.org/zdict/zdict.svg?branch=master :target: https://travis-ci.org/zdict/zdict +.. |circleci| image:: https://circleci.com/gh/zdict/zdict.svg?style=svg + :target: https://circleci.com/gh/zdict/zdict + .. |license| image:: https://img.shields.io/github/license/zdict/zdict.svg :target: https://github.com/zdict/zdict/blob/master/LICENSE.md From 1fa18f4f88fb9f40bc31f9424d6d714298fb3315 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 31 Oct 2018 04:59:47 +0800 Subject: [PATCH 169/508] Update README.rst Make coveralls badge align with CI badges. --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 97677b65..fd57a053 100644 --- a/README.rst +++ b/README.rst @@ -4,9 +4,9 @@ zdict |issues| -|travis| |circleci| +|travis| |circleci| |coveralls| -|coveralls| |license| |gitter| +|license| |gitter| ---- From 4a9f6f3d97d7de64ff20653d45383519d0a0c5c4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 4 Nov 2018 07:10:52 -0800 Subject: [PATCH 170/508] Update urllib3 from 1.24 to 1.24.1 (#281) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 2b420363..9756dc92 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:8819bba37a02d143296a4d032373c4dd4aca11f6d4c9973335ca75f9c8475f59", - "sha256:41c3db2fc01e5b907288010dec72f9d0a74e37d6994e6eb56849f59fea2265ae" + "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", + "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" ], - "version": "==1.24" + "version": "==1.24.1" } }, "develop": { From 4e2e6c148f66309acdd43df8c7d0849dcdd285cd Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 5 Nov 2018 10:44:38 +0800 Subject: [PATCH 171/508] [CircleCI] Make tests run on git tag pushed --- .circleci/config.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9add3a5e..40b154f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,10 +7,22 @@ workflows: version: 2 build-test-deploy: jobs: - - linux-python-3.7 - - linux-python-3.6 - - linux-python-3.5 - - linux-python-3.4 + - linux-python-3.7: + filters: + tags: + only: /.*/ + - linux-python-3.6: + filters: + tags: + only: /.*/ + - linux-python-3.5: + filters: + tags: + only: /.*/ + - linux-python-3.4: + filters: + tags: + only: /.*/ - deploy: type: approval requires: From 5e74f5a75635ecb46bc4dc5224e307375dde8867 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 5 Nov 2018 00:38:24 -0800 Subject: [PATCH 172/508] Update pytest to 3.10.0 (#282) * Update pytest from 3.9.3 to 3.10.0 * Update pytest from 3.9.3 to 3.10.0 * Update pytest from 3.9.3 to 3.10.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 54abd8f3..a1af8d1a 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.20.0" coverage = "==4.5.1" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==3.9.3" +pytest = "==3.10.0" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 9756dc92..f6509e05 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -175,10 +175,10 @@ }, "pytest": { "hashes": [ - "sha256:bf47e8ed20d03764f963f0070ff1c8fda6e2671fc5dd562a4d3b7148ad60f5ca", - "sha256:a9e5e8d7ab9d5b0747f37740276eb362e6a76275d76cebbb52c6049d93b475db" + "sha256:630ff1dbe04f469ee78faa5660f712e58b953da7df22ea5d828c9012e134da43", + "sha256:a2b5232735dd0b736cbea9c0f09e5070d78fcaba2823a4f6f09d9a81bd19415c" ], - "version": "==3.9.3" + "version": "==3.10.0" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 30b7252e..2098d9c0 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.6.0 pyjokes==0.5.0 -pytest==3.9.3 +pytest==3.10.0 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 51c646e236b6e8577410e7641e4fd5612728bd7f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 9 Nov 2018 20:08:32 -0800 Subject: [PATCH 173/508] Update requests to 2.20.1 (#283) This PR updates [requests](https://pypi.org/project/requests) from **2.20.0** to **2.20.1**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index a1af8d1a..9f806507 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" beautifulsoup4 = "==4.6.3" peewee = "==3.7.1" -requests = "==2.20.0" +requests = "==2.20.1" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index f6509e05..caab771b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -51,10 +51,10 @@ }, "requests": { "hashes": [ - "sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279", - "sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c" + "sha256:65b3a120e4329e33c9889db89c80976c5272f56ea92d3e74da8a463992e3ff54", + "sha256:ea881206e59f41dbd0bd445437d792e43906703fff75ca8ff43ccdb11f33f263" ], - "version": "==2.20.0" + "version": "==2.20.1" }, "urllib3": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 30cea417..d0617e49 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 peewee==3.7.1 -requests==2.20.0 \ No newline at end of file +requests==2.20.1 \ No newline at end of file From 8c2a24b9bf09fa350ca68de5b257a1f8d78f4521 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 12 Nov 2018 21:14:44 -0800 Subject: [PATCH 174/508] Update pytest to 3.10.1 (#284) * Update pytest from 3.10.0 to 3.10.1 * Update pytest from 3.10.0 to 3.10.1 * Update pytest from 3.10.0 to 3.10.1 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 9f806507..27a1f2de 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.20.1" coverage = "==4.5.1" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==3.10.0" +pytest = "==3.10.1" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index caab771b..27cc8feb 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -175,10 +175,10 @@ }, "pytest": { "hashes": [ - "sha256:630ff1dbe04f469ee78faa5660f712e58b953da7df22ea5d828c9012e134da43", - "sha256:a2b5232735dd0b736cbea9c0f09e5070d78fcaba2823a4f6f09d9a81bd19415c" + "sha256:3f193df1cfe1d1609d4c583838bea3d532b18d6160fd3f55c9447fdca30848ec", + "sha256:e246cf173c01169b9617fc07264b7b1316e78d7a650055235d6d897bc80d9660" ], - "version": "==3.10.0" + "version": "==3.10.1" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 2098d9c0..be5c4667 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.1 flake8==3.6.0 pyjokes==0.5.0 -pytest==3.10.0 +pytest==3.10.1 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 5289b5a7f84145b1637650bca59166f08771d56a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 13 Nov 2018 00:32:11 -0800 Subject: [PATCH 175/508] Update coverage to 4.5.2 (#285) * Update coverage from 4.5.1 to 4.5.2 * Update coverage from 4.5.1 to 4.5.2 * Update coverage from 4.5.1 to 4.5.2 --- Pipfile | 2 +- Pipfile.lock | 82 +++++++++++++++++++++++-------------------- requirements-test.txt | 2 +- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Pipfile b/Pipfile index 27a1f2de..620aa3a6 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ requests = "==2.20.1" [dev-packages] -coverage = "==4.5.1" +coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" pytest = "==3.10.1" diff --git a/Pipfile.lock b/Pipfile.lock index 27cc8feb..c43f425f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -74,45 +74,49 @@ }, "coverage": { "hashes": [ - "sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba", - "sha256:0b136648de27201056c1869a6c0d4e23f464750fd9a9ba9750b8336a244429ed", - "sha256:104ab3934abaf5be871a583541e8829d6c19ce7bde2923b2751e0d3ca44db60a", - "sha256:15b111b6a0f46ee1a485414a52a7ad1d703bdf984e9ed3c288a4414d3871dcbd", - "sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640", - "sha256:1c383d2ef13ade2acc636556fd544dba6e14fa30755f26812f54300e401f98f2", - "sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162", - "sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508", - "sha256:337ded681dd2ef9ca04ef5d93cfc87e52e09db2594c296b4a0a3662cb1b41249", - "sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694", - "sha256:3c79a6f7b95751cdebcd9037e4d06f8d5a9b60e4ed0cd231342aa8ad7124882a", - "sha256:3d72c20bd105022d29b14a7d628462ebdc61de2f303322c0212a054352f3b287", - "sha256:3eb42bf89a6be7deb64116dd1cc4b08171734d721e7a7e57ad64cc4ef29ed2f1", - "sha256:4635a184d0bbe537aa185a34193898eee409332a8ccb27eea36f262566585000", - "sha256:56e448f051a201c5ebbaa86a5efd0ca90d327204d8b059ab25ad0f35fbfd79f1", - "sha256:5a13ea7911ff5e1796b6d5e4fbbf6952381a611209b736d48e675c2756f3f74e", - "sha256:69bf008a06b76619d3c3f3b1983f5145c75a305a0fea513aca094cae5c40a8f5", - "sha256:6bc583dc18d5979dc0f6cec26a8603129de0304d5ae1f17e57a12834e7235062", - "sha256:701cd6093d63e6b8ad7009d8a92425428bc4d6e7ab8d75efbb665c806c1d79ba", - "sha256:7608a3dd5d73cb06c531b8925e0ef8d3de31fed2544a7de6c63960a1e73ea4bc", - "sha256:76ecd006d1d8f739430ec50cc872889af1f9c1b6b8f48e29941814b09b0fd3cc", - "sha256:7aa36d2b844a3e4a4b356708d79fd2c260281a7390d678a10b91ca595ddc9e99", - "sha256:7d3f553904b0c5c016d1dad058a7554c7ac4c91a789fca496e7d8347ad040653", - "sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c", - "sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558", - "sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f", - "sha256:9e112fcbe0148a6fa4f0a02e8d58e94470fc6cb82a5481618fea901699bf34c4", - "sha256:ac4fef68da01116a5c117eba4dd46f2e06847a497de5ed1d64bb99a5fda1ef91", - "sha256:b8815995e050764c8610dbc82641807d196927c3dbed207f0a079833ffcf588d", - "sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9", - "sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd", - "sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d", - "sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", - "sha256:e4d96c07229f58cb686120f168276e434660e4358cc9cf3b0464210b04913e77", - "sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80", - "sha256:f8a923a85cb099422ad5a2e345fe877bbc89a8a8b23235824a93488150e45f6e" - ], - "index": "pypi", - "version": "==4.5.1" + "sha256:a5c58664b23b248b16b96253880b2868fb34358911400a7ba39d7f6399935389", + "sha256:b3b0c8f660fae65eac74fbf003f3103769b90012ae7a460863010539bb7a80da", + "sha256:8cb4febad0f0b26c6f62e1628f2053954ad2c555d67660f28dfb1b0496711952", + "sha256:447c450a093766744ab53bf1e7063ec82866f27bcb4f4c907da25ad293bba7e3", + "sha256:1b4276550b86caa60606bd3572b52769860a81a70754a54acc8ba789ce74d607", + "sha256:6694d5573e7790a0e8d3d177d7a416ca5f5c150742ee703f3c18df76260de794", + "sha256:510986f9a280cd05189b42eee2b69fecdf5bf9651d4cd315ea21d24a964a3c36", + "sha256:09e47c529ff77bf042ecfe858fb55c3e3eb97aac2c87f0349ab5a7efd6b3939f", + "sha256:5535dda5739257effef56e49a1c51c71f1d37a6e5607bb25a5eee507c59580d1", + "sha256:0a1f9b0eb3aa15c990c328535655847b3420231af299386cfe5efc98f9c250fe", + "sha256:0cc941b37b8c2ececfed341444a456912e740ecf515d560de58b9a76562d966d", + "sha256:da969da069a82bbb5300b59161d8d7c8d423bc4ccd3b410a9b4d8932aeefc14b", + "sha256:6831e1ac20ac52634da606b658b0b2712d26984999c9d93f0c6e59fe62ca741b", + "sha256:5f55028169ef85e1fa8e4b8b1b91c0b3b0fa3297c4fb22990d46ff01d22c2d6c", + "sha256:10e8af18d1315de936d67775d3a814cc81d0747a1a0312d84e27ae5610e313b0", + "sha256:2b224052bfd801beb7478b03e8a66f3f25ea56ea488922e98903914ac9ac930b", + "sha256:77f0d9fa5e10d03aa4528436e33423bfa3718b86c646615f04616294c935f840", + "sha256:5a7524042014642b39b1fcae85fb37556c200e64ec90824ae9ecf7b667ccfc14", + "sha256:85a06c61598b14b015d4df233d249cd5abfa61084ef5b9f64a48e997fd829a82", + "sha256:ed02c7539705696ecb7dc9d476d861f3904a8d2b7e894bd418994920935d36bb", + "sha256:aaa0f296e503cda4bc07566f592cd7a28779d433f3a23c48082af425d6d5a78f", + "sha256:1e8a2627c48266c7b813975335cfdea58c706fe36f607c97d9392e61502dc79d", + "sha256:46101fc20c6f6568561cdd15a54018bb42980954b79aa46da8ae6f008066a30e", + "sha256:ee5b8abc35b549012e03a7b1e86c09491457dba6c94112a2482b18589cc2bdb9", + "sha256:c45297bbdbc8bb79b02cf41417d63352b70bcb76f1bbb1ee7d47b3e89e42f95d", + "sha256:d64b4340a0c488a9e79b66ec9f9d77d02b99b772c8b8afd46c1294c1d39ca478", + "sha256:828ad813c7cdc2e71dcf141912c685bfe4b548c0e6d9540db6418b807c345ddd", + "sha256:d19bca47c8a01b92640c614a9147b081a1974f69168ecd494687c827109e8f42", + "sha256:4710dc676bb4b779c4361b54eb308bc84d64a2fa3d78e5f7228921eccce5d815", + "sha256:bab8e6d510d2ea0f1d14f12642e3f35cefa47a9b2e4c7cea1852b52bc9c49647", + "sha256:ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4", + "sha256:99bd767c49c775b79fdcd2eabff405f1063d9d959039c0bdd720527a7738748a", + "sha256:71afc1f5cd72ab97330126b566bbf4e8661aab7449f08895d21a5d08c6b051ff", + "sha256:06123b58a1410873e22134ca2d88bd36680479fe354955b3579fb8ff150e4d27", + "sha256:7349c27128334f787ae63ab49d90bf6d47c7288c63a0a5dfaa319d4b4541dd2c", + "sha256:869ef4a19f6e4c6987e18b315721b8b971f7048e6eaea29c066854242b4e98d9", + "sha256:859714036274a75e6e57c7bab0c47a4602d2a8cfaaa33bbdb68c8359b2ed4f5c", + "sha256:0d34245f824cc3140150ab7848d08b7e2ba67ada959d77619c986f2062e1f0e8", + "sha256:977e2d9a646773cc7428cdd9a34b069d6ee254fadfb4d09b3f430e95472f3cf3", + "sha256:3ad59c84c502cd134b0088ca9038d100e8fb5081bbd5ccca4863f3804d81f61d", + "sha256:258b21c5cafb0c3768861a6df3ab0cfb4d8b495eee5ec660e16f928bf7385390" + ], + "version": "==4.5.2" }, "flake8": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index be5c4667..f2a8c991 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==4.5.1 +coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 pytest==3.10.1 From bb3c33358c4801b5f0900ada4d981e9f06a86876 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 15 Nov 2018 10:41:02 -0800 Subject: [PATCH 176/508] Update pytest to 4.0.0 (#286) * Update pytest from 3.10.1 to 4.0.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 620aa3a6..61ae844c 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.20.1" coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==3.10.1" +pytest = "==4.0.0" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index c43f425f..751e714b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -179,10 +179,10 @@ }, "pytest": { "hashes": [ - "sha256:3f193df1cfe1d1609d4c583838bea3d532b18d6160fd3f55c9447fdca30848ec", - "sha256:e246cf173c01169b9617fc07264b7b1316e78d7a650055235d6d897bc80d9660" + "sha256:c055690dfefa744992f563e8c3a654089a6aa5b8092dded9b6fafbd70b2e45a7", + "sha256:488c842647bbeb350029da10325cb40af0a9c7a2fdda45aeb1dda75b60048ffb" ], - "version": "==3.10.1" + "version": "==4.0.0" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index f2a8c991..9f5fc1a0 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 -pytest==3.10.1 +pytest==4.0.0 pytest-cov==2.6.0 pytest-flake8==1.0.2 From a84e82b551bf84c653a53e65c28d55781ddd4471 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 25 Nov 2018 19:12:30 -0800 Subject: [PATCH 177/508] Update pytest to 4.0.1 (#287) * Update pytest from 4.0.0 to 4.0.1 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 61ae844c..71b5bae7 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.20.1" coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==4.0.0" +pytest = "==4.0.1" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 751e714b..d4fd0a8b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -179,10 +179,10 @@ }, "pytest": { "hashes": [ - "sha256:c055690dfefa744992f563e8c3a654089a6aa5b8092dded9b6fafbd70b2e45a7", - "sha256:488c842647bbeb350029da10325cb40af0a9c7a2fdda45aeb1dda75b60048ffb" + "sha256:ca4761407f1acc85ffd1609f464ca20bb71a767803505bd4127d0e45c5a50e23", + "sha256:1d131cc532be0023ef8ae265e2a779938d0619bb6c2510f52987ffcba7fa1ee4" ], - "version": "==4.0.0" + "version": "==4.0.1" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 9f5fc1a0..3aff7dec 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 -pytest==4.0.0 +pytest==4.0.1 pytest-cov==2.6.0 pytest-flake8==1.0.2 From f02eb745cbb645d3a74f57283381de1c2fc8592a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 30 Nov 2018 00:08:41 -0800 Subject: [PATCH 178/508] Update certifi from 2018.10.15 to 2018.11.29 (#288) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index d4fd0a8b..cadc430e 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -24,10 +24,10 @@ }, "certifi": { "hashes": [ - "sha256:339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c", - "sha256:6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a" + "sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033", + "sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7" ], - "version": "==2018.10.15" + "version": "==2018.11.29" }, "chardet": { "hashes": [ From 653f7d9b704b37dbbb948361bf02abac8fd35e19 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 5 Dec 2018 16:58:19 -0800 Subject: [PATCH 179/508] Update idna from 2.7 to 2.8 (#290) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index cadc430e..04bba036 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -38,10 +38,10 @@ }, "idna": { "hashes": [ - "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", - "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" + "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c", + "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407" ], - "version": "==2.7" + "version": "==2.8" }, "peewee": { "hashes": [ From 18227df3f510c80a7ee0208d6aca2f108188e019 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 10 Dec 2018 08:31:21 -0800 Subject: [PATCH 180/508] Update six to 1.12.0 (#291) This PR updates [six](https://pypi.org/project/six) from **1.11.0** to **1.12.0**.
Changelog ### 1.12.0 ``` ------ - Issue 259, pull request 260: `six.add_metaclass` now preserves `__qualname__` from the original class. - Pull request 204: Add `six.ensure_binary`, `six.ensure_text`, and `six.ensure_str`. ```
--- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 04bba036..f0bf5dbc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -200,10 +200,10 @@ }, "six": { "hashes": [ - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", + "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" ], - "version": "==1.11.0" + "version": "==1.12.0" } } } From f7ff8c6a9bf6122f9b783746cd6bd59c214a2093 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 10 Dec 2018 19:36:10 -0800 Subject: [PATCH 181/508] Update requests to 2.21.0 (#292) This PR updates [requests](https://pypi.org/project/requests) from **2.20.1** to **2.21.0**.
Changelog ### 2.21.0 ``` ------------------- **Dependencies** - Requests now supports idna v2.8. ```
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 71b5bae7..a7a928f9 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" beautifulsoup4 = "==4.6.3" peewee = "==3.7.1" -requests = "==2.20.1" +requests = "==2.21.0" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index f0bf5dbc..91f01987 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -51,10 +51,10 @@ }, "requests": { "hashes": [ - "sha256:65b3a120e4329e33c9889db89c80976c5272f56ea92d3e74da8a463992e3ff54", - "sha256:ea881206e59f41dbd0bd445437d792e43906703fff75ca8ff43ccdb11f33f263" + "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b", + "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e" ], - "version": "==2.20.1" + "version": "==2.21.0" }, "urllib3": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index d0617e49..3883c1ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 peewee==3.7.1 -requests==2.20.1 \ No newline at end of file +requests==2.21.0 \ No newline at end of file From e54ff61b43ade7701090fe2c6ef61f2bfc81376a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 16 Dec 2018 18:26:51 -0800 Subject: [PATCH 182/508] Update pytest to 4.0.2 (#293) This PR updates [pytest](https://pypi.org/project/pytest) from **4.0.1** to **4.0.2**.
Changelog ### 4.0.2 ``` ========================= Bug Fixes --------- - `4265 <https://github.com/pytest-dev/pytest/issues/4265>`_: Validate arguments from the ``PYTEST_ADDOPTS`` environment variable and the ``addopts`` ini option separately. - `4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Fix ``raises(..., 'code(string)')`` frame filename. - `4500 <https://github.com/pytest-dev/pytest/issues/4500>`_: When a fixture yields and a log call is made after the test runs, and, if the test is interrupted, capture attributes are ``None``. - `4538 <https://github.com/pytest-dev/pytest/issues/4538>`_: Raise ``TypeError`` for ``with raises(..., match=<non-None falsey value>)``. Improved Documentation ---------------------- - `1495 <https://github.com/pytest-dev/pytest/issues/1495>`_: Document common doctest fixture directory tree structure pitfalls ```
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index a7a928f9..3181d4c1 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==4.0.1" +pytest = "==4.0.2" pytest-cov = "==2.6.0" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 91f01987..3545f1e8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -179,10 +179,10 @@ }, "pytest": { "hashes": [ - "sha256:ca4761407f1acc85ffd1609f464ca20bb71a767803505bd4127d0e45c5a50e23", - "sha256:1d131cc532be0023ef8ae265e2a779938d0619bb6c2510f52987ffcba7fa1ee4" + "sha256:f812ea39a0153566be53d88f8de94839db1e8a05352ed8a49525d7d7f37861e9", + "sha256:f689bf2fc18c4585403348dd56f47d87780bf217c53ed9ae7a3e2d7faa45f8e9" ], - "version": "==4.0.1" + "version": "==4.0.2" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 3aff7dec..e37b7405 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 -pytest==4.0.1 +pytest==4.0.2 pytest-cov==2.6.0 pytest-flake8==1.0.2 From 39c684dbb8ed86cdec8bed1dae6e0c914ef66a5f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 23 Dec 2018 19:52:35 -0800 Subject: [PATCH 183/508] Update peewee to 3.8.0 (#294) This PR updates [peewee](https://pypi.org/project/peewee) from **3.7.1** to **3.8.0**.
Changelog ### 3.8.0 ``` **New features** * Postgres `BinaryJSONField` now supports `has_key()`, `concat()` and `remove()` methods (though remove may require pg10+). * Add `python_value()` method to the SQL-function helper `fn`, to allow specifying a custom function for mapping database values to Python values. **Changes** * Better support for UPDATE ... FROM queries, and more generally, more robust support for UPDATE and RETURNING clauses. This means that the `QualifiedNames` helper is no longer needed for certain types of queries. * The `SqlCipherDatabase` no longer accepts a `kdf_iter` parameter. To configure the various SQLCipher encryption settings, specify the setting values as `pragmas` when initializing the database. * Introspection will now, by default, only strip "_id" from introspected column names if those columns are foreign-keys. See 1799 for discussion. * Allow `UUIDField` and `BinaryUUIDField` to accept hexadecimal UUID strings as well as raw binary UUID bytestrings (in addition to `UUID` instances, which are already supported). * Allow `ForeignKeyField` to be created without an index. * Allow multiple calls to `cast()` to be chained (1795). * Add logic to ensure foreign-key constraint names that exceed 64 characters are truncated using the same logic as is currently in place for long indexes. * `ManyToManyField` supports foreign-keys to fields other than primary-keys. * When linked against SQLite 3.26 or newer, support `SQLITE_CONSTRAINT` to designate invalid queries against virtual tables. * SQL-generation changes to aid in supporting using queries within expressions following the SELECT statement. **Bugfixes** * Fixed bug in `order_by_extend()`, thanks nhatHero. * Fixed bug where the `DataSet` CSV import/export did not support non-ASCII characters in Python 3.x. * Fixed bug where `model_to_dict` would attempt to traverse explicitly disabled foreign-key backrefs (1785). * Fixed bug when attempting to migrate SQLite tables that have a field whose column-name begins with "primary_". * Fixed bug with inheriting deferred foreign-keys. [View commits](https://github.com/coleifer/peewee/compare/3.7.1...3.8.0) ```
--- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 3181d4c1..fc943daa 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.3" -peewee = "==3.7.1" +peewee = "==3.8.0" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 3545f1e8..8d8f4bce 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:a91c3ccff43ab71f08196aba1d17dd2548079744d54adc33d511db1c30b446ba" + "sha256:1b0c40803d3eecd001819727472e39d78ac09254cd01e55d2e98ace141ec3815" ], - "version": "==3.7.1" + "version": "==3.8.0" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 3883c1ae..7a4f7f7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 -peewee==3.7.1 +peewee==3.8.0 requests==2.21.0 \ No newline at end of file From 8de84841bf0e8c9a028b5245c59b47aa16157dc5 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 24 Dec 2018 18:38:09 +0800 Subject: [PATCH 184/508] [Travis CI] Add workaround for Travis CI stdout write error --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 37311712..9e3040ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,10 @@ before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then source ~/venv/bin/activate; fi + # workaround for Travis CI stdout write error + # ref: + - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' + install: - "pip install -U setuptools" # for upgrade issue with setuptools and CPython 3.6 on Travis CI - "pip install -U pip" From cef66fecdbb1f2a1b6c0aab0ba01d11ca94eb00d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 27 Dec 2018 20:25:39 -0800 Subject: [PATCH 185/508] Update more-itertools to 5.0.0 (#295) This PR updates [more-itertools](https://pypi.org/project/more-itertools) from **4.3.0** to **5.0.0**.
Changelog ### 5.0.0 ``` See PR 252 for notes. ``` ### 4.3.1 ``` This is [version 4.3.0](https://github.com/erikrose/more-itertools/releases/tag/4.3.0) plus PR 226 . There is no corresponding PyPI release; this is just to fix the docs on RTD. ```
--- Pipfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 8d8f4bce..0e8d38ef 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -134,11 +134,11 @@ }, "more-itertools": { "hashes": [ - "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d", - "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", - "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e" + "sha256:c0a5785b1109a6bd7fac76d6837fd1feca158e54e521ccd2ae8bfe393cc9d4fc", + "sha256:fe7a7cae1ccb57d33952113ff4fa1bc5f879963600ed74918f1236e212ee50b9", + "sha256:38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4" ], - "version": "==4.3.0" + "version": "==5.0.0" }, "pluggy": { "hashes": [ From ff6ff4bd80ef565dccfcbc81cc67ec963ac80b7d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 6 Jan 2019 21:31:59 -0800 Subject: [PATCH 186/508] Update pytest-cov to 2.6.1 (#298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR updates [pytest-cov](https://pypi.org/project/pytest-cov) from **2.6.0** to **2.6.1**.
Changelog ### 2.6.1 ``` ------------------ * Added support for Pytest 4.1. Contributed by Daniel Hahler and Семён Марьясин in `253 <https://github.com/pytest-dev/pytest-cov/pull/253>`_ and `230 <https://github.com/pytest-dev/pytest-cov/pull/230>`_. * Various test and docs fixes. Contributed by Daniel Hahler in `224 <https://github.com/pytest-dev/pytest-cov/pull/224>`_ and `223 <https://github.com/pytest-dev/pytest-cov/pull/223>`_. * Fixed the "Module already imported" issue (`211 <https://github.com/pytest-dev/pytest-cov/issues/211>`_). Contributed by Daniel Hahler in `228 <https://github.com/pytest-dev/pytest-cov/pull/228>`_. ```
Links - PyPI: https://pypi.org/project/pytest-cov - Changelog: https://pyup.io/changelogs/pytest-cov/ - Repo: https://github.com/pytest-dev/pytest-cov
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index fc943daa..600d9453 100644 --- a/Pipfile +++ b/Pipfile @@ -18,5 +18,5 @@ coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" pytest = "==4.0.2" -pytest-cov = "==2.6.0" +pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.2" diff --git a/Pipfile.lock b/Pipfile.lock index 0e8d38ef..12150041 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -186,10 +186,10 @@ }, "pytest-cov": { "hashes": [ - "sha256:513c425e931a0344944f84ea47f3956be0e416d95acbd897a44970c8d926d5d7", - "sha256:e360f048b7dae3f2f2a9a4d067b2dd6b6a015d384d1577c994a43f3f7cbad762" + "sha256:230ef817450ab0699c6cc3c9c8f7a829c34674456f2ed8df1fe1d39780f7c87f", + "sha256:0ab664b25c6aa9716cbf203b17ddb301932383046082c081b9848a0edf5add33" ], - "version": "==2.6.0" + "version": "==2.6.1" }, "pytest-flake8": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index e37b7405..327fa496 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 pytest==4.0.2 -pytest-cov==2.6.0 +pytest-cov==2.6.1 pytest-flake8==1.0.2 From 5d8f29b1407a9553715b8476f3235a5585da70df Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 7 Jan 2019 09:32:18 -0800 Subject: [PATCH 187/508] Update peewee to 3.8.1 (#300) This PR updates [peewee](https://pypi.org/project/peewee) from **3.8.0** to **3.8.1**.
Changelog ### 3.8.1 ``` **New features** * Sqlite `SearchField` now supports the `match()` operator, allowing full-text search to be performed on a single column (as opposed to the whole table). **Changes** * Remove minimum passphrase restrictions in SQLCipher integration. **Bugfixes** * Support inheritance of `ManyToManyField` instances. * Ensure operator overloads are invoked when generating filter expressions. * Fix incorrect scoring in Sqlite BM25, BM25f and Lucene ranking algorithms. * Support string field-names in data dictionary when performing an ON CONFLICT ... UPDATE query, which allows field-specific conversions to be applied. References 1815. [View commits](https://github.com/coleifer/peewee/compare/3.8.0...3.8.1) ```
Links - PyPI: https://pypi.org/project/peewee - Changelog: https://pyup.io/changelogs/peewee/ - Repo: https://github.com/coleifer/peewee/
--- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 600d9453..f844a474 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.6.3" -peewee = "==3.8.0" +peewee = "==3.8.1" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 12150041..48ecbbc6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:1b0c40803d3eecd001819727472e39d78ac09254cd01e55d2e98ace141ec3815" + "sha256:c80208d6ba2191728654cb5d2e85cd58e7dcad6a2fa1807868dd984ccef2586d" ], - "version": "==3.8.0" + "version": "==3.8.1" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 7a4f7f7d..16b81602 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.6.3 -peewee==3.8.0 +peewee==3.8.1 requests==2.21.0 \ No newline at end of file From f18616d2bea2d483d776c20680f4aca276b357e8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 9 Jan 2019 18:34:35 -0800 Subject: [PATCH 188/508] Update beautifulsoup4 to 4.7.0 (#296) * Update beautifulsoup4 from 4.6.3 to 4.7.0 * [#296] Fix SyntaxError for beautifulsoup4==4.7.0 beautifulsoup4==4.7.0 uses soupsieve as its new CSS selector https://github.com/facelessuser/soupsieve * [#296] Fix NotFoundError of YahooDict if node is None => should return NotFoundError * fix css selector for cases of starting with '>' --- Pipfile | 2 +- Pipfile.lock | 8 ++++---- requirements.txt | 4 ++-- zdict/dictionaries/yahoo.py | 20 ++++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Pipfile b/Pipfile index f844a474..3085c1b0 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.6.3" +beautifulsoup4 = "==4.7.0" peewee = "==3.8.1" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 48ecbbc6..ae79449c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,11 +16,11 @@ "default": { "beautifulsoup4": { "hashes": [ - "sha256:f0abd31228055d698bb392a826528ea08ebb9959e6bea17c606fd9c9009db938", - "sha256:194ec62a25438adcb3fdb06378b26559eda1ea8a747367d34c33cef9c7f48d57", - "sha256:90f8e61121d6ae58362ce3bed8cd997efb00c914eae0ff3d363c32f9a9822d10" + "sha256:6a7f5e0efc563cd1ffeefba6d528b97aa0d313c02dd126ba6c455e5fe5bd48eb", + "sha256:1ed70a0e99742653953d68462378a1a8eb65dca5f7c8fa44a05a2a0b3545df67", + "sha256:e394827904cc4923f443e8dd2e9968343669c8e1ad7a8d62d7541e780884acb8" ], - "version": "==4.6.3" + "version": "==4.7.0" }, "certifi": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 16b81602..663692a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.6.3 +beautifulsoup4==4.7.0 peewee==3.8.1 -requests==2.21.0 \ No newline at end of file +requests==2.21.0 diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index c3893f75..d391d073 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -234,19 +234,19 @@ def get_grammar(d: bs4.element.Tag): return list(map(text, d.select(s))) node = data.select_one('div#web ol.searchCenterMiddle > li > div') - node = node.select('> div') + node = node.select(':scope > div') p = None # optional - if len(node) == 6: # e.g. "metadata" - _, w, p, _, _, e = node - elif len(node) == 5: - _, w, p, _, e = node - elif len(node) == 4: # e.g. "hold on" - _, w, _, e = node + if node is None or len(node) <= 2: # e.g. "fabor" + raise NotFoundError(word) elif len(node) == 3: # e.g. "google" _, w, e = node - elif len(node) <= 2: # e.g. "fabor" - raise NotFoundError(word) + elif len(node) == 4: # e.g. "hold on" + _, w, _, e = node + elif len(node) == 5: + _, w, p, _, e = node + elif len(node) == 6: # e.g. "metadata" + _, w, p, _, _, e = node return { 'word': w.find('span').text.strip(), @@ -312,6 +312,6 @@ def parse_verbose(self, data): 'fw-500' in cls and ret.append(('explain', s)) elif name == 'ul': - for li in node.select('> li'): + for li in node.select(':scope > li'): ret.append(('item', li.span.text)) return ret From 37d28ccc8846ad07e6e7fb1f0f9f58638280d068 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 10 Jan 2019 21:40:03 -0800 Subject: [PATCH 189/508] Update beautifulsoup4 to 4.7.1 (#299) * Update beautifulsoup4 from 4.6.3 to 4.7.1 * Update beautifulsoup4 from 4.6.3 to 4.7.1 * Update beautifulsoup4 from 4.6.3 to 4.7.1 --- Pipfile | 2 +- Pipfile.lock | 8 ++++---- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 3085c1b0..365a8e8c 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.7.0" +beautifulsoup4 = "==4.7.1" peewee = "==3.8.1" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index ae79449c..bce272f8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,11 +16,11 @@ "default": { "beautifulsoup4": { "hashes": [ - "sha256:6a7f5e0efc563cd1ffeefba6d528b97aa0d313c02dd126ba6c455e5fe5bd48eb", - "sha256:1ed70a0e99742653953d68462378a1a8eb65dca5f7c8fa44a05a2a0b3545df67", - "sha256:e394827904cc4923f443e8dd2e9968343669c8e1ad7a8d62d7541e780884acb8" + "sha256:ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718", + "sha256:034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", + "sha256:945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348" ], - "version": "==4.7.0" + "version": "==4.7.1" }, "certifi": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 663692a8..23365301 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.7.0 +beautifulsoup4==4.7.1 peewee==3.8.1 requests==2.21.0 From 831df8afb0f4b4465e505cb0890c5f1caa30e5da Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 14 Jan 2019 04:59:55 -0800 Subject: [PATCH 190/508] Update pytest-flake8 to 1.0.3 (#303) * Update pytest-flake8 from 1.0.2 to 1.0.3 * Update pytest-flake8 from 1.0.2 to 1.0.3 * Update pytest-flake8 from 1.0.2 to 1.0.3 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 365a8e8c..f3e7eb63 100644 --- a/Pipfile +++ b/Pipfile @@ -19,4 +19,4 @@ flake8 = "==3.6.0" pyjokes = "==0.5.0" pytest = "==4.0.2" pytest-cov = "==2.6.1" -pytest-flake8 = "==1.0.2" +pytest-flake8 = "==1.0.3" diff --git a/Pipfile.lock b/Pipfile.lock index bce272f8..eff04748 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -193,10 +193,10 @@ }, "pytest-flake8": { "hashes": [ - "sha256:4f30f5be3efb89755f38f11bdb2a5e22d19a6f5faa73428f703a3292a9572cd3", - "sha256:c740ad6aa19e3958947d2118f70bed218caf1d2097039fb7318573a2a72f89a1" + "sha256:e6a407e8effa623d839e4994799c2a4674ff46219d39533fc0afccf39af53fc1", + "sha256:b2c71fb6d469bae076a01c43d4a83485d740db6a8a00bad77e0657ed035e98d4" ], - "version": "==1.0.2" + "version": "==1.0.3" }, "six": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 327fa496..aa1ccfbb 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ flake8==3.6.0 pyjokes==0.5.0 pytest==4.0.2 pytest-cov==2.6.1 -pytest-flake8==1.0.2 +pytest-flake8==1.0.3 From d4b4c2331dc54dcd01a63d4730aa5273d93fa34b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 15 Jan 2019 23:38:43 -0800 Subject: [PATCH 191/508] Update pluggy from 0.8.0 to 0.8.1 (#301) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index eff04748..791f6713 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -142,10 +142,10 @@ }, "pluggy": { "hashes": [ - "sha256:bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f", - "sha256:447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095" + "sha256:980710797ff6a041e9a73a5787804f848996ecaa6f8a1b1e08224a5894f2074a", + "sha256:8ddc32f03971bfdf900a81961a48ccf2fb677cf7715108f85295c67405798616" ], - "version": "==0.8.0" + "version": "==0.8.1" }, "py": { "hashes": [ From 10fc39418299181ae7749fbd5fb6fd9b70240416 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 17 Jan 2019 19:47:06 -0800 Subject: [PATCH 192/508] Update pytest to 4.1.1 (#302) * Update pytest from 4.0.2 to 4.1.1 * Update pytest from 4.0.2 to 4.1.1 * Update pytest from 4.0.2 to 4.1.1 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index f3e7eb63..7a8658c8 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==4.0.2" +pytest = "==4.1.1" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.3" diff --git a/Pipfile.lock b/Pipfile.lock index 791f6713..82e57426 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -179,10 +179,10 @@ }, "pytest": { "hashes": [ - "sha256:f812ea39a0153566be53d88f8de94839db1e8a05352ed8a49525d7d7f37861e9", - "sha256:f689bf2fc18c4585403348dd56f47d87780bf217c53ed9ae7a3e2d7faa45f8e9" + "sha256:41568ea7ecb4a68d7f63837cf65b92ce8d0105e43196ff2b26622995bb3dc4b2", + "sha256:c3c573a29d7c9547fb90217ece8a8843aa0c1328a797e200290dc3d0b4b823be" ], - "version": "==4.0.2" + "version": "==4.1.1" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index aa1ccfbb..6a10f250 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 -pytest==4.0.2 +pytest==4.1.1 pytest-cov==2.6.1 pytest-flake8==1.0.3 From a466beb6c338ed34a7707df87fbd9f6d48be1a67 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 20 Jan 2019 08:12:46 -0800 Subject: [PATCH 193/508] Update peewee to 3.8.2 (#304) * Update peewee from 3.8.1 to 3.8.2 * Update peewee from 3.8.1 to 3.8.2 * Update peewee from 3.8.1 to 3.8.2 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 7a8658c8..bfc3fe4f 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.8.1" +peewee = "==3.8.2" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 82e57426..78a269e1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:c80208d6ba2191728654cb5d2e85cd58e7dcad6a2fa1807868dd984ccef2586d" + "sha256:7f8e3f512ee0d4e2d9c2008ea446d69e23c9535466367b991d452825a1ddb654" ], - "version": "==3.8.1" + "version": "==3.8.2" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 23365301..c89d819a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.8.1 +peewee==3.8.2 requests==2.21.0 From 1e28ace8f5d67ece5dd4debb9b69c041d27548a5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 24 Jan 2019 17:11:04 +0800 Subject: [PATCH 194/508] Update pyflakes from 2.0.0 to 2.1.0 --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 78a269e1..47ae4391 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -164,10 +164,10 @@ }, "pyflakes": { "hashes": [ - "sha256:f661252913bc1dbe7fcfcbf0af0db3f42ab65aabd1a6ca68fe5d466bace94dae", - "sha256:9a7662ec724d0120012f6e29d6248ae3727d821bba522a0e6b356eff19126a49" + "sha256:f277f9ca3e55de669fba45b7393a1449009cff5a37d1af10ebb76c52765269cd", + "sha256:5e8c00e30c464c99e0b501dc160b13a14af7f27d4dffb529c556e30a159e231d" ], - "version": "==2.0.0" + "version": "==2.1.0" }, "pyjokes": { "hashes": [ From 77623c43e71747ba822fef72caac8e85e171319f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 1 Feb 2019 19:35:09 -0800 Subject: [PATCH 195/508] Update pycodestyle from 2.4.0 to 2.5.0 (#306) --- Pipfile.lock | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 78a269e1..7d060113 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -156,11 +156,10 @@ }, "pycodestyle": { "hashes": [ - "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", - "sha256:74abc4e221d393ea5ce1f129ea6903209940c1ecd29e002e8c6933c2b21026e0", - "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" + "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", + "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" ], - "version": "==2.4.0" + "version": "==2.5.0" }, "pyflakes": { "hashes": [ From fbe0f83e2856141bdb1053b9699217b6c07bc0fb Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 16 Feb 2019 18:36:11 +0800 Subject: [PATCH 196/508] Fix spanish dictionary --- zdict/dictionaries/spanish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/dictionaries/spanish.py b/zdict/dictionaries/spanish.py index 5ae80cec..84341bb7 100644 --- a/zdict/dictionaries/spanish.py +++ b/zdict/dictionaries/spanish.py @@ -88,7 +88,7 @@ def query(self, word: str): content['explains'] = [] - word_element = card.find(attrs={'class': 'source-text'}) + word_element = card.find(attrs={'id': 'headword-en'}) if word_element: content['word'] = word_element.text From 4dd7f23c0b2fad58b03af1849295114ecd27c568 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 16 Feb 2019 18:38:54 +0800 Subject: [PATCH 197/508] [CircleCI] Use `pip install --user` for permission issue --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40b154f5..c668ab92 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,11 +63,11 @@ variables: - run: name: install dependencies command: | - pip install -U pip + pip install --user -U pip python3 -m venv venv . venv/bin/activate - pip install -r requirements-test.txt - pip install coveralls + pip install --user -r requirements-test.txt + pip install --user coveralls - save_cache: paths: @@ -135,11 +135,11 @@ jobs: - run: name: install dependencies command: | - pip install -U pip + pip install --user -U pip python3 -m venv venv . venv/bin/activate - pip install -r requirements-test.txt - pip install twine + pip install --user -r requirements-test.txt + pip install --user twine - save_cache: paths: From 61da3dcb5939994b2f82b51cfcd44403796bde21 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 16 Feb 2019 19:27:18 +0800 Subject: [PATCH 198/508] Version 2.0.0 - Spanish dictionary (-dt spanish) won't work anymore for zdcit < 2.0.0 - Add CircleCI - Upgrade bunch of dependencies --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index f9858b8c..29821cec 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '1.0.2' +VERSION = '2.0.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 047cfde6d8ec03f602579c370462b8d3269d70dd Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 16 Feb 2019 14:29:07 +0200 Subject: [PATCH 199/508] Update pytest to 4.2.0 (#308) This PR updates [pytest](https://pypi.org/project/pytest) from **4.1.1** to **4.2.0**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index bfc3fe4f..c7da3959 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.2" flake8 = "==3.6.0" pyjokes = "==0.5.0" -pytest = "==4.1.1" +pytest = "==4.2.0" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.3" diff --git a/Pipfile.lock b/Pipfile.lock index 72adc694..1c75b864 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -178,10 +178,10 @@ }, "pytest": { "hashes": [ - "sha256:41568ea7ecb4a68d7f63837cf65b92ce8d0105e43196ff2b26622995bb3dc4b2", - "sha256:c3c573a29d7c9547fb90217ece8a8843aa0c1328a797e200290dc3d0b4b823be" + "sha256:6ac6d467d9f053e95aaacd79f831dbecfe730f419c6c7022cb316b365cd9199d", + "sha256:65aeaa77ae87c7fc95de56285282546cfa9c886dc8e5dc78313db1c25e21bc07" ], - "version": "==4.1.1" + "version": "==4.2.0" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 6a10f250..423d4c9f 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.6.0 pyjokes==0.5.0 -pytest==4.1.1 +pytest==4.2.0 pytest-cov==2.6.1 pytest-flake8==1.0.3 From b04a05f48a7fe1523176f450bf91033dbf4cebdd Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 17 Feb 2019 18:43:59 +0200 Subject: [PATCH 200/508] Update pytest-flake8 to 1.0.4 (#309) * Update pytest-flake8 from 1.0.3 to 1.0.4 * [CircleCI] Fix `pip install` --- .circleci/config.yml | 8 ++++---- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c668ab92..97da6467 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,8 +66,8 @@ variables: pip install --user -U pip python3 -m venv venv . venv/bin/activate - pip install --user -r requirements-test.txt - pip install --user coveralls + pip install -r requirements-test.txt + pip install coveralls - save_cache: paths: @@ -138,8 +138,8 @@ jobs: pip install --user -U pip python3 -m venv venv . venv/bin/activate - pip install --user -r requirements-test.txt - pip install --user twine + pip install -r requirements-test.txt + pip install twine - save_cache: paths: diff --git a/Pipfile b/Pipfile index c7da3959..67e3dff5 100644 --- a/Pipfile +++ b/Pipfile @@ -19,4 +19,4 @@ flake8 = "==3.6.0" pyjokes = "==0.5.0" pytest = "==4.2.0" pytest-cov = "==2.6.1" -pytest-flake8 = "==1.0.3" +pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index 1c75b864..28d191e9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -192,10 +192,10 @@ }, "pytest-flake8": { "hashes": [ - "sha256:e6a407e8effa623d839e4994799c2a4674ff46219d39533fc0afccf39af53fc1", - "sha256:b2c71fb6d469bae076a01c43d4a83485d740db6a8a00bad77e0657ed035e98d4" + "sha256:d7e2b6b274a255b7ae35e9224c85294b471a83b76ecb6bd53c337ae977a499af", + "sha256:4d225c13e787471502ff94409dcf6f7927049b2ec251c63b764a4b17447b60c0" ], - "version": "==1.0.3" + "version": "==1.0.4" }, "six": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 423d4c9f..afa6e04e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ flake8==3.6.0 pyjokes==0.5.0 pytest==4.2.0 pytest-cov==2.6.1 -pytest-flake8==1.0.3 +pytest-flake8==1.0.4 From 28a4901769944a43cfa1bbb28e667ef633d0e354 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 17 Feb 2019 19:14:47 +0200 Subject: [PATCH 201/508] Update flake8 to 3.7.5 (#311) This PR updates [flake8](https://pypi.org/project/flake8) from **3.6.0** to **3.7.5**.
Changelog ### 3.7.5 ``` ------------------- You can view the `3.7.5 milestone`_ on GitLab for more details. Bugs Fixed ~~~~~~~~~~ - Fix reporting of pyflakes "referenced before assignment" error (See also `GitLab!301`_, `GitLab503`_) .. all links .. _3.7.5 milestone: https://gitlab.com/pycqa/flake8/milestones/28 .. issue links .. _GitLab503: https://gitlab.com/pycqa/flake8/issues/503 .. merge request links .. _GitLab!301: https://gitlab.com/pycqa/flake8/merge_requests/301 ``` ### 3.7.4 ``` ------------------- You can view the `3.7.4 milestone`_ on GitLab for more details. Bugs Fixed ~~~~~~~~~~ - Fix performance regression with lots of ``per-file-ignores`` and errors (See also `GitLab!299`_, `GitLab501`_) .. all links .. _3.7.4 milestone: https://gitlab.com/pycqa/flake8/milestones/27 .. issue links .. _GitLab501: https://gitlab.com/pycqa/flake8/issues/501 .. merge request links .. _GitLab!299: https://gitlab.com/pycqa/flake8/merge_requests/299 ``` ### 3.7.3 ``` ------------------- You can view the `3.7.3 milestone`_ on GitLab for more details. Bugs Fixed ~~~~~~~~~~ - Fix imports of ``typing`` in python 3.5.0 / 3.5.1 (See also `GitLab!294`_, `GitLab498`_) - Fix ``flake8 --statistics`` (See also `GitLab!295`_, `GitLab499`_) - Gracefully ignore ``flake8-per-file-ignores`` plugin if installed (See also `GitLab!297`_, `GitLab495`_) - Improve error message for malformed ``per-file-ignores`` (See also `GitLab!298`_, `GitLab489`_) .. all links .. _3.7.3 milestone: https://gitlab.com/pycqa/flake8/milestones/26 .. issue links .. _GitLab489: https://gitlab.com/pycqa/flake8/issues/489 .. _GitLab495: https://gitlab.com/pycqa/flake8/issues/495 .. _GitLab498: https://gitlab.com/pycqa/flake8/issues/498 .. _GitLab499: https://gitlab.com/pycqa/flake8/issues/499 .. merge request links .. _GitLab!294: https://gitlab.com/pycqa/flake8/merge_requests/294 .. _GitLab!295: https://gitlab.com/pycqa/flake8/merge_requests/295 .. _GitLab!297: https://gitlab.com/pycqa/flake8/merge_requests/297 .. _GitLab!298: https://gitlab.com/pycqa/flake8/merge_requests/298 ``` ### 3.7.2 ``` ------------------- You can view the `3.7.2 milestone`_ on GitLab for more details. Bugs Fixed ~~~~~~~~~~ - Fix broken ``flake8 --diff`` (regressed in 3.7.0) (See also `GitLab!292`_, `GitLab490`_) - Fix typo in plugin exception reporting (See also `GitLab!275`_, `GitLab491`_) - Fix ``AttributeError`` while attempting to use the legacy api (regressed in 3.7.0) (See also `GitLab!293`_, `GitLab497`_) .. all links .. _3.7.2 milestone: https://gitlab.com/pycqa/flake8/milestones/25 .. issue links .. _GitLab490: https://gitlab.com/pycqa/flake8/issues/490 .. _GitLab491: https://gitlab.com/pycqa/flake8/issues/491 .. _GitLab497: https://gitlab.com/pycqa/flake8/issues/497 .. merge request links .. _GitLab!292: https://gitlab.com/pycqa/flake8/merge_requests/292 .. _GitLab!275: https://gitlab.com/pycqa/flake8/merge_requests/275 .. _GitLab!293: https://gitlab.com/pycqa/flake8/merge_requests/293 ``` ### 3.7.1 ``` ------------------- You can view the `3.7.1 milestone`_ on GitLab for more details. Bugs Fixed ~~~~~~~~~~ - Fix capitalized filenames in ``per-file-ignores`` setting (See also `GitLab!290`_, `GitLab488`_) .. all links .. _3.7.1 milestone: https://gitlab.com/pycqa/flake8/milestones/24 .. issue links .. _GitLab488: https://gitlab.com/pycqa/flake8/issues/488 .. merge request links .. _GitLab!290: https://gitlab.com/pycqa/flake8/merge_requests/290 ``` ### 3.7.0 ``` ------------------- You can view the `3.7.0 milestone`_ on GitLab for more details. New Dependency Information ~~~~~~~~~~~~~~~~~~~~~~~~~~ - Add dependency on ``entrypoints`` >= 0.3, < 0.4 (See also `GitLab!264`_, `GitLab!288`_) - Pyflakes has been updated to >= 2.1.0, < 2.2.0 (See also `GitLab!283`_, `GitLab!285`_) - pycodestyle has been updated to >= 2.5.0, < 2.6.0 (See also `GitLab!287`_) Features ~~~~~~~~ - Add support for ``per-file-ignores`` (See also `GitLab!259`_, `GitLab156`_, `GitLab!281`_, `GitLab471`_) - Enable use of ``float`` and ``complex`` option types (See also `GitLab!261`_, `GitLab452`_) - Improve startup performance by switching from ``pkg_resources`` to ``entrypoints`` (See also `GitLab!264`_) - Add metadata for use through the `pre-commit`_ git hooks framework (See also `GitLab!268`_, `GitLab!284`_) - Allow physical line checks to return more than one result (See also `GitLab!269`_) - Allow `` noqa:X123`` comments without space between the colon and codes list (See also `GitLab!273`_, `GitLab470`_) - Remove broken and unused ``flake8.listen`` plugin type (See also `GitLab!274`_, `GitLab480`_) .. all links .. _3.7.0 milestone: https://gitlab.com/pycqa/flake8/milestones/23 .. _pre-commit: https://pre-commit.com/ .. issue links .. _GitLab156: https://gitlab.com/pycqa/flake8/issues/156 .. _GitLab452: https://gitlab.com/pycqa/flake8/issues/452 .. _GitLab470: https://gitlab.com/pycqa/flake8/issues/470 .. _GitLab471: https://gitlab.com/pycqa/flake8/issues/471 .. _GitLab480: https://gitlab.com/pycqa/flake8/issues/480 .. merge request links .. _GitLab!259: https://gitlab.com/pycqa/flake8/merge_requests/259 .. _GitLab!261: https://gitlab.com/pycqa/flake8/merge_requests/261 .. _GitLab!264: https://gitlab.com/pycqa/flake8/merge_requests/264 .. _GitLab!268: https://gitlab.com/pycqa/flake8/merge_requests/268 .. _GitLab!269: https://gitlab.com/pycqa/flake8/merge_requests/269 .. _GitLab!273: https://gitlab.com/pycqa/flake8/merge_requests/273 .. _GitLab!274: https://gitlab.com/pycqa/flake8/merge_requests/274 .. _GitLab!281: https://gitlab.com/pycqa/flake8/merge_requests/281 .. _GitLab!283: https://gitlab.com/pycqa/flake8/merge_requests/283 .. _GitLab!284: https://gitlab.com/pycqa/flake8/merge_requests/284 .. _GitLab!285: https://gitlab.com/pycqa/flake8/merge_requests/285 .. _GitLab!287: https://gitlab.com/pycqa/flake8/merge_requests/287 .. _GitLab!288: https://gitlab.com/pycqa/flake8/merge_requests/288 ```
Links - PyPI: https://pypi.org/project/flake8 - Changelog: https://pyup.io/changelogs/flake8/ - Repo: https://gitlab.com/pycqa/flake8
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 67e3dff5..36cc1205 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ requests = "==2.21.0" [dev-packages] coverage = "==4.5.2" -flake8 = "==3.6.0" +flake8 = "==3.7.5" pyjokes = "==0.5.0" pytest = "==4.2.0" pytest-cov = "==2.6.1" diff --git a/Pipfile.lock b/Pipfile.lock index 28d191e9..1b06e1e2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -120,10 +120,10 @@ }, "flake8": { "hashes": [ - "sha256:c01f8a3963b3571a8e6bd7a4063359aff90749e160778e03817cd9b71c9e07d2", - "sha256:6a35f5b8761f45c5513e3405f110a86bea57982c3b75b766ce7b65217abe1670" + "sha256:c3ba1e130c813191db95c431a18cb4d20a468e98af7a77e2181b68574481ad36", + "sha256:fd9ddf503110bf3d8b1d270e8c673aab29ccb3dd6abf29bae1f54e5116ab4a91" ], - "version": "==3.6.0" + "version": "==3.7.5" }, "mccabe": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index afa6e04e..5c8aab17 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==4.5.2 -flake8==3.6.0 +flake8==3.7.5 pyjokes==0.5.0 pytest==4.2.0 pytest-cov==2.6.1 From 2ef1cd60840e44104d328858a356552c65ba1098 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 17 Feb 2019 19:46:23 +0200 Subject: [PATCH 202/508] Update more-itertools to 6.0.0 (#312) This PR updates [more-itertools](https://pypi.org/project/more-itertools) from **5.0.0** to **6.0.0**.
Changelog ### 6.0.0 ``` This is the first Python 3-only release. Python 2 users may use [version 5.0.0](https://github.com/erikrose/more-itertools/releases/tag/5.0.0). See [the release notes](https://github.com/erikrose/more-itertools/blob/e36eeebc9d01d2dbbe232880741e88585a95bf7d/docs/versions.rst600) for the full list of changes. ```
Links - PyPI: https://pypi.org/project/more-itertools - Changelog: https://pyup.io/changelogs/more-itertools/ - Repo: https://github.com/erikrose/more-itertools - Docs: https://pythonhosted.org/more-itertools/
--- Pipfile.lock | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 1b06e1e2..a19c4f86 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -134,11 +134,10 @@ }, "more-itertools": { "hashes": [ - "sha256:c0a5785b1109a6bd7fac76d6837fd1feca158e54e521ccd2ae8bfe393cc9d4fc", - "sha256:fe7a7cae1ccb57d33952113ff4fa1bc5f879963600ed74918f1236e212ee50b9", - "sha256:38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4" + "sha256:0125e8f60e9e031347105eb1682cef932f5e97d7b9a1a28d9bf00c22a5daef40", + "sha256:590044e3942351a1bdb1de960b739ff4ce277960f2425ad4509446dbace8d9d1" ], - "version": "==5.0.0" + "version": "==6.0.0" }, "pluggy": { "hashes": [ From d4fcdca67928350e90b272959ecfe05dfbaa6d56 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 17 Feb 2019 20:16:59 +0200 Subject: [PATCH 203/508] Update pytest to 4.2.1 (#313) * Update pytest from 4.1.1 to 4.2.1 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 36cc1205..b4a0e061 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.2" flake8 = "==3.7.5" pyjokes = "==0.5.0" -pytest = "==4.2.0" +pytest = "==4.2.1" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index a19c4f86..1a285a92 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:6ac6d467d9f053e95aaacd79f831dbecfe730f419c6c7022cb316b365cd9199d", - "sha256:65aeaa77ae87c7fc95de56285282546cfa9c886dc8e5dc78313db1c25e21bc07" + "sha256:80cfd9c8b9e93f419abcc0400e9f595974a98e44b6863a77d3e1039961bfc9c4", + "sha256:c2396a15726218a2dfef480861c4ba37bd3952ebaaa5b0fede3fc23fddcd7f8c" ], - "version": "==4.2.0" + "version": "==4.2.1" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 5c8aab17..f83d3be9 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.7.5 pyjokes==0.5.0 -pytest==4.2.0 +pytest==4.2.1 pytest-cov==2.6.1 pytest-flake8==1.0.4 From e9f5b7d3ab1637b2806a42ea7570cf9337ed6733 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 20 Feb 2019 06:52:59 +0200 Subject: [PATCH 204/508] Update flake8 to 3.7.6 (#316) * Update flake8 from 3.7.5 to 3.7.6 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index b4a0e061..590feb0a 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ requests = "==2.21.0" [dev-packages] coverage = "==4.5.2" -flake8 = "==3.7.5" +flake8 = "==3.7.6" pyjokes = "==0.5.0" pytest = "==4.2.1" pytest-cov = "==2.6.1" diff --git a/Pipfile.lock b/Pipfile.lock index 1a285a92..fcb2b559 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -120,10 +120,10 @@ }, "flake8": { "hashes": [ - "sha256:c3ba1e130c813191db95c431a18cb4d20a468e98af7a77e2181b68574481ad36", - "sha256:fd9ddf503110bf3d8b1d270e8c673aab29ccb3dd6abf29bae1f54e5116ab4a91" + "sha256:6d8c66a65635d46d54de59b027a1dda40abbe2275b3164b634835ac9c13fd048", + "sha256:6eab21c6e34df2c05416faa40d0c59963008fff29b6f0ccfe8fa28152ab3e383" ], - "version": "==3.7.5" + "version": "==3.7.6" }, "mccabe": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index f83d3be9..e79cd415 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==4.5.2 -flake8==3.7.5 +flake8==3.7.6 pyjokes==0.5.0 pytest==4.2.1 pytest-cov==2.6.1 From 46c6be46a2533dfc7f569b101bbe2a18f0e40bf9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 20 Feb 2019 07:46:05 +0200 Subject: [PATCH 205/508] Update pytest to 4.3.0 (#317) * Update pytest from 4.2.1 to 4.3.0 * Update pytest from 4.2.1 to 4.3.0 * Update pytest from 4.2.1 to 4.3.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 590feb0a..ec8f1d76 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.2" flake8 = "==3.7.6" pyjokes = "==0.5.0" -pytest = "==4.2.1" +pytest = "==4.3.0" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index fcb2b559..943df8cc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:80cfd9c8b9e93f419abcc0400e9f595974a98e44b6863a77d3e1039961bfc9c4", - "sha256:c2396a15726218a2dfef480861c4ba37bd3952ebaaa5b0fede3fc23fddcd7f8c" + "sha256:067a1d4bf827ffdd56ad21bd46674703fce77c5957f6c1eef731f6146bfcef1c", + "sha256:9687049d53695ad45cf5fdc7bbd51f0c49f1ea3ecfc4b7f3fde7501b541f17f4" ], - "version": "==4.2.1" + "version": "==4.3.0" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index e79cd415..1e35d32d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.2 flake8==3.7.6 pyjokes==0.5.0 -pytest==4.2.1 +pytest==4.3.0 pytest-cov==2.6.1 pytest-flake8==1.0.4 From c6bb90ca80e55041b50381f4491d20d26b59dad8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 23 Feb 2019 21:48:42 +0200 Subject: [PATCH 206/508] Update py from 1.7.0 to 1.8.0 (#318) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 943df8cc..183f24ba 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -148,10 +148,10 @@ }, "py": { "hashes": [ - "sha256:e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6", - "sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694" + "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", + "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" ], - "version": "==1.7.0" + "version": "==1.8.0" }, "pycodestyle": { "hashes": [ From 40b13d66117a7dd9602e0ec8a16ae21baed24a15 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 25 Feb 2019 11:25:38 +0200 Subject: [PATCH 207/508] Update pluggy from 0.8.1 to 0.9.0 (#319) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 183f24ba..bd66614b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -141,10 +141,10 @@ }, "pluggy": { "hashes": [ - "sha256:980710797ff6a041e9a73a5787804f848996ecaa6f8a1b1e08224a5894f2074a", - "sha256:8ddc32f03971bfdf900a81961a48ccf2fb677cf7715108f85295c67405798616" + "sha256:19ecf9ce9db2fce065a7a0586e07cfb4ac8614fe96edf628a264b1c70116cf8f", + "sha256:84d306a647cc805219916e62aab89caa97a33a1dd8c342e87a37f91073cd4746" ], - "version": "==0.8.1" + "version": "==0.9.0" }, "py": { "hashes": [ From 5087e57ccd88fa98b6a2488cedd99319d2c069a9 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 04:20:33 +0800 Subject: [PATCH 208/508] [#315] Fix bug for querying spanish word of spanish dict --- zdict/dictionaries/spanish.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/zdict/dictionaries/spanish.py b/zdict/dictionaries/spanish.py index 84341bb7..0ab9c5e4 100644 --- a/zdict/dictionaries/spanish.py +++ b/zdict/dictionaries/spanish.py @@ -69,14 +69,6 @@ def query(self, word: str): data = BeautifulSoup(webpage, "html.parser") content = {} - # word can be existing in both English & Spanish - # choose English to Spanish here - # 'translat-en' for English to Spanish - # 'translat-es' for Spanish to English - translate_en = data.find('div', id='translate-es') - if translate_en: - data = translate_en - card = data.find('div', attrs={'class': 'card'}) entry = card.find( # just get the first one @@ -88,9 +80,14 @@ def query(self, word: str): content['explains'] = [] - word_element = card.find(attrs={'id': 'headword-en'}) - if word_element: - content['word'] = word_element.text + # word can be existing in both English & Spanish + word_element = ( + card.find(attrs={'id': 'headword-en'}) + or card.find(attrs={'id': 'headword-es'}) + ) + if word_element is None: + raise NotFoundError(word) + content['word'] = word_element.text pattern1 = {'class': 'dictionary-neodict-indent-1'} pattern2 = {'class': 'dictionary-neodict-indent-2'} From 468d2a87472e21cfb48dce1ecca92510d603e7c4 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 04:21:29 +0800 Subject: [PATCH 209/508] [#315] Add unit test for spanish word 'tranquilo' of spanish dict Also use real cls.not_found_word, not using Mock anymore. --- zdict/tests/dictionaries/test_spanish.py | 43 ++++++++++++++++-------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/zdict/tests/dictionaries/test_spanish.py b/zdict/tests/dictionaries/test_spanish.py index a378f187..a8f51697 100644 --- a/zdict/tests/dictionaries/test_spanish.py +++ b/zdict/tests/dictionaries/test_spanish.py @@ -1,5 +1,5 @@ from pytest import raises -from unittest.mock import Mock, patch +from unittest.mock import patch from zdict.dictionaries.spanish import SpanishDict from zdict.exceptions import NotFoundError @@ -10,14 +10,20 @@ class TestSpanishDict: @classmethod def setup_class(cls): cls.dict = SpanishDict(get_args()) - cls.word = 'Spanish' - cls.record = cls.dict.query(cls.word) + cls.en_word = 'Spanish' + cls.en_record = cls.dict.query(cls.en_word) + cls.es_word = 'tranquilo' + cls.es_record = cls.dict.query(cls.es_word) + cls.not_found_word = 'asdfsdf' @classmethod def teardown_class(cls): del cls.dict - del cls.word - del cls.record + del cls.en_word + del cls.en_record + del cls.es_word + del cls.es_record + del cls.not_found_word def test_provider(self): assert self.dict.provider == 'spanish' @@ -26,24 +32,33 @@ def test_title(self): assert self.dict.title == 'SpanishDict' def test__get_url(self): - url = 'http://www.spanishdict.com/translate/{}'.format(self.word) - assert url == self.dict._get_url(self.word) + url = 'http://www.spanishdict.com/translate/{}'.format(self.en_word) + assert url == self.dict._get_url(self.en_word) + + url = 'http://www.spanishdict.com/translate/{}'.format(self.es_word) + assert url == self.dict._get_url(self.es_word) def test_show(self): # god bless this method, hope that it do not raise any exception - self.dict.show(self.record) + self.dict.show(self.en_record) + self.dict.show(self.es_record) @patch('zdict.dictionaries.spanish.Record') def test_query_normal(self, Record): - self.dict.query(self.word) + self.dict.query(self.en_word) + Record.assert_called_with( + word=self.en_word, + content=self.en_record.content, + source='spanish', + ) + + self.dict.query(self.es_word) Record.assert_called_with( - word=self.word, - content=self.record.content, + word=self.es_word, + content=self.es_record.content, source='spanish', ) def test_query_not_found(self): - self.dict._get_raw = Mock(return_value='
') with raises(NotFoundError): - self.dict.query(self.word) - self.dict._get_raw.assert_called_with(self.word) + self.dict.query(self.not_found_word) From 37a0df95151f40ebcf83b9ac5dbaaccd1776e4e7 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 04:22:44 +0800 Subject: [PATCH 210/508] [Makefile] Add `make test` for running tests --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 80b2a6d7..52be8d84 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ clean-vim-swap-files: clean: clean-pyc clean-vim-swap-files rm -rf build dist htmlcov .coverage* .cache .eggs +test: + python setup.py test + # Make docker-zdict don't complain about no make rules for apple, bird, ... %: @: From a660c77f18b07c58390a7e6fbdb7fac5941da9b9 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 04:33:49 +0800 Subject: [PATCH 211/508] [#314] Fix not found word for urban dictionary --- zdict/dictionaries/urban.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zdict/dictionaries/urban.py b/zdict/dictionaries/urban.py index 4206ae69..719f2372 100644 --- a/zdict/dictionaries/urban.py +++ b/zdict/dictionaries/urban.py @@ -45,8 +45,9 @@ def show(self, record: Record): def query(self, word: str): content = self._get_raw(word) + content = json.loads(content) - if "no_results" in content: + if content['list'] == []: raise NotFoundError(word) record = Record( From d74cd770d17061c1e2fa5cc802fd7e691425d6ff Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 25 Feb 2019 23:08:56 +0200 Subject: [PATCH 212/508] Update flake8 to 3.7.7 (#320) This PR updates [flake8](https://pypi.org/project/flake8) from **3.7.6** to **3.7.7**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index ec8f1d76..a1b53e8d 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ requests = "==2.21.0" [dev-packages] coverage = "==4.5.2" -flake8 = "==3.7.6" +flake8 = "==3.7.7" pyjokes = "==0.5.0" pytest = "==4.3.0" pytest-cov = "==2.6.1" diff --git a/Pipfile.lock b/Pipfile.lock index bd66614b..7c6ca116 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -120,10 +120,10 @@ }, "flake8": { "hashes": [ - "sha256:6d8c66a65635d46d54de59b027a1dda40abbe2275b3164b634835ac9c13fd048", - "sha256:6eab21c6e34df2c05416faa40d0c59963008fff29b6f0ccfe8fa28152ab3e383" + "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", + "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" ], - "version": "==3.7.6" + "version": "==3.7.7" }, "mccabe": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 1e35d32d..1a11dc39 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==4.5.2 -flake8==3.7.6 +flake8==3.7.7 pyjokes==0.5.0 pytest==4.3.0 pytest-cov==2.6.1 From bd9f24ca87d95f814dccf80c05ca451b194cc77f Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 05:16:41 +0800 Subject: [PATCH 213/508] [#314] Fix bug of non-existing words for urban dict --- zdict/dictionaries/urban.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zdict/dictionaries/urban.py b/zdict/dictionaries/urban.py index 719f2372..c811bec7 100644 --- a/zdict/dictionaries/urban.py +++ b/zdict/dictionaries/urban.py @@ -44,15 +44,15 @@ def show(self, record: Record): print() def query(self, word: str): - content = self._get_raw(word) - content = json.loads(content) + content_str = self._get_raw(word) + content_dict = json.loads(content_str) - if content['list'] == []: + if content_dict['list'] == []: raise NotFoundError(word) record = Record( word=word, - content=content, + content=content_str, source=self.provider, ) From 1002be240f56711651e66eaaa3dd9731a55cff38 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 05:17:22 +0800 Subject: [PATCH 214/508] [#314] Add unit test for non-existing words for urban dict Use real query for test_query_not_found() and test_query_normal() --- zdict/tests/dictionaries/test_urban.py | 56 ++++++++++---------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/zdict/tests/dictionaries/test_urban.py b/zdict/tests/dictionaries/test_urban.py index e36a4fe9..1a88de0f 100644 --- a/zdict/tests/dictionaries/test_urban.py +++ b/zdict/tests/dictionaries/test_urban.py @@ -1,18 +1,25 @@ from pytest import raises -from unittest.mock import Mock, patch +from unittest.mock import patch from zdict.dictionaries.urban import UrbanDict from zdict.exceptions import NotFoundError -from zdict.models import Record from zdict.zdict import get_args class TestUrbanDict: - def setup_method(self, method): - self.dict = UrbanDict(get_args()) - - def teardown_method(self, method): - del self.dict + @classmethod + def setup_class(cls): + cls.dict = UrbanDict(get_args()) + cls.not_found_word = 'some_not_existing_word' + cls.word = 'urban' + cls.record = cls.dict.query(cls.word) + + @classmethod + def teardown_class(cls): + del cls.dict + del cls.not_found_word + del cls.word + del cls.record def test_provider(self): assert self.dict.provider == 'urban' @@ -21,40 +28,19 @@ def test__get_url(self): uri = 'http://api.urbandictionary.com/v0/define?term=mock' assert self.dict._get_url('mock') == uri - def test_query_notfound(self): - notfound_payload = ''' - {"tags":[],"result_type":"no_results","list":[],"sounds":[]} - ''' - self.dict._get_raw = Mock(return_value=notfound_payload) - + def test_query_not_found(self): with raises(NotFoundError): - self.dict.query('mock') - - self.dict._get_raw.assert_called_with('mock') + self.dict.query(self.not_found_word) @patch('zdict.dictionaries.urban.Record') def test_query_normal(self, Record): - self.dict._get_raw = Mock(return_value='{"mock": true}') - self.dict.query('mock') + self.dict.query(self.word) Record.assert_called_with( - word='mock', - content='{"mock": true}', - source='urban' + word=self.word, + content=self.record.content, + source='urban', ) def test_show(self): - content = ''' - { - "list": [ - { - "word": "mock", - "definition": "Mock", - "example": "..." - } - ] - } - ''' - r = Record(word='mock', content=content, source='urban') - # god bless this method, hope that it do not raise any exception - self.dict.show(r) + self.dict.show(self.record) From 80566bc70838403d7c6e0a789a626824260ef4e2 Mon Sep 17 00:00:00 2001 From: shunyi Date: Tue, 26 Feb 2019 05:45:03 +0800 Subject: [PATCH 215/508] [New Version] 2.0.1 + Feature + Fix bug of spanish dict (#315) + Dependency + Update pytest to 4.2.0 (#308) + Update pytest-flake8 to 1.0.4 (#309) + Update flake8 to 3.7.5 (#311) + Update more-itertools to 6.0.0 (#312) + Update pytest to 4.2.1 (#313) + Update flake8 to 3.7.6 (#316) + Update pytest to 4.3.0 (#317) + Update py from 1.7.0 to 1.8.0 (#318) + Update pluggy from 0.8.1 to 0.9.0 (#319) + Update flake8 to 3.7.7 (#320) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 29821cec..8ec88eef 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.0.0' +VERSION = '2.0.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 5e378c24e832f5be0d64a54281218a51b700b182 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 26 Feb 2019 13:00:03 +0800 Subject: [PATCH 216/508] [New Version] 2.0.2 + Feature + Fix bug of Urban dict (#314) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 8ec88eef..76fe0463 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.0.1' +VERSION = '2.0.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 80655b7563577455de0bc65229b06b33a995d841 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 26 Feb 2019 13:21:04 +0800 Subject: [PATCH 217/508] [CircleCI] Remove type: approval for deploy job --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 97da6467..40b4d804 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,6 @@ workflows: tags: only: /.*/ - deploy: - type: approval requires: - linux-python-3.7 - linux-python-3.6 From 84a53ab05ff7275f168ef1a7d056ecf811834b1c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 1 Mar 2019 09:49:31 +0800 Subject: [PATCH 218/508] Update pyflakes from 2.1.0 to 2.1.1 --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 7c6ca116..7140ec48 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -162,10 +162,10 @@ }, "pyflakes": { "hashes": [ - "sha256:f277f9ca3e55de669fba45b7393a1449009cff5a37d1af10ebb76c52765269cd", - "sha256:5e8c00e30c464c99e0b501dc160b13a14af7f27d4dffb529c556e30a159e231d" + "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", + "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" ], - "version": "==2.1.0" + "version": "==2.1.1" }, "pyjokes": { "hashes": [ From 61f39bd9eeb3bbd3f5b2530d86808607609f1ffe Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 3 Mar 2019 22:24:38 +0800 Subject: [PATCH 219/508] Update attrs from 18.2.0 to 19.1.0 --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 7140ec48..ca9305d9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -67,10 +67,10 @@ "develop": { "attrs": { "hashes": [ - "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb", - "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69" + "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", + "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" ], - "version": "==18.2.0" + "version": "==19.1.0" }, "coverage": { "hashes": [ From ecbcf7ab7a24e2b308000b00bb4b6d101b7b846a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 6 Mar 2019 13:17:41 +0800 Subject: [PATCH 220/508] Update peewee from 3.8.2 to 3.9.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c89d819a..3bf32061 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.8.2 +peewee==3.9.0 requests==2.21.0 From ac6ba092d6153c65d0472188efe1f49f578fdd62 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 6 Mar 2019 13:17:43 +0800 Subject: [PATCH 221/508] Update peewee from 3.8.2 to 3.9.0 --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index a1b53e8d..488cb564 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.8.2" +peewee = "==3.9.0" requests = "==2.21.0" From 97677602a82dcb02c41bb7566e233cae250c1dae Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 6 Mar 2019 13:17:44 +0800 Subject: [PATCH 222/508] Update peewee from 3.8.2 to 3.9.0 --- Pipfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index ca9305d9..016a18b1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:7f8e3f512ee0d4e2d9c2008ea446d69e23c9535466367b991d452825a1ddb654" + "sha256:a2e7c8fac33a221ab1a7780fad2a39859f67f4cda9668c105a06027cc5d75c73" ], - "version": "==3.8.2" + "version": "==3.9.0" }, "requests": { "hashes": [ From e73e4da184e915c2f65b2a150ca29a55ef5d478e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 6 Mar 2019 21:47:43 +0800 Subject: [PATCH 223/508] Update peewee from 3.9.0 to 3.9.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3bf32061..bf07365d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.9.0 +peewee==3.9.1 requests==2.21.0 From e4515a7ceb0525d5af8ef671b5c8a9b6c961d2e7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 6 Mar 2019 21:47:45 +0800 Subject: [PATCH 224/508] Update peewee from 3.9.0 to 3.9.1 --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 488cb564..96ecaa80 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.9.0" +peewee = "==3.9.1" requests = "==2.21.0" From 43a2735431b26d7bba885eec22a0742c2a1307bf Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 6 Mar 2019 21:47:46 +0800 Subject: [PATCH 225/508] Update peewee from 3.9.0 to 3.9.1 --- Pipfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 016a18b1..5d8fc096 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:a2e7c8fac33a221ab1a7780fad2a39859f67f4cda9668c105a06027cc5d75c73" + "sha256:072b934cc6b832eaa9cf39ac98e9c9d454cabb3b234ff2f20698f8ad1b4278b1" ], - "version": "==3.9.0" + "version": "==3.9.1" }, "requests": { "hashes": [ From 6f900cbb39e6e8fee53b83a59af673988c983a0a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 8 Mar 2019 06:38:10 +0200 Subject: [PATCH 226/508] Update peewee to 3.9.2 (#327) * Update peewee from 3.9.1 to 3.9.2 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 96ecaa80..04f4e182 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.9.1" +peewee = "==3.9.2" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 5d8fc096..9d1e0d89 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:072b934cc6b832eaa9cf39ac98e9c9d454cabb3b234ff2f20698f8ad1b4278b1" + "sha256:074331625cf4335a27af3a8f644eabe2858cd3fc91fa95a7f18db16bd640f7cc" ], - "version": "==3.9.1" + "version": "==3.9.2" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index bf07365d..1ea93f5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.9.1 +peewee==3.9.2 requests==2.21.0 From a9feccc56d8dc07a1059dde3053fd3ab25aad38e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 10 Mar 2019 06:12:01 +0200 Subject: [PATCH 227/508] Update certifi to 2019.3.9 (#328) This PR updates [certifi](https://pypi.org/project/certifi) from **2018.11.29** to **2019.3.9**. *The bot wasn't able to find a changelog for this release. [Got an idea?](https://github.com/pyupio/changelogs/issues/new)*
Links - PyPI: https://pypi.org/project/certifi - Homepage: https://certifi.io/
--- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 9d1e0d89..807f0a91 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -24,10 +24,10 @@ }, "certifi": { "hashes": [ - "sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033", - "sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7" + "sha256:59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5", + "sha256:b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae" ], - "version": "==2018.11.29" + "version": "==2019.3.9" }, "chardet": { "hashes": [ From 8def7dada715bee878da5d2079f034ecf7a08f36 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 11 Mar 2019 20:21:18 +0200 Subject: [PATCH 228/508] Update coverage to 4.5.3 (#329) This PR updates [coverage](https://pypi.org/project/coverage) from **4.5.2** to **4.5.3**. --- Pipfile | 2 +- Pipfile.lock | 86 +++++++++++++++++++++---------------------- requirements-test.txt | 2 +- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Pipfile b/Pipfile index 04f4e182..64540b98 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ requests = "==2.21.0" [dev-packages] -coverage = "==4.5.2" +coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" pytest = "==4.3.0" diff --git a/Pipfile.lock b/Pipfile.lock index 807f0a91..b48da92a 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -74,49 +74,49 @@ }, "coverage": { "hashes": [ - "sha256:a5c58664b23b248b16b96253880b2868fb34358911400a7ba39d7f6399935389", - "sha256:b3b0c8f660fae65eac74fbf003f3103769b90012ae7a460863010539bb7a80da", - "sha256:8cb4febad0f0b26c6f62e1628f2053954ad2c555d67660f28dfb1b0496711952", - "sha256:447c450a093766744ab53bf1e7063ec82866f27bcb4f4c907da25ad293bba7e3", - "sha256:1b4276550b86caa60606bd3572b52769860a81a70754a54acc8ba789ce74d607", - "sha256:6694d5573e7790a0e8d3d177d7a416ca5f5c150742ee703f3c18df76260de794", - "sha256:510986f9a280cd05189b42eee2b69fecdf5bf9651d4cd315ea21d24a964a3c36", - "sha256:09e47c529ff77bf042ecfe858fb55c3e3eb97aac2c87f0349ab5a7efd6b3939f", - "sha256:5535dda5739257effef56e49a1c51c71f1d37a6e5607bb25a5eee507c59580d1", - "sha256:0a1f9b0eb3aa15c990c328535655847b3420231af299386cfe5efc98f9c250fe", - "sha256:0cc941b37b8c2ececfed341444a456912e740ecf515d560de58b9a76562d966d", - "sha256:da969da069a82bbb5300b59161d8d7c8d423bc4ccd3b410a9b4d8932aeefc14b", - "sha256:6831e1ac20ac52634da606b658b0b2712d26984999c9d93f0c6e59fe62ca741b", - "sha256:5f55028169ef85e1fa8e4b8b1b91c0b3b0fa3297c4fb22990d46ff01d22c2d6c", - "sha256:10e8af18d1315de936d67775d3a814cc81d0747a1a0312d84e27ae5610e313b0", - "sha256:2b224052bfd801beb7478b03e8a66f3f25ea56ea488922e98903914ac9ac930b", - "sha256:77f0d9fa5e10d03aa4528436e33423bfa3718b86c646615f04616294c935f840", - "sha256:5a7524042014642b39b1fcae85fb37556c200e64ec90824ae9ecf7b667ccfc14", - "sha256:85a06c61598b14b015d4df233d249cd5abfa61084ef5b9f64a48e997fd829a82", - "sha256:ed02c7539705696ecb7dc9d476d861f3904a8d2b7e894bd418994920935d36bb", - "sha256:aaa0f296e503cda4bc07566f592cd7a28779d433f3a23c48082af425d6d5a78f", - "sha256:1e8a2627c48266c7b813975335cfdea58c706fe36f607c97d9392e61502dc79d", - "sha256:46101fc20c6f6568561cdd15a54018bb42980954b79aa46da8ae6f008066a30e", - "sha256:ee5b8abc35b549012e03a7b1e86c09491457dba6c94112a2482b18589cc2bdb9", - "sha256:c45297bbdbc8bb79b02cf41417d63352b70bcb76f1bbb1ee7d47b3e89e42f95d", - "sha256:d64b4340a0c488a9e79b66ec9f9d77d02b99b772c8b8afd46c1294c1d39ca478", - "sha256:828ad813c7cdc2e71dcf141912c685bfe4b548c0e6d9540db6418b807c345ddd", - "sha256:d19bca47c8a01b92640c614a9147b081a1974f69168ecd494687c827109e8f42", - "sha256:4710dc676bb4b779c4361b54eb308bc84d64a2fa3d78e5f7228921eccce5d815", - "sha256:bab8e6d510d2ea0f1d14f12642e3f35cefa47a9b2e4c7cea1852b52bc9c49647", - "sha256:ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4", - "sha256:99bd767c49c775b79fdcd2eabff405f1063d9d959039c0bdd720527a7738748a", - "sha256:71afc1f5cd72ab97330126b566bbf4e8661aab7449f08895d21a5d08c6b051ff", - "sha256:06123b58a1410873e22134ca2d88bd36680479fe354955b3579fb8ff150e4d27", - "sha256:7349c27128334f787ae63ab49d90bf6d47c7288c63a0a5dfaa319d4b4541dd2c", - "sha256:869ef4a19f6e4c6987e18b315721b8b971f7048e6eaea29c066854242b4e98d9", - "sha256:859714036274a75e6e57c7bab0c47a4602d2a8cfaaa33bbdb68c8359b2ed4f5c", - "sha256:0d34245f824cc3140150ab7848d08b7e2ba67ada959d77619c986f2062e1f0e8", - "sha256:977e2d9a646773cc7428cdd9a34b069d6ee254fadfb4d09b3f430e95472f3cf3", - "sha256:3ad59c84c502cd134b0088ca9038d100e8fb5081bbd5ccca4863f3804d81f61d", - "sha256:258b21c5cafb0c3768861a6df3ab0cfb4d8b495eee5ec660e16f928bf7385390" - ], - "version": "==4.5.2" + "sha256:0c5fe441b9cfdab64719f24e9684502a59432df7570521563d7b1aff27ac755f", + "sha256:2b412abc4c7d6e019ce7c27cbc229783035eef6d5401695dccba80f481be4eb3", + "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", + "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", + "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", + "sha256:42692db854d13c6c5e9541b6ffe0fe921fe16c9c446358d642ccae1462582d3b", + "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", + "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", + "sha256:4ec30ade438d1711562f3786bea33a9da6107414aed60a5daa974d50a8c2c351", + "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", + "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", + "sha256:6899797ac384b239ce1926f3cb86ffc19996f6fa3a1efbb23cb49e0c12d8c18c", + "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", + "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", + "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", + "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", + "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", + "sha256:8e679d1bde5e2de4a909efb071f14b472a678b788904440779d2c449c0355b27", + "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", + "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", + "sha256:93f965415cc51604f571e491f280cff0f5be35895b4eb5e55b47ae90c02a497b", + "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", + "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", + "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", + "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", + "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", + "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", + "sha256:a9abc8c480e103dc05d9b332c6cc9fb1586330356fc14f1aa9c0ca5745097d19", + "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", + "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", + "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", + "sha256:c22ab9f96cbaff05c6a84e20ec856383d27eae09e511d3e6ac4479489195861d", + "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", + "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", + "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", + "sha256:ca58eba39c68010d7e87a823f22a081b5290e3e3c64714aac3c91481d8b34d22", + "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", + "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", + "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", + "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", + "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" + ], + "version": "==4.5.3" }, "flake8": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 1a11dc39..69eabf0d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==4.5.2 +coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 pytest==4.3.0 From fff0bf5c84666f8296c4a39b2bb3ca99659be5cf Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 14 Mar 2019 03:25:36 +0200 Subject: [PATCH 229/508] Update pytest to 4.3.1 (#330) This PR updates [pytest](https://pypi.org/project/pytest) from **4.3.0** to **4.3.1**. --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 64540b98..1baa72bc 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.3.0" +pytest = "==4.3.1" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index b48da92a..2219193a 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:067a1d4bf827ffdd56ad21bd46674703fce77c5957f6c1eef731f6146bfcef1c", - "sha256:9687049d53695ad45cf5fdc7bbd51f0c49f1ea3ecfc4b7f3fde7501b541f17f4" + "sha256:592eaa2c33fae68c7d75aacf042efc9f77b27c08a6224a4f59beab8d9a420523", + "sha256:ad3ad5c450284819ecde191a654c09b0ec72257a2c711b9633d677c71c9850c4" ], - "version": "==4.3.0" + "version": "==4.3.1" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 69eabf0d..b3a15037 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.3.0 +pytest==4.3.1 pytest-cov==2.6.1 pytest-flake8==1.0.4 From 4a17d8e76a0a738404d3f7a73b12291b025c187b Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 21 Mar 2019 15:49:05 +0800 Subject: [PATCH 230/508] [#331] Should include requirements-test.txt in tarball for PyPI --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 042676ab..cb44862e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ include *.py -include *requirements.txt +include requirements*.txt From 25259fc962e120ab1b0705946f80647b10d09c15 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 21 Mar 2019 16:02:40 +0800 Subject: [PATCH 231/508] [CI] `pip install wheel` for `python setup.py bdist_wheel` Otherwise we will get the error: "invalid command 'bdist_wheel'" --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40b4d804..d2ea1686 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -157,6 +157,7 @@ jobs: name: create packages command: | . venv/bin/activate + pip install wheel python setup.py sdist python setup.py bdist_wheel From 6fbfadd35e4a4b7783f2ed2e0a23eba3825fc99b Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 21 Mar 2019 16:03:43 +0800 Subject: [PATCH 232/508] Version 2.0.3 - [#331] Should include requirements-test.txt in tarball for PyPI - Update bunch of dependencies --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 76fe0463..e55de99a 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.0.2' +VERSION = '2.0.3' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 2247fd5da150a5ff7baf2db6e263f2c2732ffdb7 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 22 Mar 2019 02:54:26 +0800 Subject: [PATCH 233/508] [#331] Add example for `export LC_ALL` for user --- zdict/zdict.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zdict/zdict.py b/zdict/zdict.py index f71a910a..7b1a8140 100644 --- a/zdict/zdict.py +++ b/zdict/zdict.py @@ -18,12 +18,14 @@ def user_set_encoding_and_is_utf8(): except ValueError: print("Didn't detect your LC_ALL environment variable.") print("Please export LC_ALL with some UTF-8 encoding.") + print("For example: `export LC_ALL=en_US.UTF-8`") return False else: if enc != "UTF-8": print("zdict only works with encoding=UTF-8, ") print("but your encoding is: {} {}".format(lang, enc)) print("Please export LC_ALL with some UTF-8 encoding.") + print("For example: `export LC_ALL=en_US.UTF-8`") return False return True From 7fd7e48adaa2a318dc344bec0ee64e6635f580a2 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Fri, 22 Mar 2019 15:38:19 +0800 Subject: [PATCH 234/508] Version 2.0.4 - [#331] Add example for `export LC_ALL` for user --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index e55de99a..1ee7f36f 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.0.3' +VERSION = '2.0.4' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 016ab4d0377b96b4c0cc0ea648310c7d6f067571 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 24 Mar 2019 16:09:04 +0200 Subject: [PATCH 235/508] Update peewee to 3.9.3 (#332) This PR updates [peewee](https://pypi.org/project/peewee) from **3.9.2** to **3.9.3**.
Changelog ### 3.9.3 ``` * Added cross-database support for `NULLS FIRST/LAST` when specifying the ordering for a query. Previously this was only supported for Postgres. Peewee will now generate an equivalent `CASE` statement for Sqlite and MySQL. * Added [EXCLUDED](http://docs.peewee-orm.com/en/latest/peewee/api.htmlEXCLUDED) helper for referring to the `EXCLUDED` namespace used with `INSERT...ON CONFLICT` queries, when referencing values in the conflicting row data. * Added helper method to the model `Metadata` class for setting the table name at run-time. Setting the `Model._meta.table_name` directly may have appeared to work in some situations, but could lead to subtle bugs. The new API is `Model._meta.set_table_name()`. * Enhanced helpers for working with Peewee interactively, [see doc](http://docs.peewee-orm.com/en/latest/peewee/interactive.html). * Fix cache invalidation bug in `DataSet` that was originally reported on the sqlite-web project. * New example script implementing a [hexastore](https://github.com/coleifer/peewee/blob/master/examples/hexastore.py). [View commits](https://github.com/coleifer/peewee/compare/3.9.2...3.9.3) ```
--- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 1baa72bc..3dcb4a1b 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.9.2" +peewee = "==3.9.3" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 2219193a..5e2092ff 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:074331625cf4335a27af3a8f644eabe2858cd3fc91fa95a7f18db16bd640f7cc" + "sha256:603337153536b85c3c5b5e84df4ae0f9cbaff09163a3739451d167e0ad3fe1f7" ], - "version": "==3.9.2" + "version": "==3.9.3" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 1ea93f5b..ef4fefb8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.9.2 +peewee==3.9.3 requests==2.21.0 From a19af28d3478dafb3f51eb0ffaaaedbbb243aeaa Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 27 Mar 2019 19:39:23 +0800 Subject: [PATCH 236/508] [Makefile] Add .PHONY --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 52be8d84..a289a58d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +.PHONY: docker-zdict docker-run docker-pull docker-push docker-build clean-pyc clean-vim-swap-files clean test + docker-zdict: # Let users can use `make docker-zdict apple bird` # https://stackoverflow.com/questions/6273608 From 9a31ebb83fb1d775e7a97440087c30f4bf6be927 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 28 Mar 2019 17:57:25 +0200 Subject: [PATCH 237/508] Update more-itertools to 7.0.0 (#333) This PR updates [more-itertools](https://pypi.org/project/more-itertools) from **6.0.0** to **7.0.0**.
Changelog ### 7.0.0 ``` See [the release notes](https://github.com/erikrose/more-itertools/blob/7fcf148de6482484298796553fccbf9ccfd31516/docs/versions.rst) for the full list of changes. ```
Links - PyPI: https://pypi.org/project/more-itertools - Changelog: https://pyup.io/changelogs/more-itertools/ - Repo: https://github.com/erikrose/more-itertools - Docs: https://pythonhosted.org/more-itertools/
--- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 5e2092ff..657188f0 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -134,10 +134,10 @@ }, "more-itertools": { "hashes": [ - "sha256:0125e8f60e9e031347105eb1682cef932f5e97d7b9a1a28d9bf00c22a5daef40", - "sha256:590044e3942351a1bdb1de960b739ff4ce277960f2425ad4509446dbace8d9d1" + "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", + "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" ], - "version": "==6.0.0" + "version": "==7.0.0" }, "pluggy": { "hashes": [ From 7ba45e7f05d8f62da413e1443cba36dcd50445e1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2019 00:21:58 -0700 Subject: [PATCH 238/508] Update pytest from 4.3.1 to 4.4.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 3dcb4a1b..be99303b 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.3.1" +pytest = "==4.4.0" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index 657188f0..bfc7b93c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:592eaa2c33fae68c7d75aacf042efc9f77b27c08a6224a4f59beab8d9a420523", - "sha256:ad3ad5c450284819ecde191a654c09b0ec72257a2c711b9633d677c71c9850c4" + "sha256:13c5e9fb5ec5179995e9357111ab089af350d788cbc944c628f3cde72285809b", + "sha256:f21d2f1fb8200830dcbb5d8ec466a9c9120e20d8b53c7585d180125cce1d297a" ], - "version": "==4.3.1" + "version": "==4.4.0" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index b3a15037..ff85a71f 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.3.1 +pytest==4.4.0 pytest-cov==2.6.1 pytest-flake8==1.0.4 From ef0f93fc874af9c1446cd8628e6e5d64bdb4a0de Mon Sep 17 00:00:00 2001 From: shunyi Date: Thu, 4 Apr 2019 18:01:00 +0800 Subject: [PATCH 239/508] [CI] Travis CI: Fix pyenv compilation for pyenv 1.2.10 --- ci/install_python_for_osx.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci/install_python_for_osx.sh b/ci/install_python_for_osx.sh index 5e9d145a..6aea8ff3 100755 --- a/ci/install_python_for_osx.sh +++ b/ci/install_python_for_osx.sh @@ -1,6 +1,17 @@ #!/usr/bin/sh +set -ev + curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash -~/.pyenv/bin/pyenv install $PYTHON_VERSION -~/.pyenv/versions/$PYTHON_VERSION/bin/python3 --version + +# print openssl path +brew --prefix openssl@1.1 + +# Install specific version of Python via pyenv +LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" \ +CPPFLAGS="-I$(brew --prefix openssl@1.1)/include" \ +CFLAGS="-I$(brew --prefix openssl@1.1)/include" \ +~/.pyenv/bin/pyenv install -v $PYTHON_VERSION + +# Create venv with the specific Python version ~/.pyenv/versions/$PYTHON_VERSION/bin/python3 -m venv ~/venv From d490bd8b627d8c8f14fbac7cdf421d58479f5e8d Mon Sep 17 00:00:00 2001 From: shunyi Date: Thu, 4 Apr 2019 18:05:55 +0800 Subject: [PATCH 240/508] [CI] Travis CI: Update test python version for OSX --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e3040ef..2125e2ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,19 @@ jobs: - stage: test os: osx language: generic - env: PYTHON_VERSION=3.4.8 + env: PYTHON_VERSION=3.4.9 - stage: test os: osx language: generic - env: PYTHON_VERSION=3.5.5 + env: PYTHON_VERSION=3.5.6 - stage: test os: osx language: generic - env: PYTHON_VERSION=3.6.4 - + env: PYTHON_VERSION=3.6.8 + - stage: test + os: osx + language: generic + env: PYTHON_VERSION=3.7.2 before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi From da6fdae4a5dd64c9dbd6072541d44b22a3693b86 Mon Sep 17 00:00:00 2001 From: shunyi Date: Thu, 4 Apr 2019 18:06:40 +0800 Subject: [PATCH 241/508] [CI] Travis CI: deal with non-block stdout first And check if running with specific Python version later. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2125e2ac..84df1525 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,12 +23,12 @@ jobs: env: PYTHON_VERSION=3.7.2 before_install: - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then source ~/venv/bin/activate; fi - # workaround for Travis CI stdout write error # ref: - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then source ~/venv/bin/activate; fi + - python --version # Check the specifically installed Python version install: - "pip install -U setuptools" # for upgrade issue with setuptools and CPython 3.6 on Travis CI From 946500cb27ef3601f9d0d41eea8d2ceab1510641 Mon Sep 17 00:00:00 2001 From: shunyi Date: Thu, 4 Apr 2019 18:16:20 +0800 Subject: [PATCH 242/508] [CI] Travis CI: Remove openssl@1.1 for homebrew Make it use openssl only. The root cause is this PR of pyenv merged 3 days ago: It didn't handle properly when user installed openssl and openssl@1.1 both via homebrew. Which makes user encounter these errors: ``` *** WARNING: renaming "_ssl" since importing it failed: dlopen(build/lib.macosx-10.13-x86_64-3.4/_ssl.so, 2): Symbol not found: _CRYPTO_THREADID_set_callback ``` ``` Failed to build these modules: _hashlib _ssl ``` Because `_ssl` has been renamed, it can not been found while installing pip, which makes the build fail. --- ci/install_python_for_osx.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/install_python_for_osx.sh b/ci/install_python_for_osx.sh index 6aea8ff3..b4e0424b 100755 --- a/ci/install_python_for_osx.sh +++ b/ci/install_python_for_osx.sh @@ -4,13 +4,13 @@ set -ev curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash +# Make it use openssl only +brew uninstall openssl@1.1 + # print openssl path -brew --prefix openssl@1.1 +brew --prefix openssl # Install specific version of Python via pyenv -LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" \ -CPPFLAGS="-I$(brew --prefix openssl@1.1)/include" \ -CFLAGS="-I$(brew --prefix openssl@1.1)/include" \ ~/.pyenv/bin/pyenv install -v $PYTHON_VERSION # Create venv with the specific Python version From 09e7b197a70443d3bfa04aec7190a12e99d0dfde Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Fri, 5 Apr 2019 19:25:27 +0800 Subject: [PATCH 243/508] [#115] Add iTaigi (#334) * [utils] Fixed bug of color.print() when color is empty string * [template] Change BeautifulSoup variable name from data to soup * [template] Add self.args.verbose for verbose mode * [#115] Add basic mode for iTaigi * [#115] Add verbose mode for iTaigi Show example sentences if possible. * [#115] Change color set for iTaigi - mandarin: lyellow - chinese: normal - taiwanese: lwhite * Add tests template for new dictionary So new contirbutor could add new dictionary more easily. * Make test_template.py become docstirng To pass py.test. * Fix E501 for itaigi * Update test_template for test_query_verbose() * [#115] Add tests for iTaigi * [#115] Display order: mandarin, chinese, taiwanese Change display order for sentences. Better UX, since order is same as word translation showing order. * [#115] Update README for iTaigi * [#115] Fix verbose mode for iTaigi Should show related_word not basic word. Copied and pasted but forgot to modify the variable name. * Change print() to self.color.print() So we can make sure that this is not some debugging code which is forgotten to be deleted. * [utils] Make self.color.print() works Set default string to ''. and adjust the related unit test. * [#115] Fix bug for no related_words for showing If there's no related word, the content['related_words'] would be `[]`. So the show function for related words would be fine. * [#115] Remove debug code * [#115] Remove redundent empty line between self imports * [#115] Use contextlib.suppress So we only need three lines for these try-except sentences. ref: * [#115] Fix screenshots in README for iTaigi --- README.rst | 12 +- setup.cfg | 1 + zdict/dictionaries/itaigi.py | 193 ++++++++++++++++++++++ zdict/dictionaries/template.py | 6 +- zdict/tests/dictionaries/test_itaigi.py | 87 ++++++++++ zdict/tests/dictionaries/test_template.py | 102 ++++++++++++ zdict/tests/test_utils.py | 4 +- zdict/utils.py | 7 +- 8 files changed, 402 insertions(+), 10 deletions(-) create mode 100644 zdict/dictionaries/itaigi.py create mode 100644 zdict/tests/dictionaries/test_itaigi.py create mode 100644 zdict/tests/dictionaries/test_template.py diff --git a/README.rst b/README.rst index fd57a053..985260c9 100644 --- a/README.rst +++ b/README.rst @@ -88,7 +88,7 @@ Usage :: usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt spanish,yandex,moe,moe-taiwanese,yahoo,wiktionary,urban,jisho,oxford,all] + [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,wiktionary,urban,yandex,all] [-ld] [-V] [-c] [--dump [PATTERN]] [-D] [word [word ...]] @@ -108,7 +108,7 @@ Usage the number of CPUs in the system. -sp, --show-provider Show the dictionary provider of the queried word -su, --show-url Show the url of the queried word - -dt spanish,yandex,moe,moe-taiwanese,yahoo,wiktionary,urban,jisho,oxford,all, --dict spanish,yandex,moe,moe-taiwanese,yahoo,wiktionary,urban,jisho,oxford,all + -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,wiktionary,urban,yandex,all Must be seperated by comma and no spaces after each comma. Choose the dictionary you want. (default: yahoo) Use 'all' for qureying all dictionaries. If @@ -203,6 +203,14 @@ To use this source, you should first `apply `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: https://user-images.githubusercontent.com/1645228/55309799-656acd00-5491-11e9-9d79-4ae578c83f8b.jpg + +.. image:: https://user-images.githubusercontent.com/1645228/55309820-7582ac80-5491-11e9-998d-51ebfb183375.jpg + + Development & Contributing --------------------------- diff --git a/setup.cfg b/setup.cfg index 419c739b..87b43585 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,6 +3,7 @@ addopts = --flake8 -v --cov zdict --cov-report html --cov-report term --junitxml flake8-ignore = zdict/__init__.py F401 zdict/dictionaries/template.py F401 F841 + zdict/tests/dictionaries/test_template.py E501 # F401 - module imported but unused # F841 - local variable name is assigned to but never used diff --git a/zdict/dictionaries/itaigi.py b/zdict/dictionaries/itaigi.py new file mode 100644 index 00000000..281a8122 --- /dev/null +++ b/zdict/dictionaries/itaigi.py @@ -0,0 +1,193 @@ +import json +from contextlib import suppress + +import requests +from bs4 import BeautifulSoup + +from zdict.dictionary import DictBase +from zdict.exceptions import NotFoundError +from zdict.models import Record + + +class iTaigiDict(DictBase): + + API = 'https://itaigi.tw/平臺項目列表/揣列表?關鍵字={word}' + + @property + def provider(self): + return 'itaigi' + + @property + def title(self): + return 'iTaigi - 愛台語' + + def _get_url(self, word) -> str: + return self.API.format(word=word) + + def _get_word_text(self, word) -> str: + try: + text = word["文本資料"] + except AttributeError: + raise + return text + + def _get_word_pronounce(self, word) -> str: + try: + pronounce = word["音標資料"] + except AttributeError: + raise + return pronounce + + def _get_word_sentences(self, text, pronounce) -> dict: + API = ( + "https://xn--fsqx9h.xn--v0qr21b.xn--kpry57d/%E7%9C%8B/" + "?%E6%BC%A2%E5%AD%97={text}&%E8%87%BA%E7%BE%85={pronounce}" + ) + url = API.format(text=text, pronounce=pronounce) + + try: + _ = json.loads(requests.get(url).text) + except Exception: + return {} + + mandarin_sentence = None + with suppress(KeyError, IndexError): + mandarin_sentence = _["例句"][0]["華語"] + + chinese_sentence = None + with suppress(KeyError, IndexError): + chinese_sentence = _["例句"][0]["漢字"] + + taiwanese_sentence = None + with suppress(KeyError, IndexError): + taiwanese_sentence = _["例句"][0]["臺羅"] + + d = { + 'mandarin': mandarin_sentence, + 'chinese': chinese_sentence, + 'taiwanese': taiwanese_sentence, + } + return d + + def query(self, word: str): + webpage = self._get_raw(word) + soup = BeautifulSoup(webpage, "html.parser") + response = json.loads(soup.text) + + # Not Found + if not response.get("列表"): + raise NotFoundError(word) + + # Show Chinese word from iTaigi in stead of user input if possible + with suppress(KeyError, IndexError): + word = response["列表"][0]["外語資料"] + + content = {} + + # Fetch basic words with text, pronounce and sentence + try: + basic_words = response["列表"][0]["新詞文本"] + except Exception: + raise + else: + content['basic_words'] = [] + for basic_word in basic_words: + d = {} + + text = self._get_word_text(basic_word) + d['text'] = text + + pronounce = self._get_word_pronounce(basic_word) + d['pronounce'] = pronounce + + if self.args.verbose: + sentences = self._get_word_sentences(text, pronounce) + d['sentences'] = sentences + + content['basic_words'].append(d) + + # Fetch related words + try: + related_words = response["其他建議"] + except Exception: + raise + else: + content['related_words'] = [] + for related_word in related_words: + d = {} + + text = self._get_word_text(related_word) + d['text'] = text + + pronounce = self._get_word_pronounce(related_word) + d['pronounce'] = pronounce + + if self.args.verbose: + sentences = self._get_word_sentences(text, pronounce) + d['sentences'] = sentences + + content['related_words'].append(d) + + # Save content with word and provider. + record = Record( + word=word, + content=json.dumps(content), + source=self.provider, + ) + + return record + + def _show_word_sentences(self, word): + if not word.get('sentences'): + return + if not any(word['sentences'].values()): + return + + self.color.print('例句', color='lred', indent=4) + + if word['sentences']['mandarin']: + self.color.print( + word['sentences']['mandarin'], color='lyellow', indent=6, + ) + if word['sentences']['chinese']: + self.color.print(word['sentences']['chinese'], indent=6) + + if word['sentences']['taiwanese']: + self.color.print( + word['sentences']['taiwanese'], color='lwhite', indent=6, + ) + + self.color.print() + + def show(self, record: Record): + ''' + color set: + - mandarin: lyellow + - chinese: normal + - taiwanese: lwhite + ''' + content = json.loads(record.content) + + # print the word we looked up + self.color.print(record.word, 'lyellow') + + # print basic_words + if content.get('basic_words'): + for basic_word in content['basic_words']: + self.color.print(basic_word['text'], end=' ', indent=2) + self.color.print(basic_word['pronounce'], 'lwhite') + + if self.args.verbose: + self._show_word_sentences(basic_word) + + # print related_words if possible + if content.get('related_words'): + self.color.print() + self.color.print("相關字詞", 'lred', indent=2) + + for related_word in content['related_words']: + self.color.print(related_word['text'], end=' ', indent=4) + self.color.print(related_word['pronounce'], 'lwhite') + + if self.args.verbose: + self._show_word_sentences(related_word) diff --git a/zdict/dictionaries/template.py b/zdict/dictionaries/template.py index 360654d5..aa946448 100644 --- a/zdict/dictionaries/template.py +++ b/zdict/dictionaries/template.py @@ -46,7 +46,7 @@ def show(self, record: Record): def query(self, word: str): webpage = self._get_raw(word) - data = BeautifulSoup(webpage, "html.parser") + soup = BeautifulSoup(webpage, "html.parser") content = {} # Parse `data` and fill the information you need into `content` @@ -58,6 +58,10 @@ def query(self, word: str): # ``` # while the word users try to query is not found on this dictionary. + if self.args.verbose: + # For verbose mode + pass + record = Record( word=word, content=json.dumps(content), diff --git a/zdict/tests/dictionaries/test_itaigi.py b/zdict/tests/dictionaries/test_itaigi.py new file mode 100644 index 00000000..33d9996c --- /dev/null +++ b/zdict/tests/dictionaries/test_itaigi.py @@ -0,0 +1,87 @@ +from pytest import raises +from unittest.mock import Mock, patch + +from zdict.exceptions import NotFoundError +from zdict.zdict import get_args +from zdict.dictionaries.itaigi import iTaigiDict + + +class TestiTaigiDict: + @classmethod + def setup_class(cls): + cls.dict = iTaigiDict(get_args()) + + cls.words = ['芭樂', '測試'] + + # Setup normal query data + cls.dict.args.verbose = False + cls.records = [cls.dict.query(word) for word in cls.words] + + # Setup verbose query data + cls.dict.args.verbose = True + cls.verbose_records = [cls.dict.query(word) for word in cls.words] + + # Change back to default verbose config + cls.dict.args.verbose = False + + @classmethod + def teardown_class(cls): + del cls.dict + del cls.words + del cls.records + del cls.verbose_records + + def test_provider(self): + assert self.dict.provider == 'itaigi' + + def test_title(self): + assert self.dict.title == 'iTaigi - 愛台語' + + def test__get_url(self): + # Change url for the new dict and delete this comment + url = 'https://itaigi.tw/平臺項目列表/揣列表?關鍵字=芭樂' + assert url == self.dict._get_url('芭樂') + + def test_show(self): + # god bless this method, hope that it do not raise any exception + self.dict.args.verbose = False + + for record in self.records: + self.dict.show(record) + + def test_show_verbose(self): + # god bless this method, hope that it do not raise any exception + self.dict.args.verbose = True + + for record in self.verbose_records: + self.dict.show(record) + + @patch('zdict.dictionaries.itaigi.Record') + def test_query_normal(self, Record): + self.dict.args.verbose = False + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.records[i].content, + source='itaigi', + ) + + @patch('zdict.dictionaries.itaigi.Record') + def test_query_verbose(self, Record): + self.dict.args.verbose = True + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.verbose_records[i].content, + source='itaigi', + ) + + def test_query_not_found(self): + self.dict._get_raw = Mock(return_value='{"列表": []}') + with raises(NotFoundError): + self.dict.query(self.words[0]) + self.dict._get_raw.assert_called_with(self.words[0]) diff --git a/zdict/tests/dictionaries/test_template.py b/zdict/tests/dictionaries/test_template.py new file mode 100644 index 00000000..a44b0a4c --- /dev/null +++ b/zdict/tests/dictionaries/test_template.py @@ -0,0 +1,102 @@ +''' +from pytest import raises +from unittest.mock import Mock, patch + +from zdict.exceptions import NotFoundError +from zdict.zdict import get_args + +# Change TemplateDict to the class of new dictionary and delete this comment +from zdict.dictionaries.template import TemplateDict + + +# Change TemplateDict to the class of new dictionary and delete this comment +class TestTemplateDict: + @classmethod + def setup_class(cls): + # Change `Template` to the name of the new dict and delete this comment + cls.dict = TemplateDict(get_args()) + + # You may want to change words to some certain test cases. + cls.words = ['style', 'metadata'] + + # Setup normal query data + cls.dict.args.verbose = False + cls.records = [cls.dict.query(word) for word in cls.words] + + # Setup verbose query data + cls.dict.args.verbose = True + cls.verbose_records = [cls.dict.query(word) for word in cls.words] + + # Change back to default verbose config + cls.dict.args.verbose = False + + @classmethod + def teardown_class(cls): + del cls.dict + del cls.words + del cls.records + del cls.verbose_records + + def test_provider(self): + # Change `template` to the provider of the new dict and delete this comment + assert self.dict.provider == 'template' + + def test_title(self): + # Change `Template Dictionary` to the title of the new dict and delete this comment + assert self.dict.title == 'Template Dictionary' + + def test__get_url(self): + # Change url for the new dict and delete this comment + url = 'https://tw.dictionary.search.yahoo.com/search?p=test' + assert url == self.dict._get_url('test') + + def test_show(self): + # god bless this method, hope that it do not raise any exception + self.dict.args.verbose = False + + for record in self.records: + self.dict.show(record) + + def test_show_verbose(self): + # god bless this method, hope that it do not raise any exception + self.dict.args.verbose = True + + for record in self.verbose_records: + self.dict.show(record) + + # Change `template` to `{newdict}` for the line below and delete this comment + @patch('zdict.dictionaries.template.Record') + def test_query_normal(self, Record): + self.dict.args.verbose = False + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.records[i].content, + # Change `template` to the source for the new dictionary and delete this comment + source='template', + ) + + # Change `template` to `{newdict}` for the line below and delete this comment + @patch('zdict.dictionaries.template.Record') + def test_query_verbose(self, Record): + self.dict.args.verbose = True + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.verbose_records[i].content, + # Change `template` to `{newdict}` for the line below and delete this comment + source='template', + ) + + def test_query_not_found(self): + # Trigger NotFoundError intentionally and see if it works. + self.dict._get_raw = Mock(return_value='None') + with raises(NotFoundError): + self.dict.query(self.words[0]) + + # Add other test functions for private functions of the new dictionary class +''' diff --git a/zdict/tests/test_utils.py b/zdict/tests/test_utils.py index ed84445d..8dff3107 100644 --- a/zdict/tests/test_utils.py +++ b/zdict/tests/test_utils.py @@ -28,8 +28,8 @@ def test_format_not_tty(self, isatty): assert ' test' == self.color.format('test', 'red', indent=2) assert isatty.called - def test_format_none(self): - assert self.color.format(None) is None + def test_format_default_s(self): + assert self.color.format('') == '' def test_attribute(self): self.color.red = '\33[31m' diff --git a/zdict/utils.py b/zdict/utils.py index 88a22b77..8cc787f3 100644 --- a/zdict/utils.py +++ b/zdict/utils.py @@ -39,7 +39,7 @@ def __getattr__(cls, color): http://stackoverflow.com/questions/3155436 ''' d = dict(cls.COLOR_LIST) - color = color.upper() + color = color.upper() if color else 'ORG' _color = color if color[0] != 'L' else color[1:] if _color not in d.keys(): @@ -61,7 +61,7 @@ def set_force_color(cls, force_color=True): cls._force_color = force_color @classmethod - def format(self, s, color='org', indent=0): + def format(self, s='', color='org', indent=0): ''' :type s: str :param s: message @@ -71,9 +71,6 @@ def format(self, s, color='org', indent=0): If stdout isn't a tty, the color option will be ignored. ''' - if s is None: - return - colorize = self._force_color or sys.stdout.isatty() return '{indent}{color}{s}{org}'.format( From b6d3f17b1b4a779caffa1c1095fcdc022c2e83ac Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 6 Apr 2019 16:06:23 +0800 Subject: [PATCH 244/508] [New Version] 2.1.0 - Dependencies - Update peewee to 3.9.3 (#332) - Update more-itertools to 7.0.0 (#333) - Update pytest from 4.3.1 to 4.4.0 (#335) - CI - Fix Travis CI for pyenv 1.2.10 - New Feature - [#115] Add iTaigi (#334) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 1ee7f36f..78e8eb2a 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.0.4' +VERSION = '2.1.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 5eeecaa26c939577be02cc814bf633e24fc6833d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 15 Apr 2019 21:50:06 +0200 Subject: [PATCH 245/508] Update peewee to 3.9.4 (#336) This PR updates [peewee](https://pypi.org/project/peewee) from **3.9.3** to **3.9.4**.
Changelog ### 3.9.4 ``` * Add `Model.bulk_update()` method for bulk-updating fields across multiple model instances. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.htmlModel.bulk_update). * Add `lazy_load` parameter to `ForeignKeyField`. When initialized with `lazy_load=False`, the foreign-key will not use an additional query to resolve the related model instance. Instead, if the related model instance is not available, the underlying FK column value is returned (behaving like the "_id" descriptor). * Added `Model.truncate_table()` method. * The `reflection` and `pwiz` extensions now attempt to be smarter about converting database table and column names into snake-case. To disable this, you can set `snake_case=False` when calling the `Introspector.introspect()` method or use the `-L` (legacy naming) option with the `pwiz` script. * Bulk insert via ``insert_many()`` no longer require specification of the fields argument when the inserted rows are lists/tuples. In that case, the fields will be inferred to be all model fields except any auto-increment id. * Add `DatabaseProxy`, which implements several of the `Database` class context managers. This allows you to reference some of the special features of the database object without directly needing to initialize the proxy first. * Add support for window function frame exclusion and added built-in support for the GROUPS frame type. * Add support for chaining window functions by extending a previously-declared window function. * Playhouse Postgresql extension `TSVectorField.match()` method supports an additional argument `plain`, which can be used to control the parsing of the TS query. * Added very minimal `JSONField` to the playhouse MySQL extension. [View commits](https://github.com/coleifer/peewee/compare/3.9.3...3.9.4) ```
Links - PyPI: https://pypi.org/project/peewee - Changelog: https://pyup.io/changelogs/peewee/ - Repo: https://github.com/coleifer/peewee/
--- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index be99303b..406a0998 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.9.3" +peewee = "==3.9.4" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index bfc7b93c..0b3e9f8b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:603337153536b85c3c5b5e84df4ae0f9cbaff09163a3739451d167e0ad3fe1f7" + "sha256:92f5a20ff90d46f1f78e8d53d461061ef0ee192d7a7880efd41894b86fa4762d" ], - "version": "==3.9.3" + "version": "==3.9.4" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index ef4fefb8..6c79767b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.9.3 +peewee==3.9.4 requests==2.21.0 From 4fe6dec904c1bdf0f899bbad5127e0893a4587e9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 15 Apr 2019 22:55:06 +0200 Subject: [PATCH 246/508] Update pytest to 4.4.1 (#337) This PR updates [pytest](https://pypi.org/project/pytest) from **4.4.0** to **4.4.1**.
Changelog ### 4.4.1 ``` ========================= Bug Fixes --------- - `5031 <https://github.com/pytest-dev/pytest/issues/5031>`_: Environment variables are properly restored when using pytester's ``testdir`` fixture. - `5039 <https://github.com/pytest-dev/pytest/issues/5039>`_: Fix regression with ``--pdbcls``, which stopped working with local modules in 4.0.0. - `5092 <https://github.com/pytest-dev/pytest/issues/5092>`_: Produce a warning when unknown keywords are passed to ``pytest.param(...)``. - `5098 <https://github.com/pytest-dev/pytest/issues/5098>`_: Invalidate import caches with ``monkeypatch.syspath_prepend``, which is required with namespace packages being used. ```
Links - PyPI: https://pypi.org/project/pytest - Changelog: https://pyup.io/changelogs/pytest/ - Homepage: https://docs.pytest.org/en/latest/
--- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 406a0998..9c9e4cc9 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.4.0" +pytest = "==4.4.1" pytest-cov = "==2.6.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index 0b3e9f8b..693507aa 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:13c5e9fb5ec5179995e9357111ab089af350d788cbc944c628f3cde72285809b", - "sha256:f21d2f1fb8200830dcbb5d8ec466a9c9120e20d8b53c7585d180125cce1d297a" + "sha256:3773f4c235918987d51daf1db66d51c99fac654c81d6f2f709a046ab446d5e5d", + "sha256:b7802283b70ca24d7119b32915efa7c409982f59913c1a6c0640aacf118b95f5" ], - "version": "==4.4.0" + "version": "==4.4.1" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index ff85a71f..2c2ab8c7 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.4.0 +pytest==4.4.1 pytest-cov==2.6.1 pytest-flake8==1.0.4 From 7d1652fe776a620f6a4b53dba55ad1926efe017d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 18 Apr 2019 23:33:46 +0200 Subject: [PATCH 247/508] Update urllib3 to 1.24.2 (#338) This PR updates [urllib3](https://pypi.org/project/urllib3) from **1.24.1** to **1.24.2**. --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 693507aa..0c075be9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", - "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" + "sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0", + "sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3" ], - "version": "==1.24.1" + "version": "==1.24.2" } }, "develop": { From 8556392e60e05c9631ffb74aaa977857f40b6571 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 23 Apr 2019 01:00:00 +0200 Subject: [PATCH 248/508] Update urllib3 to 1.25 (#339) This PR updates [urllib3](https://pypi.org/project/urllib3) from **1.24.2** to **1.25**.
Changelog ### 1.25 ``` ----------------- * Require and validate certificates by default when using HTTPS (Pull 1507) * Upgraded ``urllib3.utils.parse_url()`` to be RFC 3986 compliant. (Pull 1487) * Added support for ``key_password`` for ``HTTPSConnectionPool`` to use encrypted ``key_file`` without creating your own ``SSLContext`` object. (Pull 1489) * Add TLSv1.3 support to CPython, pyOpenSSL, and SecureTransport ``SSLContext`` implementations. (Pull 1496) * Switched the default multipart header encoder from RFC 2231 to HTML 5 working draft. (Issue 303, PR 1492) * Fixed issue where OpenSSL would block if an encrypted client private key was given and no password was given. Instead an ``SSLError`` is raised. (Pull 1489) * Added support for Brotli content encoding. It is enabled automatically if ``brotlipy`` package is installed which can be requested with ``urllib3[brotli]`` extra. (Pull 1532) * Drop ciphers using DSS key exchange from default TLS cipher suites. Improve default ciphers when using SecureTransport. (Pull 1496) * Implemented a more efficient ``HTTPResponse.__iter__()`` method. (Issue 1483) ```
Links - PyPI: https://pypi.org/project/urllib3 - Changelog: https://pyup.io/changelogs/urllib3/ - Docs: https://urllib3.readthedocs.io/
--- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 0c075be9..4cc74664 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0", - "sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3" + "sha256:a08afe8b057ba35963364711a1f36d346375da0c118f611f35c0252375338c7c", + "sha256:f03eeb431c77b88cf8747d47e94233a91d0e0fdae1cf09e0b21405a885700266" ], - "version": "==1.24.2" + "version": "==1.25" } }, "develop": { From a54cb77084c6140be6bf243d61a5dcdda4d7435a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 27 Apr 2019 09:11:18 +0200 Subject: [PATCH 249/508] Update urllib3 to 1.25.1 (#340) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 4cc74664..5ea9a767 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:a08afe8b057ba35963364711a1f36d346375da0c118f611f35c0252375338c7c", - "sha256:f03eeb431c77b88cf8747d47e94233a91d0e0fdae1cf09e0b21405a885700266" + "sha256:904bd981d6371bb95a200c0ec9dba5ba7cc980f2d6b125bd793fefe3293be388", + "sha256:a9645efd62b9fc1c7cad8ed93e162aad4c6bfd90e143966ddd4099b78cd244be" ], - "version": "==1.25" + "version": "==1.25.1" } }, "develop": { From 4dad9ef8dec477add92893520984bb9846ffdd11 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 27 Apr 2019 09:11:43 +0200 Subject: [PATCH 250/508] Update peewee to 3.9.5 (#341) * Update peewee from 3.9.4 to 3.9.5 --- Pipfile | 2 +- Pipfile.lock | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 9c9e4cc9..a707b840 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.9.4" +peewee = "==3.9.5" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 5ea9a767..64b46382 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -45,9 +45,9 @@ }, "peewee": { "hashes": [ - "sha256:92f5a20ff90d46f1f78e8d53d461061ef0ee192d7a7880efd41894b86fa4762d" + "sha256:f0249be468e3b119a8ad83f686e7fe161303197e0534e3cdff8fa5a5417c01a5" ], - "version": "==3.9.4" + "version": "==3.9.5" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 6c79767b..4417a813 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.9.4 +peewee==3.9.5 requests==2.21.0 From ef1eb2c2aecc97da2d35a4ad2068e1810e57ceb6 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 30 Apr 2019 03:40:21 +0200 Subject: [PATCH 251/508] Update urllib3 to 1.25.2 (#344) This PR updates [urllib3](https://pypi.org/project/urllib3) from **1.25.1** to **1.25.2**.
Changelog ### 1.25.2 ``` ------------------- * Change ``is_ipaddress`` to not detect IPvFuture addresses. (Pull 1583) * Change ``parse_url`` to percent-encode invalid characters within the path, query, and target components. (Pull 1586) ```
Links - PyPI: https://pypi.org/project/urllib3 - Changelog: https://pyup.io/changelogs/urllib3/ - Docs: https://urllib3.readthedocs.io/
--- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 64b46382..ea03a8d2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:904bd981d6371bb95a200c0ec9dba5ba7cc980f2d6b125bd793fefe3293be388", - "sha256:a9645efd62b9fc1c7cad8ed93e162aad4c6bfd90e143966ddd4099b78cd244be" + "sha256:a53063d8b9210a7bdec15e7b272776b9d42b2fd6816401a0d43006ad2f9902db", + "sha256:d363e3607d8de0c220d31950a8f38b18d5ba7c0830facd71a1c6b1036b7ce06c" ], - "version": "==1.25.1" + "version": "==1.25.2" } }, "develop": { From 5711ef31f13a81db9df7fc94c7a53994fe438b51 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 6 May 2019 07:16:05 +0200 Subject: [PATCH 252/508] Update pytest-cov to 2.7.1 (#345) * Update pytest-cov from 2.6.1 to 2.7.1 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index a707b840..3c8961dc 100644 --- a/Pipfile +++ b/Pipfile @@ -18,5 +18,5 @@ coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" pytest = "==4.4.1" -pytest-cov = "==2.6.1" +pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index ea03a8d2..613efb65 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -184,10 +184,10 @@ }, "pytest-cov": { "hashes": [ - "sha256:230ef817450ab0699c6cc3c9c8f7a829c34674456f2ed8df1fe1d39780f7c87f", - "sha256:0ab664b25c6aa9716cbf203b17ddb301932383046082c081b9848a0edf5add33" + "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6", + "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a" ], - "version": "==2.6.1" + "version": "==2.7.1" }, "pytest-flake8": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 2c2ab8c7..60856749 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 pytest==4.4.1 -pytest-cov==2.6.1 +pytest-cov==2.7.1 pytest-flake8==1.0.4 From db31f9fd42616f47e78de553349960dbc557a4f9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 9 May 2019 04:21:49 +0200 Subject: [PATCH 253/508] Update pluggy to 0.11.0 (#346) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 613efb65..46b25b8c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -141,10 +141,10 @@ }, "pluggy": { "hashes": [ - "sha256:19ecf9ce9db2fce065a7a0586e07cfb4ac8614fe96edf628a264b1c70116cf8f", - "sha256:84d306a647cc805219916e62aab89caa97a33a1dd8c342e87a37f91073cd4746" + "sha256:25a1bc1d148c9a640211872b4ff859878d422bccb59c9965e04eed468a0aa180", + "sha256:964cedd2b27c492fbf0b7f58b3284a09cf7f99b0f715941fb24a439b3af1bd1a" ], - "version": "==0.9.0" + "version": "==0.11.0" }, "py": { "hashes": [ From b362e67447445c6448aafba899a7583648eafaf2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 9 May 2019 05:33:14 +0200 Subject: [PATCH 254/508] Update pytest to 4.4.2 (#347) * Update pytest from 4.4.1 to 4.4.2 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 3c8961dc..ac294d9e 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.4.1" +pytest = "==4.4.2" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index 46b25b8c..be8cd0f1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:3773f4c235918987d51daf1db66d51c99fac654c81d6f2f709a046ab446d5e5d", - "sha256:b7802283b70ca24d7119b32915efa7c409982f59913c1a6c0640aacf118b95f5" + "sha256:136632a40451162cdfc18fe4d7ecc5d169b558a3d4bbb1603d4005308a42fd03", + "sha256:62b129bf8368554ca7a942cbdb57ea26aafef46cc65bc317cdac3967e54483a3" ], - "version": "==4.4.1" + "version": "==4.4.2" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 60856749..3e9ca84c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.4.1 +pytest==4.4.2 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 15796cd11f6f4a64b583ac1163245ca7727d4e40 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 13 May 2019 04:05:57 +0200 Subject: [PATCH 255/508] Update pytest to 4.5.0 (#348) * Update pytest from 4.4.2 to 4.5.0 --- Pipfile | 2 +- Pipfile.lock | 6 +++--- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index ac294d9e..7ce5e745 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.4.2" +pytest = "==4.5.0" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index be8cd0f1..be8381f2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -177,10 +177,10 @@ }, "pytest": { "hashes": [ - "sha256:136632a40451162cdfc18fe4d7ecc5d169b558a3d4bbb1603d4005308a42fd03", - "sha256:62b129bf8368554ca7a942cbdb57ea26aafef46cc65bc317cdac3967e54483a3" + "sha256:1a8aa4fa958f8f451ac5441f3ac130d9fc86ea38780dd2715e6d5c5882700b24", + "sha256:b8bf138592384bd4e87338cb0f256bf5f615398a649d4bd83915f0e4047a5ca6" ], - "version": "==4.4.2" + "version": "==4.5.0" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 3e9ca84c..9231aa3e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.4.2 +pytest==4.5.0 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 0b72373644064683435375d580da7bbd3a3ab219 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 24 May 2019 09:46:13 +0200 Subject: [PATCH 256/508] Update urllib3 to 1.25.3 (#350) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index be8381f2..0dd2a6d0 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,10 +58,10 @@ }, "urllib3": { "hashes": [ - "sha256:a53063d8b9210a7bdec15e7b272776b9d42b2fd6816401a0d43006ad2f9902db", - "sha256:d363e3607d8de0c220d31950a8f38b18d5ba7c0830facd71a1c6b1036b7ce06c" + "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", + "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" ], - "version": "==1.25.2" + "version": "==1.25.3" } }, "develop": { From e88766bd5d1db6c5175979bcdee6799b7b1868c6 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 29 May 2019 04:37:51 +0200 Subject: [PATCH 257/508] Update pluggy to 0.12.0 (#351) --- Pipfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 0dd2a6d0..92fb5d58 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -141,10 +141,10 @@ }, "pluggy": { "hashes": [ - "sha256:25a1bc1d148c9a640211872b4ff859878d422bccb59c9965e04eed468a0aa180", - "sha256:964cedd2b27c492fbf0b7f58b3284a09cf7f99b0f715941fb24a439b3af1bd1a" + "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", + "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" ], - "version": "==0.11.0" + "version": "==0.12.0" }, "py": { "hashes": [ From 060b5242a3e3847a4c6c2529ab3ec1304998f72f Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 18:07:06 +0800 Subject: [PATCH 258/508] [CircleCI] update the cache name for save_cache and restore_cache Should also based on the checksum of Pipfile and Pipfile.lock or it will use older packages. --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2ea1686..81a4cb0a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ variables: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} - run: name: install dependencies @@ -71,7 +71,7 @@ variables: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} - run: name: run tests @@ -129,7 +129,7 @@ jobs: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} - run: name: install dependencies @@ -143,7 +143,7 @@ jobs: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} - run: From 4147d33530d14da62932b291a94b4fcecc3e2287 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 18:17:52 +0800 Subject: [PATCH 259/508] [PyUp] No need to watch Pipfile.lock Major requirements may conflict with sub-dependency in Pipfile.lock. --- .circleci/config.yml | 8 ++++---- .pyup.yml | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 81a4cb0a..6810c19c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ variables: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} - run: name: install dependencies @@ -71,7 +71,7 @@ variables: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} - run: name: run tests @@ -129,7 +129,7 @@ jobs: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} - run: name: install dependencies @@ -143,7 +143,7 @@ jobs: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }}-{{ checksum "Pipfile.lock" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} - run: diff --git a/.pyup.yml b/.pyup.yml index f14526b0..d1ccac56 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -4,4 +4,3 @@ requirements: - requirements.txt - test-requirements.txt - Pipfile - - Pipfile.lock From 731088bc46aa365d3c37cd830dbabe1d34b3c8d8 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 18:26:12 +0800 Subject: [PATCH 260/508] Update Pipfile.lock --- Pipfile.lock | 91 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 92fb5d58..95c2434e 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "5f7b6afc62cf57780cae75d95ee578ec874c564e43bef61b1ffb5e2ee2653653" + "sha256": "298be599d454d99040878076586fdd45a13be917cf18120657aed941b8c1e999" }, "pipfile-spec": 6, "requires": {}, @@ -16,18 +16,19 @@ "default": { "beautifulsoup4": { "hashes": [ - "sha256:ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718", "sha256:034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", - "sha256:945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348" + "sha256:945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", + "sha256:ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718" ], + "index": "pypi", "version": "==4.7.1" }, "certifi": { "hashes": [ - "sha256:59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5", - "sha256:b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae" + "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", + "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" ], - "version": "==2019.3.9" + "version": "==2019.6.16" }, "chardet": { "hashes": [ @@ -38,8 +39,8 @@ }, "idna": { "hashes": [ - "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c", - "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407" + "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", + "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" ], "version": "==2.8" }, @@ -47,24 +48,40 @@ "hashes": [ "sha256:f0249be468e3b119a8ad83f686e7fe161303197e0534e3cdff8fa5a5417c01a5" ], + "index": "pypi", "version": "==3.9.5" }, "requests": { "hashes": [ - "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b", - "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e" + "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", + "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" ], + "index": "pypi", "version": "==2.21.0" }, + "soupsieve": { + "hashes": [ + "sha256:6898e82ecb03772a0d82bd0d0a10c0d6dcc342f77e0701d0ec4a8271be465ece", + "sha256:b20eff5e564529711544066d7dc0f7661df41232ae263619dede5059799cdfca" + ], + "version": "==1.9.1" + }, "urllib3": { "hashes": [ - "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", - "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4", + "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb" ], - "version": "==1.25.3" + "version": "==1.24.3" } }, "develop": { + "atomicwrites": { + "hashes": [ + "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", + "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" + ], + "version": "==1.3.0" + }, "attrs": { "hashes": [ "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", @@ -74,57 +91,63 @@ }, "coverage": { "hashes": [ - "sha256:0c5fe441b9cfdab64719f24e9684502a59432df7570521563d7b1aff27ac755f", - "sha256:2b412abc4c7d6e019ce7c27cbc229783035eef6d5401695dccba80f481be4eb3", "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", - "sha256:42692db854d13c6c5e9541b6ffe0fe921fe16c9c446358d642ccae1462582d3b", "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", - "sha256:4ec30ade438d1711562f3786bea33a9da6107414aed60a5daa974d50a8c2c351", "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", - "sha256:6899797ac384b239ce1926f3cb86ffc19996f6fa3a1efbb23cb49e0c12d8c18c", "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", - "sha256:8e679d1bde5e2de4a909efb071f14b472a678b788904440779d2c449c0355b27", "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", - "sha256:93f965415cc51604f571e491f280cff0f5be35895b4eb5e55b47ae90c02a497b", "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", - "sha256:a9abc8c480e103dc05d9b332c6cc9fb1586330356fc14f1aa9c0ca5745097d19", "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", - "sha256:c22ab9f96cbaff05c6a84e20ec856383d27eae09e511d3e6ac4479489195861d", "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", - "sha256:ca58eba39c68010d7e87a823f22a081b5290e3e3c64714aac3c91481d8b34d22", "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" ], + "index": "pypi", "version": "==4.5.3" }, + "entrypoints": { + "hashes": [ + "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", + "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" + ], + "version": "==0.3" + }, "flake8": { "hashes": [ "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" ], + "index": "pypi", "version": "==3.7.7" }, + "importlib-metadata": { + "hashes": [ + "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", + "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" + ], + "version": "==0.18" + }, "mccabe": { "hashes": [ "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", @@ -137,6 +160,7 @@ "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" ], + "markers": "python_version > '2.7'", "version": "==7.0.0" }, "pluggy": { @@ -180,6 +204,7 @@ "sha256:1a8aa4fa958f8f451ac5441f3ac130d9fc86ea38780dd2715e6d5c5882700b24", "sha256:b8bf138592384bd4e87338cb0f256bf5f615398a649d4bd83915f0e4047a5ca6" ], + "index": "pypi", "version": "==4.5.0" }, "pytest-cov": { @@ -187,13 +212,15 @@ "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6", "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a" ], + "index": "pypi", "version": "==2.7.1" }, "pytest-flake8": { "hashes": [ - "sha256:d7e2b6b274a255b7ae35e9224c85294b471a83b76ecb6bd53c337ae977a499af", - "sha256:4d225c13e787471502ff94409dcf6f7927049b2ec251c63b764a4b17447b60c0" + "sha256:4d225c13e787471502ff94409dcf6f7927049b2ec251c63b764a4b17447b60c0", + "sha256:d7e2b6b274a255b7ae35e9224c85294b471a83b76ecb6bd53c337ae977a499af" ], + "index": "pypi", "version": "==1.0.4" }, "six": { @@ -202,6 +229,20 @@ "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" ], "version": "==1.12.0" + }, + "wcwidth": { + "hashes": [ + "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", + "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + ], + "version": "==0.1.7" + }, + "zipp": { + "hashes": [ + "sha256:8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", + "sha256:ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3" + ], + "version": "==0.5.1" } } } From 593d431fc70bbaefb539ed37eab72379906984b6 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 19:21:53 +0800 Subject: [PATCH 261/508] [CircleCI] Install requirements.txt before requirements-test.txt --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6810c19c..c3838c3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,6 +65,7 @@ variables: pip install --user -U pip python3 -m venv venv . venv/bin/activate + pip install -r requirements.txt pip install -r requirements-test.txt pip install coveralls From 03e42597f9475ae4a793f88bd153a1448a5585e3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 17 Jun 2019 13:33:14 +0200 Subject: [PATCH 262/508] Update peewee to 3.9.6 (#354) * Update peewee from 3.9.5 to 3.9.6 --- Pipfile | 2 +- Pipfile.lock | 5 ++--- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 7ce5e745..850eb732 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.7.1" -peewee = "==3.9.5" +peewee = "==3.9.6" requests = "==2.21.0" diff --git a/Pipfile.lock b/Pipfile.lock index 95c2434e..64cbc8fe 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -46,10 +46,9 @@ }, "peewee": { "hashes": [ - "sha256:f0249be468e3b119a8ad83f686e7fe161303197e0534e3cdff8fa5a5417c01a5" + "sha256:bc879e1ffb7f7684f90d9dd236c77b5042118d079f94764f35e3806948829ac8" ], - "index": "pypi", - "version": "==3.9.5" + "version": "==3.9.6" }, "requests": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 4417a813..2eb7f3a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 -peewee==3.9.5 +peewee==3.9.6 requests==2.21.0 From 13534159b6e9e3db842f1d488ed680b290195742 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 17 Jun 2019 13:40:44 +0200 Subject: [PATCH 263/508] Update pytest to 4.6.3 (#355) * Update pytest from 4.5.0 to 4.6.3 --- Pipfile | 2 +- Pipfile.lock | 7 +++---- requirements-test.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 850eb732..e0734af9 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.21.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.5.0" +pytest = "==4.6.3" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/Pipfile.lock b/Pipfile.lock index 64cbc8fe..5d8c8ce8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -200,11 +200,10 @@ }, "pytest": { "hashes": [ - "sha256:1a8aa4fa958f8f451ac5441f3ac130d9fc86ea38780dd2715e6d5c5882700b24", - "sha256:b8bf138592384bd4e87338cb0f256bf5f615398a649d4bd83915f0e4047a5ca6" + "sha256:4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", + "sha256:926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da" ], - "index": "pypi", - "version": "==4.5.0" + "version": "==4.6.3" }, "pytest-cov": { "hashes": [ diff --git a/requirements-test.txt b/requirements-test.txt index 9231aa3e..cd5ead5a 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.5.0 +pytest==4.6.3 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 824b95d35ce1912cdd1bc491fa64d9e8bd1ba370 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 17 Jun 2019 13:57:57 +0200 Subject: [PATCH 264/508] Update certifi to 2019.6.16 (#356) From 43142ec2b2716c19d464e8ef520893d392518aa7 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 20:34:19 +0800 Subject: [PATCH 265/508] [Bump Version] 2.1.1 The last version which supports Python 3.4. CHANGE LOG: Dependencies: 824b95d Update certifi to 2019.6.16 (#356) 1353415 Update pytest to 4.6.3 (#355) 03e4259 Update peewee to 3.9.6 (#354) e88766b Update pluggy to 0.12.0 (#351) 0b72373 Update urllib3 to 1.25.3 (#350) 15796cd Update pytest to 4.5.0 (#348) b362e67 Update pytest to 4.4.2 (#347) db31f9f Update pluggy to 0.11.0 (#346) 5711ef3 Update pytest-cov to 2.7.1 (#345) ef1eb2c Update urllib3 to 1.25.2 (#344) 4dad9ef Update peewee to 3.9.5 (#341) a54cb77 Update urllib3 to 1.25.1 (#340) 8556392 Update urllib3 to 1.25 (#339) 7d1652f Update urllib3 to 1.24.2 (#338) 4fe6dec Update pytest to 4.4.1 (#337) 5eeecaa Update peewee to 3.9.4 (#336) CI: 593d431 [CircleCI] Install requirements.txt before requirements-test.txt 731088b Update Pipfile.lock 4147d33 [PyUp] No need to watch Pipfile.lock 060b524 [CircleCI] update the cache name for save_cache and restore_cache --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 78e8eb2a..0baf8e39 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.1.0' +VERSION = '2.1.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 79ec7364673d4553eb351acb3f1de292a63aeaa2 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 21:25:09 +0800 Subject: [PATCH 266/508] Add and rearrange badges into README --- README.rst | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 985260c9..e26b85d4 100644 --- a/README.rst +++ b/README.rst @@ -2,11 +2,13 @@ zdict ======================================== -|issues| +|license| |version| |python version| |month download| + +|stars| |forks| |contributors| |pull requests| |issues| |travis| |circleci| |coveralls| -|license| |gitter| +|gitter| ---- @@ -287,6 +289,26 @@ Stargazers over time |stargazers| +.. |version| image:: https://img.shields.io/pypi/v/zdict.svg + :target: https://pypi.org/project/zdict + +.. |python version| image:: https://img.shields.io/pypi/pyversions/zdict.svg + :target: https://pypi.org/project/zdict + +.. |month download| image:: https://img.shields.io/pypi/dm/zdict.svg + :target: https://pypi.org/project/zdict + +.. |stars| image:: https://img.shields.io/github/stars/zdict/zdict.svg + :target: https://github.com/zdict/zdict/ + +.. |forks| image:: https://img.shields.io/github/forks/zdict/zdict.svg + :target: https://github.com/zdict/zdict/issues + +.. |contributors| image:: https://img.shields.io/github/contributors/zdict/zdict.svg + :target: https://github.com/zdict/zdict/issues + +.. |pull requests| image:: https://img.shields.io/github/issues-pr/zdict/zdict.svg + :target: https://github.com/zdict/zdict/issues .. |issues| image:: https://img.shields.io/github/issues/zdict/zdict.svg :target: https://github.com/zdict/zdict/issues From e090a3e230d4c55c7b968a093a129a64e89e34ef Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 17 Jun 2019 21:29:09 +0800 Subject: [PATCH 267/508] Update links of badges in README --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index e26b85d4..faee4ca4 100644 --- a/README.rst +++ b/README.rst @@ -302,13 +302,13 @@ Stargazers over time :target: https://github.com/zdict/zdict/ .. |forks| image:: https://img.shields.io/github/forks/zdict/zdict.svg - :target: https://github.com/zdict/zdict/issues + :target: https://github.com/zdict/zdict/ .. |contributors| image:: https://img.shields.io/github/contributors/zdict/zdict.svg - :target: https://github.com/zdict/zdict/issues + :target: https://github.com/zdict/zdict/graphs/contributors .. |pull requests| image:: https://img.shields.io/github/issues-pr/zdict/zdict.svg - :target: https://github.com/zdict/zdict/issues + :target: https://github.com/zdict/zdict/pulls .. |issues| image:: https://img.shields.io/github/issues/zdict/zdict.svg :target: https://github.com/zdict/zdict/issues From ae9b3416426a1fcffdacb1d660ad0cffff32cfc0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 18 Jun 2019 14:05:11 +0200 Subject: [PATCH 268/508] Update requests to 2.22.0 (#349) * Update requests from 2.21.0 to 2.22.0 * Drop Python 3.4 support Python 3.4 reaches End Of Life at Python 3.4.10, March 18th, 2019. Since requests 2.22.0 doesn't support it, we will also drop support for Python 3.4. --- .circleci/config.yml | 13 +------------ .travis.yml | 4 ---- Pipfile | 2 +- Pipfile.lock | 7 +++---- requirements.txt | 2 +- setup.py | 4 ++++ 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3838c3b..9bb6201d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,16 +19,11 @@ workflows: filters: tags: only: /.*/ - - linux-python-3.4: - filters: - tags: - only: /.*/ - deploy: requires: - linux-python-3.7 - linux-python-3.6 - linux-python-3.5 - - linux-python-3.4 filters: tags: only: /[0-9]+(\.[0-9]+)*/ @@ -47,7 +42,6 @@ workflows: - linux-python-3.7 - linux-python-3.6 - linux-python-3.5 - - linux-python-3.4 variables: test-template: &test-template @@ -113,17 +107,12 @@ jobs: docker: - image: circleci/python:3.5 - linux-python-3.4: - <<: *test-template - docker: - - image: circleci/python:3.4 - # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ deploy: docker: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - - image: circleci/python:3.4 + - image: circleci/python:3.5 working_directory: ~/repo steps: - checkout diff --git a/.travis.yml b/.travis.yml index 84df1525..702dd8aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,6 @@ jobs: include: # Python runtime is not yet available on OS X # https://github.com/travis-ci/travis-ci/issues/2312 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.4.9 - stage: test os: osx language: generic diff --git a/Pipfile b/Pipfile index e0734af9..6ce468cb 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" beautifulsoup4 = "==4.7.1" peewee = "==3.9.6" -requests = "==2.21.0" +requests = "==2.22.0" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 5d8c8ce8..9d277332 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -52,11 +52,10 @@ }, "requests": { "hashes": [ - "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", - "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" + "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", + "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" ], - "index": "pypi", - "version": "==2.21.0" + "version": "==2.22.0" }, "soupsieve": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 2eb7f3a7..c8da60c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.7.1 peewee==3.9.6 -requests==2.21.0 +requests==2.22.0 diff --git a/setup.py b/setup.py index c2b65023..2f503a3d 100644 --- a/setup.py +++ b/setup.py @@ -94,6 +94,7 @@ def run_tests(self): ), platforms=['Linux', 'Mac'], license="GPL3", + python_requires=">=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", @@ -104,6 +105,9 @@ def run_tests(self): "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Topic :: Utilities", ], ) From 267a62e4a05165d73fe01ee1eeadcb9d3082fea3 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 18 Jun 2019 20:06:35 +0800 Subject: [PATCH 269/508] Bump Version to 3.0.0 - Drop Python 3.4 support. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 0baf8e39..e63e36d9 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '2.1.1' +VERSION = '3.0.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 2be5715f6773816ebc7dc9bf812211003e5d4093 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 18 Jun 2019 21:08:48 +0800 Subject: [PATCH 270/508] [setup.cfg] Update bdist_wheel python-tag to py35+ --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 87b43585..6d39cd19 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,4 +9,4 @@ flake8-ignore = # F841 - local variable name is assigned to but never used [bdist_wheel] -python-tag = py34+ +python-tag = py35+ From 01cd0426a00867d853bed3a9b23fb7473b379371 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 18 Jun 2019 21:27:30 +0800 Subject: [PATCH 271/508] Version 3.0.1 Fix bdist_wheel python-tag to py35+ for 3.0.0 --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index e63e36d9..ac898ded 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.0.0' +VERSION = '3.0.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 2865769c744fb171025307634e05cc4955163dee Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 18 Jun 2019 22:42:26 +0800 Subject: [PATCH 272/508] [#357] Extends query_timeout for iTaigi to avoid timeout (#358) Try to set query_timeout from 5 secs to 60 secs for iTaigi. --- zdict/tests/dictionaries/test_itaigi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zdict/tests/dictionaries/test_itaigi.py b/zdict/tests/dictionaries/test_itaigi.py index 33d9996c..1bedea86 100644 --- a/zdict/tests/dictionaries/test_itaigi.py +++ b/zdict/tests/dictionaries/test_itaigi.py @@ -13,6 +13,9 @@ def setup_class(cls): cls.words = ['芭樂', '測試'] + # Set query_timeout from 5 seconds to 60 seconds, + # so it won't timeout that often. + cls.dict.args.query_timeout = 60 # Setup normal query data cls.dict.args.verbose = False cls.records = [cls.dict.query(word) for word in cls.words] From 7d75c42474c26494f1c5c1b74dca0e0f5f3f7119 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 20 Jun 2019 12:26:14 +0800 Subject: [PATCH 273/508] [README] Remove WIP sign --- README.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index faee4ca4..ec4a916c 100644 --- a/README.rst +++ b/README.rst @@ -12,8 +12,6 @@ zdict ---- -*Note: This project is working in progress.* - zdict is a CLI dictionary framework mainly focus on any kind of online dictionary. This project originally forked from https://github.com/chenpc/ydict, which is a CLI tool for the Yahoo! online dictionary. After heavily refactoring the original project including: @@ -291,7 +289,7 @@ Stargazers over time .. |version| image:: https://img.shields.io/pypi/v/zdict.svg :target: https://pypi.org/project/zdict - + .. |python version| image:: https://img.shields.io/pypi/pyversions/zdict.svg :target: https://pypi.org/project/zdict @@ -300,10 +298,10 @@ Stargazers over time .. |stars| image:: https://img.shields.io/github/stars/zdict/zdict.svg :target: https://github.com/zdict/zdict/ - + .. |forks| image:: https://img.shields.io/github/forks/zdict/zdict.svg :target: https://github.com/zdict/zdict/ - + .. |contributors| image:: https://img.shields.io/github/contributors/zdict/zdict.svg :target: https://github.com/zdict/zdict/graphs/contributors From deed69f4727498d1b5071cdefd83dc773b958094 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 20 Jun 2019 12:27:49 +0800 Subject: [PATCH 274/508] [setup.py] Change Development Status from Alpha to Stable --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2f503a3d..bf5a63b8 100644 --- a/setup.py +++ b/setup.py @@ -96,7 +96,7 @@ def run_tests(self): license="GPL3", python_requires=">=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", classifiers=[ - "Development Status :: 3 - Alpha", + "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", From fc85cee9d20df6cd3523fc60898352f9b4333dfe Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 20 Jun 2019 12:28:56 +0800 Subject: [PATCH 275/508] Version 3.0.2 - Remove WIP in README - Change development status from Alpha to Stable for setup.py on PyPI - Testings - [#357] Extends query_timeout for iTaigi to avoid timeout (#358) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index ac898ded..ac4d8b56 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.0.1' +VERSION = '3.0.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From d673dfde71425f244f2a21b60aae132b9fda6fdc Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 2 Jul 2019 06:36:28 +0200 Subject: [PATCH 276/508] Update pytest to 5.0.0 (#359) * Update pytest from 4.6.3 to 5.0.0 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 6ce468cb..10da1ebc 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.3" flake8 = "==3.7.7" pyjokes = "==0.5.0" -pytest = "==4.6.3" +pytest = "==5.0.0" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index cd5ead5a..40c074f6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.7 pyjokes==0.5.0 -pytest==4.6.3 +pytest==5.0.0 pytest-cov==2.7.1 pytest-flake8==1.0.4 From ab943b2b61a86633c425feffef002d645d8dd0e2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 31 Jul 2019 09:41:33 +0200 Subject: [PATCH 277/508] Update flake8 to 3.7.8 (#360) * Update flake8 from 3.7.7 to 3.7.8 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 10da1ebc..0b141aa5 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ requests = "==2.22.0" [dev-packages] coverage = "==4.5.3" -flake8 = "==3.7.7" +flake8 = "==3.7.8" pyjokes = "==0.5.0" pytest = "==5.0.0" pytest-cov = "==2.7.1" diff --git a/requirements-test.txt b/requirements-test.txt index 40c074f6..fc4c923e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==4.5.3 -flake8==3.7.7 +flake8==3.7.8 pyjokes==0.5.0 pytest==5.0.0 pytest-cov==2.7.1 From 33e2791044185927f267a9e311083db10edbaa7e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 31 Jul 2019 09:47:18 +0200 Subject: [PATCH 278/508] Update beautifulsoup4 to 4.8.0 (#362) * Update beautifulsoup4 from 4.7.1 to 4.8.0 --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 0b141aa5..c6695c0a 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.7.1" +beautifulsoup4 = "==4.8.0" peewee = "==3.9.6" requests = "==2.22.0" diff --git a/requirements.txt b/requirements.txt index c8da60c0..81dd4f99 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.7.1 +beautifulsoup4==4.8.0 peewee==3.9.6 requests==2.22.0 From 29785e57644cb2f9a02b87bad362647f7c40c5e4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 31 Jul 2019 10:40:57 +0200 Subject: [PATCH 279/508] Update pytest to 5.0.1 (#361) * Update pytest from 5.0.0 to 5.0.1 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index c6695c0a..4f09340f 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.3" flake8 = "==3.7.8" pyjokes = "==0.5.0" -pytest = "==5.0.0" +pytest = "==5.0.1" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index fc4c923e..ab56990a 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.3 flake8==3.7.8 pyjokes==0.5.0 -pytest==5.0.0 +pytest==5.0.1 pytest-cov==2.7.1 pytest-flake8==1.0.4 From f98f7eb6a6d063b465ec4e550a49dc0d25f45f51 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 1 Aug 2019 11:41:17 +0200 Subject: [PATCH 280/508] Update coverage to 4.5.4 (#363) * Update coverage from 4.5.3 to 4.5.4 --- Pipfile | 3 +-- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index 4f09340f..1f424656 100644 --- a/Pipfile +++ b/Pipfile @@ -13,8 +13,7 @@ requests = "==2.22.0" [dev-packages] - -coverage = "==4.5.3" +coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.5.0" pytest = "==5.0.1" diff --git a/requirements-test.txt b/requirements-test.txt index ab56990a..5d886320 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==4.5.3 +coverage==4.5.4 flake8==3.7.8 pyjokes==0.5.0 pytest==5.0.1 From 78513795951c287237fe53e74fba6eeb48889e31 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 5 Aug 2019 18:10:35 +0800 Subject: [PATCH 281/508] [CircleCI] Change weekly-build to daily-build Daily build at 08:00 UTC+8. So we can know the error earlier. --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9bb6201d..eb633668 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,11 +30,11 @@ workflows: branches: ignore: /.*/ - weekly-build: + daily-build: triggers: - schedule: - # At 00:00 on Friday. - cron: "0 0 * * 5" + # At 08:00 UTC+8 everyday. + cron: "0 0 * * *" filters: branches: only: master From 281d1243e8432c2a5fd2177b4b637423ae3a4c39 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 5 Aug 2019 12:13:39 +0200 Subject: [PATCH 282/508] Update peewee to 3.10.0 (#364) * Update peewee from 3.9.6 to 3.10.0 --- Pipfile | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 1f424656..b5a59d31 100644 --- a/Pipfile +++ b/Pipfile @@ -8,11 +8,12 @@ name = "pypi" [packages] beautifulsoup4 = "==4.8.0" -peewee = "==3.9.6" +peewee = "==3.10.0" requests = "==2.22.0" [dev-packages] + coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.5.0" diff --git a/requirements.txt b/requirements.txt index 81dd4f99..09523666 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.8.0 -peewee==3.9.6 +peewee==3.10.0 requests==2.22.0 From 6efac9ff1ab528b88e60f954cd66261ed488ff39 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 15 Aug 2019 06:40:45 +0200 Subject: [PATCH 283/508] Update pyjokes to 0.6.0 (#366) * Update pyjokes from 0.5.0 to 0.6.0 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index b5a59d31..29a34146 100644 --- a/Pipfile +++ b/Pipfile @@ -16,7 +16,7 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" -pyjokes = "==0.5.0" +pyjokes = "==0.6.0" pytest = "==5.0.1" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 5d886320..64e062f3 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 -pyjokes==0.5.0 +pyjokes==0.6.0 pytest==5.0.1 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 787dea5913f4d643600bc7d34ac9ea5fe37d14b5 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 19 Aug 2019 04:05:14 +0200 Subject: [PATCH 284/508] Update pytest to 5.1.0 (#367) * Update pytest from 5.0.1 to 5.1.0 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 29a34146..c5c5983c 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" -pytest = "==5.0.1" +pytest = "==5.1.0" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 64e062f3..2b3f4112 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 -pytest==5.0.1 +pytest==5.1.0 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 0c1a6c16495883e262d987c9fe16e8e7bb466ebe Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 20 Aug 2019 12:31:18 +0800 Subject: [PATCH 285/508] Update README.rst Add Docker Hub related badges. --- README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.rst b/README.rst index ec4a916c..9ff66d82 100644 --- a/README.rst +++ b/README.rst @@ -8,6 +8,8 @@ zdict |travis| |circleci| |coveralls| +|docker automated build| |docker build status| + |gitter| ---- @@ -329,3 +331,9 @@ Stargazers over time .. |stargazers| image:: https://starcharts.herokuapp.com/zdict/zdict.svg :target: https://starcharts.herokuapp.com/zdict/zdict + +.. |docker automated build| image:: https://img.shields.io/docker/automated/zdict/zdict + :target: https://hub.docker.com/r/zdict/zdict + +.. |docker build status| image:: https://img.shields.io/docker/build/zdict/zdict + :target: https://hub.docker.com/r/zdict/zdict From c09d884cd25421be8f72faaea69d3fd41c9aa5af Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 22 Aug 2019 03:41:07 +0200 Subject: [PATCH 286/508] Update pytest to 5.1.1 (#368) * Update pytest from 5.1.0 to 5.1.1 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index c5c5983c..b32e2a02 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" -pytest = "==5.1.0" +pytest = "==5.1.1" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 2b3f4112..e344796c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 -pytest==5.1.0 +pytest==5.1.1 pytest-cov==2.7.1 pytest-flake8==1.0.4 From fc9722d9697d0492b5a6979b0c92e4cfd94ad7e4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 2 Sep 2019 06:12:58 +0200 Subject: [PATCH 287/508] Update pytest to 5.1.2 (#370) * Update pytest from 5.1.1 to 5.1.2 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index b32e2a02..b03704c3 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" -pytest = "==5.1.1" +pytest = "==5.1.2" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index e344796c..5e4be4e4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 -pytest==5.1.1 +pytest==5.1.2 pytest-cov==2.7.1 pytest-flake8==1.0.4 From cef0899eac8628595994b7bbd6ed3f1ad9df2149 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 20 Sep 2019 06:58:04 +0200 Subject: [PATCH 288/508] Update peewee to 3.11.0 (#371) * Update peewee from 3.10.0 to 3.11.0 * Update peewee from 3.10.0 to 3.11.0 --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index b03704c3..43559ed2 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.8.0" -peewee = "==3.10.0" +peewee = "==3.11.0" requests = "==2.22.0" diff --git a/requirements.txt b/requirements.txt index 09523666..92932019 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.8.0 -peewee==3.10.0 +peewee==3.11.0 requests==2.22.0 From c06ef9bd94a8517682f9f9c7ed540ec96230893e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 23 Sep 2019 07:39:16 +0200 Subject: [PATCH 289/508] Update pytest to 5.1.3 (#372) * Update pytest from 5.1.2 to 5.1.3 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 43559ed2..720dd598 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" -pytest = "==5.1.2" +pytest = "==5.1.3" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 5e4be4e4..f73b5d71 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 -pytest==5.1.2 +pytest==5.1.3 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 86b6eb43b784edef07e1f55e77cdda1ef4644329 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 24 Sep 2019 07:34:54 +0200 Subject: [PATCH 290/508] Update peewee to 3.11.1 (#373) * Update peewee from 3.11.0 to 3.11.1 --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 720dd598..2472cb6f 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.8.0" -peewee = "==3.11.0" +peewee = "==3.11.1" requests = "==2.22.0" diff --git a/requirements.txt b/requirements.txt index 92932019..c45d51b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.8.0 -peewee==3.11.0 +peewee==3.11.1 requests==2.22.0 From e3d1d4172be28fd7b58c98289d71f14732fd211b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 25 Sep 2019 09:59:12 +0200 Subject: [PATCH 291/508] Update peewee to 3.11.2 (#374) * Update peewee from 3.11.1 to 3.11.2 --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 2472cb6f..16ef80fc 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.8.0" -peewee = "==3.11.1" +peewee = "==3.11.2" requests = "==2.22.0" diff --git a/requirements.txt b/requirements.txt index c45d51b1..34c839c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.8.0 -peewee==3.11.1 +peewee==3.11.2 requests==2.22.0 From c183878f7d1151e33fc4fd52f1e803aa36e7cd76 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 2 Oct 2019 10:09:45 +0200 Subject: [PATCH 292/508] Update pytest to 5.2.0 (#375) * Update pytest from 5.1.3 to 5.2.0 * Update pytest from 5.1.3 to 5.2.0 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 16ef80fc..a2eda9fc 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" -pytest = "==5.1.3" +pytest = "==5.2.0" pytest-cov = "==2.7.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index f73b5d71..e95c9677 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 -pytest==5.1.3 +pytest==5.2.0 pytest-cov==2.7.1 pytest-flake8==1.0.4 From 04ee37c141ab215e2850796f32cb24f3491c2480 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 8 Oct 2019 03:01:29 +0200 Subject: [PATCH 293/508] Update beautifulsoup4 to 4.8.1 (#378) * Update beautifulsoup4 from 4.8.0 to 4.8.1 * Update beautifulsoup4 from 4.8.0 to 4.8.1 --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index a2eda9fc..853afb64 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.8.0" +beautifulsoup4 = "==4.8.1" peewee = "==3.11.2" requests = "==2.22.0" diff --git a/requirements.txt b/requirements.txt index 34c839c4..df2ac9ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.8.0 +beautifulsoup4==4.8.1 peewee==3.11.2 requests==2.22.0 From c20cb70b13a20dc26b1d360c8ad0ff3519e69165 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sun, 3 Nov 2019 21:05:45 +0800 Subject: [PATCH 294/508] =?UTF-8?q?=E2=9A=92=EF=B8=8F=20update=20for=20yah?= =?UTF-8?q?oo=20dictionary=20web=20changes=20(#381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update for yahoo dictionary web changes * fix metadata * more queries --- zdict/dictionaries/yahoo.py | 24 +++++++++++++----------- zdict/tests/dictionaries/test_yahoo.py | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index d391d073..f8edfe1c 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -233,20 +233,22 @@ def get_grammar(d: bs4.element.Tag): 'div.dictionaryWordCard > ul > li') return list(map(text, d.select(s))) - node = data.select_one('div#web ol.searchCenterMiddle > li > div') - node = node.select(':scope > div') + node = data.select_one('div#web ol.searchCenterMiddle') + node = node.select('div.sys_dict_word_card > div.grp-main > div') p = None # optional - if node is None or len(node) <= 2: # e.g. "fabor" + if node is None or len(node) <= 1: # e.g. "fabor" raise NotFoundError(word) - elif len(node) == 3: # e.g. "google" - _, w, e = node - elif len(node) == 4: # e.g. "hold on" - _, w, _, e = node - elif len(node) == 5: - _, w, p, _, e = node - elif len(node) == 6: # e.g. "metadata" - _, w, p, _, _, e = node + elif len(node) == 2: # e.g. "apples" + w, e = node + elif len(node) == 3: # e.g. ? + w, _, e = node + elif len(node) == 4: # e.g. ? + w, _, _, e = node + elif len(node) == 5: # e.g. "metadata" + w, p, _, _, e = node + elif len(node) == 6: + w, p, _, _, _, e = node return { 'word': w.find('span').text.strip(), diff --git a/zdict/tests/dictionaries/test_yahoo.py b/zdict/tests/dictionaries/test_yahoo.py index 130bb901..0b241f75 100644 --- a/zdict/tests/dictionaries/test_yahoo.py +++ b/zdict/tests/dictionaries/test_yahoo.py @@ -10,7 +10,7 @@ class TestyDict: @classmethod def setup_class(cls): cls.dict = YahooDict(get_args()) - cls.words = ['style', 'metadata'] + cls.words = ['style', 'metadata', 'apples', 'google', 'hold on'] cls.records = [cls.dict.query(word) for word in cls.words] @classmethod From 47e87e67c8dd08e120873a68429d9c37a155f09f Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu Date: Mon, 4 Nov 2019 23:25:39 +0800 Subject: [PATCH 295/508] Version 3.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: * c20cb70 ⚒️ update for yahoo dictionary web changes Dependencies update: * 04ee37c Update beautifulsoup4 to 4.8.1 * e3d1d41 Update peewee to 3.11.2 --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index ac4d8b56..0bec4884 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.0.2' +VERSION = '3.1.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From e8e493e8490e5958dc0e1f96f0c316e57719cfd8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 5 Nov 2019 04:59:01 +0200 Subject: [PATCH 296/508] Update pytest-cov to 2.8.1 (#377) * Update pytest-cov from 2.7.1 to 2.8.1 * Update pytest-cov from 2.7.1 to 2.8.1 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 853afb64..14396b5e 100644 --- a/Pipfile +++ b/Pipfile @@ -18,5 +18,5 @@ coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" pytest = "==5.2.0" -pytest-cov = "==2.7.1" +pytest-cov = "==2.8.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index e95c9677..99b50001 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 pytest==5.2.0 -pytest-cov==2.7.1 +pytest-cov==2.8.1 pytest-flake8==1.0.4 From e830ea00c15520cf85fa42b87e76f63c548c2faf Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 5 Nov 2019 11:25:39 +0200 Subject: [PATCH 297/508] Update pytest to 5.2.2 (#379) * Update pytest from 5.2.0 to 5.2.2 * Update pytest from 5.2.0 to 5.2.2 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 14396b5e..ea285af1 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.8" pyjokes = "==0.6.0" -pytest = "==5.2.0" +pytest = "==5.2.2" pytest-cov = "==2.8.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 99b50001..87b9c0f6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.8 pyjokes==0.6.0 -pytest==5.2.0 +pytest==5.2.2 pytest-cov==2.8.1 pytest-flake8==1.0.4 From 3d5986268b636225151c1169824b498c0edfc23d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 6 Nov 2019 05:47:14 +0200 Subject: [PATCH 298/508] Update flake8 to 3.7.9 (#380) * Update flake8 from 3.7.8 to 3.7.9 * Update flake8 from 3.7.8 to 3.7.9 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index ea285af1..f91b8ba5 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ requests = "==2.22.0" [dev-packages] coverage = "==4.5.4" -flake8 = "==3.7.8" +flake8 = "==3.7.9" pyjokes = "==0.6.0" pytest = "==5.2.2" pytest-cov = "==2.8.1" diff --git a/requirements-test.txt b/requirements-test.txt index 87b9c0f6..9e842adc 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==4.5.4 -flake8==3.7.8 +flake8==3.7.9 pyjokes==0.6.0 pytest==5.2.2 pytest-cov==2.8.1 From 58e6d8c354e4356b8287d12a2e30a8eeaa061a93 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 17 Nov 2019 04:44:25 +0200 Subject: [PATCH 299/508] Update pytest to 5.2.4 (#382) * Update pytest from 5.2.2 to 5.2.4 * Update pytest from 5.2.2 to 5.2.4 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index f91b8ba5..44f80959 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.9" pyjokes = "==0.6.0" -pytest = "==5.2.2" +pytest = "==5.2.4" pytest-cov = "==2.8.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 9e842adc..10e5a1d0 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.9 pyjokes==0.6.0 -pytest==5.2.2 +pytest==5.2.4 pytest-cov==2.8.1 pytest-flake8==1.0.4 From 12d00c31b363ef832c57ab4fa5ef7eeb7237e51f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 26 Nov 2019 18:18:19 +0200 Subject: [PATCH 300/508] Update pytest to 5.3.0 (#383) * Update pytest from 5.2.4 to 5.3.0 * Update pytest from 5.2.4 to 5.3.0 --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 44f80959..18917e1e 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.9" pyjokes = "==0.6.0" -pytest = "==5.2.4" +pytest = "==5.3.0" pytest-cov = "==2.8.1" pytest-flake8 = "==1.0.4" diff --git a/requirements-test.txt b/requirements-test.txt index 10e5a1d0..4b1deac4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.9 pyjokes==0.6.0 -pytest==5.2.4 +pytest==5.3.0 pytest-cov==2.8.1 pytest-flake8==1.0.4 From bf21d268d43c6bae593332ef02012070e5be18ae Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Wed, 22 Apr 2020 11:43:23 +0800 Subject: [PATCH 301/508] Fix travis ci (#394) https://travis-ci.org/github/zdict/zdict/jobs/638806986 ``` You can override this and force removal with: brew uninstall --ignore-dependencies openssl@1.1 ``` --- ci/install_python_for_osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/install_python_for_osx.sh b/ci/install_python_for_osx.sh index b4e0424b..cc7ddd48 100755 --- a/ci/install_python_for_osx.sh +++ b/ci/install_python_for_osx.sh @@ -5,7 +5,7 @@ set -ev curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash # Make it use openssl only -brew uninstall openssl@1.1 +brew uninstall --ignore-dependencies openssl@1.1 # print openssl path brew --prefix openssl From adfc75547dbc71bbb64157f01bd648ce521ed114 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Wed, 22 Apr 2020 23:17:31 +0800 Subject: [PATCH 302/508] spanish: migrate query URL to HTTPS (#396) * spanish: migrate query URL to HTTPS * [#396] Fix spanish dict query * [#396] Fix "no direct translation" for spansih dict query * Fix for E501 line too long * [#396] Fix tests for spanish dict URL changed from http:// to https:// Co-authored-by: Frank Jheng --- zdict/dictionaries/spanish.py | 155 +++++++++++++---------- zdict/tests/dictionaries/test_spanish.py | 4 +- 2 files changed, 93 insertions(+), 66 deletions(-) diff --git a/zdict/dictionaries/spanish.py b/zdict/dictionaries/spanish.py index 0ab9c5e4..c2ba5b47 100644 --- a/zdict/dictionaries/spanish.py +++ b/zdict/dictionaries/spanish.py @@ -19,7 +19,7 @@ class SpanishDict(DictBase): Tested words : ('soy', 'manzana', 'python', 'perdón') ''' - API = 'http://www.spanishdict.com/translate/{word}' + API = 'https://www.spanishdict.com/translate/{word}' @property def provider(self): @@ -69,78 +69,105 @@ def query(self, word: str): data = BeautifulSoup(webpage, "html.parser") content = {} - card = data.find('div', attrs={'class': 'card'}) - entry = card.find( - # just get the first one - attrs={'class': 'dictionary-entry'} + # word can be existing in both English & Spanish + card = ( + data.find('div', attrs={'id': 'dictionary-neodict-en'}) + or data.find('div', attrs={'id': 'dictionary-neodict-es'}) ) - - if not entry: + if card is None: raise NotFoundError(word) - content['explains'] = [] - - # word can be existing in both English & Spanish - word_element = ( - card.find(attrs={'id': 'headword-en'}) - or card.find(attrs={'id': 'headword-es'}) - ) + word_element = card.find('span', attrs={'class': 'WGK1YbP8'}) if word_element is None: raise NotFoundError(word) content['word'] = word_element.text - pattern1 = {'class': 'dictionary-neodict-indent-1'} - pattern2 = {'class': 'dictionary-neodict-indent-2'} - pattern3 = {'class': 'dictionary-neodict-indent-3'} - pattern_order = {'class': 'dictionary-neodict-translation'} - pattern_example = {'class': 'dictionary-neodict-example'} - pattern1_en = {'class': 'dictionary-neoharrap-indent-1'} - pattern2_en = {'class': 'dictionary-neoharrap-indent-2'} - pattern_order_en = {'class': 'dictionary-neoharrap-translation'} - - speeches = card.find_all(attrs={'class': 'part_of_speech'}) - - for (speech, category) in zip( - speeches, - entry.find_all(attrs=pattern1) or entry.find_all(attrs=pattern1_en) - ): + ''' + COPULAR VERB # speech_pattern + # categories_card_pattern + 1. (used to express a permanent quality) # category_text_pattern + a. ser # explanation_order_pattern, explanation_text_pattern + # example_card_pattern + The ocean is blue. + El océano es azul. + 2. (used to express a temporary state) + a. estar + I'm not in a good mood today. + Hoy no estoy de buen humor. + + The sky is cloudy. + El cielo está nublado. + ... (Another speech pattern if it has.) + ''' + speech_pattern = {'class': '_2xs-UBSR'} + + categories_card_pattern = {'class': 'FyTYrC-y'} + category_text_pattern = {'class': '_1vspKqMZ'} + + explanation_order_pattern = {'class': '_1TgBOcUi'} + explanation_text_pattern = {'class': ['C2TP2MvR', '_1KZoU2hp']} + + example_card_pattern = {'class': 'FyTYrC-y'} + + # Start to grab + content['explains'] = [] + speech = card.find(attrs=speech_pattern) + while speech: result = [] - content['explains'].append([speech.text, result]) - context = category.find(attrs={'class': 'context'}).text - explains = [] - - for explain in (category.find_all(attrs=pattern2) or - category.find_all(attrs=pattern2_en)): - - orders = (explain.find_all(attrs=pattern_order) or - explain.find_all(attrs=pattern_order_en)) - - if orders: - # e.g. - # - # ('a. forgiveness', 'b. pardon (law)') - # - indices = tuple( - map( - lambda x: x.text.replace('\xa0', ' ').strip(), - orders - ) + speech_text_element = speech.find(['a', 'span']) + content['explains'].append([speech_text_element.text, result]) + + categories_card = speech.find(attrs=categories_card_pattern) + for category in categories_card.children: + category_text_element = category.find( + attrs=category_text_pattern + ) + category_text = category_text_element.text + + explains = [] + explanation_card = category.find(attrs=example_card_pattern) + for explanation in explanation_card.children: + explanation_orders = explanation.find_all( + 'span', + explanation_order_pattern ) - else: - continue - - examples = explain.find_all(attrs=pattern3) - - for (example, index) in zip(examples, indices): - t = tuple(example.find(attrs=pattern_example)) - (spanish, english) = (t[0].text, t[2].text) - explains.append((index, spanish, english)) - - if (not examples) and (len(indices) > 0): - for index in indices: - explains.append((index,)) - - result.append([context, explains]) + explanation_texts = ( + explanation.find_all('a', explanation_text_pattern) or + explanation.find_all('span', explanation_text_pattern) + ) + indices = [] + if explanation_orders: + for explanation_order, explanation_text in zip( + explanation_orders, + explanation_texts + ): + indices.append( + "{}{}".format( + explanation_order.text.strip(), + explanation_text.text.strip() + ) + ) + else: + continue + + examples = explanation.find_all(attrs=example_card_pattern) + for (example, index) in zip(examples, indices): + t = example.find_all() + # Should be only 4 elements + # [(whole sentence), text, —, text] + ''' + When Spanish => English, it will show Spanish first. + When English => Spanish, it will show English first. + So, the variables below are not definitely. + ''' + (spanish, english) = (t[1].text, t[3].text) + explains.append((index, spanish, english)) + + if (not examples) and (len(indices) > 0): + for index in indices: + explains.append((index,)) + result.append([category_text, explains]) + speech = speech.next_sibling record = Record( word=word, diff --git a/zdict/tests/dictionaries/test_spanish.py b/zdict/tests/dictionaries/test_spanish.py index a8f51697..281c0789 100644 --- a/zdict/tests/dictionaries/test_spanish.py +++ b/zdict/tests/dictionaries/test_spanish.py @@ -32,10 +32,10 @@ def test_title(self): assert self.dict.title == 'SpanishDict' def test__get_url(self): - url = 'http://www.spanishdict.com/translate/{}'.format(self.en_word) + url = 'https://www.spanishdict.com/translate/{}'.format(self.en_word) assert url == self.dict._get_url(self.en_word) - url = 'http://www.spanishdict.com/translate/{}'.format(self.es_word) + url = 'https://www.spanishdict.com/translate/{}'.format(self.es_word) assert url == self.dict._get_url(self.es_word) def test_show(self): From 2fa1cff5392b673d8d7c0c900807c75e4c117e28 Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 22 Apr 2020 23:26:26 +0800 Subject: [PATCH 303/508] Version 3.2.0 + adfc755 spanish: migrate query URL to HTTPS (#396) + Fix Spanish Dict + bf21d26 Fix travis ci (#394) + 12d00c3 (fix-itaigi-tests) Update pytest to 5.3.0 (#383) + 58e6d8c Update pytest to 5.2.4 (#382) + 3d59862 Update flake8 to 3.7.9 (#380) + e830ea0 Update pytest to 5.2.2 (#379) + e8e493e Update pytest-cov to 2.8.1 (#377) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 0bec4884..4f4753ef 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.1.0' +VERSION = '3.2.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 58d369daeff217ebeeb4c8d2b2b8c078b2362f77 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 22 Apr 2020 23:51:39 +0800 Subject: [PATCH 304/508] [#406] Fix yahoo dict missing example sentences bug (#408) --- zdict/dictionaries/yahoo.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index f8edfe1c..d73e0c32 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -244,7 +244,7 @@ def get_grammar(d: bs4.element.Tag): elif len(node) == 3: # e.g. ? w, _, e = node elif len(node) == 4: # e.g. ? - w, _, _, e = node + w, p, _, e = node elif len(node) == 5: # e.g. "metadata" w, p, _, _, e = node elif len(node) == 6: @@ -259,18 +259,20 @@ def get_grammar(d: bs4.element.Tag): def parse_explain(self, data): def getitem(node) -> {'type': 'item', 'text': '...'}: - s = node.select_one('span') + # This method will glitch when there are more the one sentence. + s = node.find_all('span') + # s should be ['${index}', '${meaning}', '${example_sentence}'] exp = { 'type': 'item', - 'text': s.text, + 'text': "{} {}".format(s[0].text, s[1].text), 'sentence': [], } - for s in node.select('p'): + for sentence in s[2:]: sentence = list( map( lambda x: ('b', x.text) if x.name == 'b' else str(x), - s.span.contents + sentence.contents ) ) if isinstance(sentence[-1], str): @@ -282,17 +284,19 @@ def getitem(node) -> {'type': 'item', 'text': '...'}: return exp ret = [] - nodes = data.select('div.tab-content-explanation ul li') - - for node in nodes: - if re.match(r'\d', node.text.strip()): - exp = getitem(node) - else: - exp = { - 'type': 'PoS', # part of speech - 'text': node.text.strip(), - } - ret.append(exp) + explanation_content_node = data.select('div.tab-content-explanation') + for explanations_node in explanation_content_node: + for node in explanations_node.children: + if re.match(r'\d', node.text.strip()): + for n in node.find_all('li'): + exp = getitem(n) + ret.append(exp) + else: + exp = { + 'type': 'PoS', # part of speech + 'text': node.text.strip(), + } + ret.append(exp) return ret From 591a99799d14fb9070f00f3c34b9996f50617ec3 Mon Sep 17 00:00:00 2001 From: shunyi Date: Wed, 22 Apr 2020 23:53:01 +0800 Subject: [PATCH 305/508] Version 3.3.0 + 58d369d [#406] Fix yahoo dict missing example sentences bug (#408) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 4f4753ef..a09e57c6 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.2.0' +VERSION = '3.3.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 66b1dbf79a4969b3986b8043a69dc301b3dbde54 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Fri, 24 Apr 2020 21:32:42 +0800 Subject: [PATCH 306/508] [#407] Fix gnureadline installation on Travis CI with Python 3.6.8 & 3.7.2 (#411) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 702dd8aa..fe6c871a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ before_install: install: - "pip install -U setuptools" # for upgrade issue with setuptools and CPython 3.6 on Travis CI - - "pip install -U pip" + - "pip install -U pip wheel" # Install wheel for gnureadline which used bdist_wheel on Travis CI with Mac OSX environment. - "pip install -U pytest coveralls" - "pip install ." - "pip freeze" From 04451b2da18236da48469938b75651222b347b95 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 25 Apr 2020 16:11:42 +0200 Subject: [PATCH 307/508] Update pytest-flake8 to 1.0.5 (#409) --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 18917e1e..01c14b80 100644 --- a/Pipfile +++ b/Pipfile @@ -19,4 +19,4 @@ flake8 = "==3.7.9" pyjokes = "==0.6.0" pytest = "==5.3.0" pytest-cov = "==2.8.1" -pytest-flake8 = "==1.0.4" +pytest-flake8 = "==1.0.5" diff --git a/requirements-test.txt b/requirements-test.txt index 4b1deac4..7544779e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ flake8==3.7.9 pyjokes==0.6.0 pytest==5.3.0 pytest-cov==2.8.1 -pytest-flake8==1.0.4 +pytest-flake8==1.0.5 From 84d8a1ae446ded72a4986d7bf4ba4e39de468588 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 25 Apr 2020 19:26:41 +0200 Subject: [PATCH 308/508] Update pytest to 5.4.1 (#400) --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 01c14b80..b8e02771 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,6 @@ requests = "==2.22.0" coverage = "==4.5.4" flake8 = "==3.7.9" pyjokes = "==0.6.0" -pytest = "==5.3.0" +pytest = "==5.4.1" pytest-cov = "==2.8.1" pytest-flake8 = "==1.0.5" diff --git a/requirements-test.txt b/requirements-test.txt index 7544779e..dd4d0efa 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==4.5.4 flake8==3.7.9 pyjokes==0.6.0 -pytest==5.3.0 +pytest==5.4.1 pytest-cov==2.8.1 pytest-flake8==1.0.5 From b5775aafada5edc9c102b1c3282556b2d8165be5 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 26 Apr 2020 03:00:06 +0200 Subject: [PATCH 309/508] Update coverage to 5.1 (#404) --- Pipfile | 2 +- requirements-test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index b8e02771..a7e67544 100644 --- a/Pipfile +++ b/Pipfile @@ -14,7 +14,7 @@ requests = "==2.22.0" [dev-packages] -coverage = "==4.5.4" +coverage = "==5.1" flake8 = "==3.7.9" pyjokes = "==0.6.0" pytest = "==5.4.1" diff --git a/requirements-test.txt b/requirements-test.txt index dd4d0efa..b51b3580 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==4.5.4 +coverage==5.1 flake8==3.7.9 pyjokes==0.6.0 pytest==5.4.1 From afe48e8703ad8c73d6614c02c71e464a10548697 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 26 Apr 2020 04:49:17 +0200 Subject: [PATCH 310/508] Update beautifulsoup4 to 4.9.0 (#403) --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index a7e67544..a65c885b 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.8.1" +beautifulsoup4 = "==4.9.0" peewee = "==3.11.2" requests = "==2.22.0" diff --git a/requirements.txt b/requirements.txt index df2ac9ce..891724a1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.8.1 +beautifulsoup4==4.9.0 peewee==3.11.2 requests==2.22.0 From 57c1890a89fb0b6c6d976d367dfdf67b10778f9e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 26 Apr 2020 07:59:46 +0200 Subject: [PATCH 311/508] Update requests to 2.23.0 (#399) --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index a65c885b..ffef7283 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" beautifulsoup4 = "==4.9.0" peewee = "==3.11.2" -requests = "==2.22.0" +requests = "==2.23.0" [dev-packages] diff --git a/requirements.txt b/requirements.txt index 891724a1..01d52b41 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.0 peewee==3.11.2 -requests==2.22.0 +requests==2.23.0 From c7c41acd53631848e5ea268b789c9e5bdf312950 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 26 Apr 2020 16:48:21 +0200 Subject: [PATCH 312/508] Update peewee to 3.13.3 (#410) --- Pipfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index ffef7283..97e579fd 100644 --- a/Pipfile +++ b/Pipfile @@ -8,7 +8,7 @@ name = "pypi" [packages] beautifulsoup4 = "==4.9.0" -peewee = "==3.11.2" +peewee = "==3.13.3" requests = "==2.23.0" diff --git a/requirements.txt b/requirements.txt index 01d52b41..a9da4f3e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.0 -peewee==3.11.2 +peewee==3.13.3 requests==2.23.0 From ae3b9b88266c6b4fd0f669b6f81a2757c382f237 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 16 May 2020 15:54:44 +0800 Subject: [PATCH 313/508] [#413] Fix spanish dict (#417) --- zdict/dictionaries/spanish.py | 149 +++++++++++++++------------------- 1 file changed, 65 insertions(+), 84 deletions(-) diff --git a/zdict/dictionaries/spanish.py b/zdict/dictionaries/spanish.py index c2ba5b47..0a83651c 100644 --- a/zdict/dictionaries/spanish.py +++ b/zdict/dictionaries/spanish.py @@ -34,60 +34,62 @@ def _get_url(self, word) -> str: def show(self, record: Record): content = json.loads(record.content) - self.color.print(content['word'], 'yellow') explains = content.get('explains') - for data in explains: self.color.print(data[0], 'lwhite') # speech for explain in data[1]: self.color.print(explain[0], 'lred') # category - for sentence in explain[1]: - self.color.print( - '{text}'.format(text=sentence[0]), + for t in explain[1]: + # t = (index, (sentence, sentence, ...)) + self.color.print( # index + '{text}'.format(text=t[0]), 'org', indent=2 ) - if len(sentence) > 2: - self.color.print( - '{text}'.format(text=sentence[1]), - 'lindigo', - indent=4 - ) - self.color.print( - '{text}'.format(text=sentence[2]), - 'indigo', - indent=4 - ) + if len(t) > 1: + for sentence in t[1]: + # sentence = (spanish, english) + self.color.print( + '{text}'.format(text=sentence[0]), + 'lindigo', + indent=4 + ) + self.color.print( + '{text}'.format(text=sentence[1]), + 'indigo', + indent=4 + ) print() def query(self, word: str): webpage = self._get_raw(word) - data = BeautifulSoup(webpage, "html.parser") + soup = BeautifulSoup(webpage, "html.parser") content = {} - # word can be existing in both English & Spanish - card = ( - data.find('div', attrs={'id': 'dictionary-neodict-en'}) - or data.find('div', attrs={'id': 'dictionary-neodict-es'}) - ) + en_css = "#dictionary-neodict-en" + es_css = "#dictionary-neodict-es" + card = soup.select_one(en_css) or soup.select_one(es_css) if card is None: raise NotFoundError(word) - word_element = card.find('span', attrs={'class': 'WGK1YbP8'}) + word_css = "div > div:nth-child(1) > span" + word_element = card.select_one(word_css) if word_element is None: raise NotFoundError(word) content['word'] = word_element.text ''' - COPULAR VERB # speech_pattern - # categories_card_pattern - 1. (used to express a permanent quality) # category_text_pattern - a. ser # explanation_order_pattern, explanation_text_pattern - # example_card_pattern + COPULAR VERB # speech + # categories_card + 1. (used to express a permanent quality) # category_text + # explanation + a. ser # index + # examples + # example The ocean is blue. El océano es azul. 2. (used to express a temporary state) @@ -97,75 +99,54 @@ def query(self, word: str): The sky is cloudy. El cielo está nublado. - ... (Another speech pattern if it has.) + ... (Another speech if it has.) ''' - speech_pattern = {'class': '_2xs-UBSR'} - - categories_card_pattern = {'class': 'FyTYrC-y'} - category_text_pattern = {'class': '_1vspKqMZ'} - - explanation_order_pattern = {'class': '_1TgBOcUi'} - explanation_text_pattern = {'class': ['C2TP2MvR', '_1KZoU2hp']} - - example_card_pattern = {'class': 'FyTYrC-y'} + speech_pattern = "div > div:nth-child(2)" + # "#dictionary-neodict-en > div > div:nth-child(2)" # Start to grab content['explains'] = [] - speech = card.find(attrs=speech_pattern) + speech = card.select_one(speech_pattern) while speech: result = [] - speech_text_element = speech.find(['a', 'span']) + speech_text, categories_card = speech.children + speech_text_element = speech_text.find(['a', 'span']) content['explains'].append([speech_text_element.text, result]) - categories_card = speech.find(attrs=categories_card_pattern) for category in categories_card.children: - category_text_element = category.find( - attrs=category_text_pattern - ) + category_text_element, explanations_card = category.children category_text = category_text_element.text explains = [] - explanation_card = category.find(attrs=example_card_pattern) - for explanation in explanation_card.children: - explanation_orders = explanation.find_all( - 'span', - explanation_order_pattern - ) - explanation_texts = ( - explanation.find_all('a', explanation_text_pattern) or - explanation.find_all('span', explanation_text_pattern) - ) - indices = [] - if explanation_orders: - for explanation_order, explanation_text in zip( - explanation_orders, - explanation_texts - ): - indices.append( - "{}{}".format( - explanation_order.text.strip(), - explanation_text.text.strip() - ) - ) - else: - continue - - examples = explanation.find_all(attrs=example_card_pattern) - for (example, index) in zip(examples, indices): - t = example.find_all() - # Should be only 4 elements - # [(whole sentence), text, —, text] - ''' - When Spanish => English, it will show Spanish first. - When English => Spanish, it will show English first. - So, the variables below are not definitely. - ''' - (spanish, english) = (t[1].text, t[3].text) - explains.append((index, spanish, english)) - - if (not examples) and (len(indices) > 0): - for index in indices: + for explanation in explanations_card.children: + for _ in explanation.children: + index_elements, examples = ( + _.contents[:-1], _.contents[-1] + ) + index = ' '.join( + [ + _.text.strip() for _ in index_elements + if _ != ' ' + ] + ) + + if (not examples) and index: explains.append((index,)) + continue + + sentences = [] + for example in examples: + t = example.find_all() + # Should be only 3 elements + # [text, —, text] + ''' + When Spanish => English, it will show Spanish first + When English => Spanish, it will show English first + So, the variables below are not definitely + ''' + sentences.append((t[0].text, t[2].text)) + explains.append((index, sentences)) + result.append([category_text, explains]) speech = speech.next_sibling From 559ce8976697d02a5ec11526e82bd23a24657877 Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 16 May 2020 15:58:00 +0800 Subject: [PATCH 314/508] [Version 3.4.0] - ae3b9b8 [#413] Fix spanish dict (#417) - Drop the by-class-name searching because it changes frequently. - Support more than 1 example sentences - Change the date structure be saved in to database. - Cached data for spanish dict will encounter error with this modified show() function. - c7c41ac Update peewee to 3.13.3 (#410) - 57c1890 Update requests to 2.23.0 (#399) - afe48e8 Update beautifulsoup4 to 4.9.0 (#403) - b5775aa Update coverage to 5.1 (#404) - 84d8a1a Update pytest to 5.4.1 (#400) - 04451b2 Update pytest-flake8 to 1.0.5 (#409) - 66b1dbf [#407] Fix gnureadline installation on Travis CI with Python 3.6.8 & 3.7.2 (#411) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index a09e57c6..cf115c66 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.3.0' +VERSION = '3.4.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 91410f500a4e08759d5ffbbc2b43ac662fa9ef5e Mon Sep 17 00:00:00 2001 From: shunyi Date: Sat, 16 May 2020 16:04:36 +0800 Subject: [PATCH 315/508] [#418] Make pip upgrade to newest version on CircleCI --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb633668..521119ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,9 +56,9 @@ variables: - run: name: install dependencies command: | - pip install --user -U pip python3 -m venv venv . venv/bin/activate + pip install -U pip pip install -r requirements.txt pip install -r requirements-test.txt pip install coveralls @@ -124,9 +124,9 @@ jobs: - run: name: install dependencies command: | - pip install --user -U pip python3 -m venv venv . venv/bin/activate + pip install -U pip pip install -r requirements-test.txt pip install twine From b2edc125e3992acb5dd27668e3f9f3e396a42834 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 29 May 2020 12:05:08 +0800 Subject: [PATCH 316/508] [#418] Fix parse_requirements() for pip >= 20.1 pip 20.1 moved `parse_requirements()` to `pip._vendor.pkg_resources` ref: https://github.com/pypa/pip/blob/1e67c3cc201c3eaf7ac6927954729a01e4c28e45/src/pip/_internal/req/constructors.py#L18 Too many different dependency path for parse_requirements() in different versions of pip. Just write a simple parse_requirements() function by ourselves. --- setup.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/setup.py b/setup.py index bf5a63b8..38fe7652 100644 --- a/setup.py +++ b/setup.py @@ -4,17 +4,17 @@ from setuptools import find_packages, setup from setuptools.command.test import test as TestCommand -try: - # for pip >= 10 - from pip._internal.req import parse_requirements -except ImportError: - # for pip <= 9.0.3 - from pip.req import parse_requirements - ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) +def parse_requirements(filepath): + """ load requirements from a pip requirements file. """ + with open(filepath) as f: + lines = (line.strip() for line in f) + return [line for line in lines if line and not line.startswith('#')] + + def get_zdict_version(): constants_file_path = os.path.join(ROOT_DIR, 'zdict/constants.py') with open(constants_file_path) as constants: @@ -28,14 +28,13 @@ def get_zdict_version(): def get_test_req(): test_requirements = parse_requirements( - os.path.join(ROOT_DIR, 'requirements-test.txt'), session=False + os.path.join(ROOT_DIR, 'requirements-test.txt') ) - test_requires = [str(tr.req) for tr in test_requirements] if not sys.platform.startswith('freebsd'): - test_requires.append('gnureadline==6.3.3') + test_requirements.append('gnureadline==6.3.3') - return test_requires + return test_requirements version = get_zdict_version() @@ -61,18 +60,17 @@ def run_tests(self): install_requirements = parse_requirements( - os.path.join(ROOT_DIR, 'requirements.txt'), session=False + os.path.join(ROOT_DIR, 'requirements.txt') ) -install_requires = [str(ir.req) for ir in install_requirements] if sys.platform == 'darwin' and sys.version_info <= (3, 5): - install_requires.append('gnureadline==6.3.3') + install_requirements.append('gnureadline==6.3.3') setup( packages=find_packages(exclude=['scripts']), scripts=['scripts/zdict'], - install_requires=install_requires, + install_requires=install_requirements, tests_require=get_test_req(), cmdclass={'test': PyTest}, From eee929e07b57cbd684600bf335646e60d2c48642 Mon Sep 17 00:00:00 2001 From: shunyi Date: Fri, 29 May 2020 12:17:28 +0800 Subject: [PATCH 317/508] Version 3.4.1 - [#418] Fix parse_requirements() for pip >= 20.1 - [#418] Make pip upgrade to newest version on CircleCI --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index cf115c66..ecb5d985 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.4.0' +VERSION = '3.4.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From c4b7ee192ec766f3069905f68706019045f82d0c Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Fri, 29 May 2020 23:05:03 +0800 Subject: [PATCH 318/508] Update pytest from 5.4.1 to 5.4.2 (#414) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index b51b3580..57b2f523 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.1 flake8==3.7.9 pyjokes==0.6.0 -pytest==5.4.1 +pytest==5.4.2 pytest-cov==2.8.1 pytest-flake8==1.0.5 From e24af7a1ccea94fa224429eed163039777758b6b Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Fri, 29 May 2020 23:05:18 +0800 Subject: [PATCH 319/508] Update pytest-flake8 from 1.0.5 to 1.0.6 (#416) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 57b2f523..93ce7cd7 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ flake8==3.7.9 pyjokes==0.6.0 pytest==5.4.2 pytest-cov==2.8.1 -pytest-flake8==1.0.5 +pytest-flake8==1.0.6 From e7f2d7ba73fd9914e7b2b96200afd56f421b0600 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 30 May 2020 00:51:50 +0800 Subject: [PATCH 320/508] Update beautifulsoup4 from 4.9.0 to 4.9.1 (#420) Co-authored-by: pyup-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a9da4f3e..ff05f2bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.9.0 +beautifulsoup4==4.9.1 peewee==3.13.3 requests==2.23.0 From daf011095134a9006f93a5d76c4a0aa809924697 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 30 May 2020 00:53:12 +0800 Subject: [PATCH 321/508] Update pytest-cov from 2.8.1 to 2.9.0 (#422) Co-authored-by: pyup-bot From e328f50aa5e7f2ab7bbfcdd059494abdd8ae2602 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 30 May 2020 03:09:00 +0800 Subject: [PATCH 322/508] [#385] Fix Oxford dictionary (#423) Oxford Dicionary updated its API to version 2. URL and format of response json also changed. This commit fixed this. --- zdict/dictionaries/oxford.py | 791 ++++++++++++++- zdict/tests/dictionaries/test_oxford.py | 1182 +++++++++++++++++------ 2 files changed, 1677 insertions(+), 296 deletions(-) diff --git a/zdict/dictionaries/oxford.py b/zdict/dictionaries/oxford.py index 40d3663d..e3ef5fe2 100644 --- a/zdict/dictionaries/oxford.py +++ b/zdict/dictionaries/oxford.py @@ -17,7 +17,7 @@ class OxfordDictionary(DictBase): KEY_FILE = os.path.join(BASE_DIR, 'oxford.key') - API = 'https://od-api.oxforddictionaries.com/api/v1/entries/en/{word}' + API = 'https://od-api.oxforddictionaries.com/api/v2/entries/en/{word}' # https://developer.oxforddictionaries.com/documentation/response-codes status_code = { @@ -55,28 +55,41 @@ def show(self, record: Record): self.color.print(headword['word'], 'lyellow') for lex_ent in headword['lexicalEntries']: - # lexical category print() - self.color.print(lex_ent['lexicalCategory'], 'lred', end='') - - # pronunciation - if 'pronunciations' in lex_ent: - pronunciations = [ - '/' + pronun['phoneticSpelling'] + '/' - for pronun in lex_ent['pronunciations'] - ] - pronunciations_str = ' '.join(pronunciations) - self.color.print(' ' + pronunciations_str) - else: - print() + + # lexical category + if ( + 'lexicalCategory' in lex_ent + and 'text' in lex_ent['lexicalCategory'] + ): + self.color.print( + lex_ent['lexicalCategory']['text'], + 'lred', + end='' + ) # entry idx = 1 for entry in lex_ent['entries']: - for sense in entry['senses']: - line_prefix = '{idx}.'.format(idx=idx) - self._show_sense(sense, line_prefix) - idx += 1 + # pronunciation + if 'pronunciations' in entry: + pronunciations = [ + '/' + pronun['phoneticSpelling'] + '/' + for pronun in entry['pronunciations'] + ] + pronunciations_str = ' '.join(pronunciations) + self.color.print(' ' + pronunciations_str) + else: + print() + + # senses + if 'senses' in entry: + for sense in entry['senses']: + line_prefix = '{idx}.'.format(idx=idx) + self._show_sense(sense, line_prefix) + idx += 1 + else: + print() print() @@ -86,18 +99,21 @@ def _show_sense(self, sense: dict, prefix='', indent=1): # regions if 'regions' in sense: - regions_str = ', '.join(sense['regions']) + regions = [region['text'] for region in sense['regions']] + regions_str = ', '.join(regions) regions_str = '(' + regions_str + ')' self.color.print(regions_str, 'yellow', end=' ') # register if 'registers' in sense: - registers_str = ', '.join(sense['registers']) + registers = [register['text'] for register in sense['registers']] + registers_str = ', '.join(registers) self.color.print(registers_str, 'red', end=' ') # domain if 'domains' in sense: - domains_str = ', '.join(sense['domains']) + domains = [domain['text'] for domain in sense['domains']] + domains_str = ', '.join(domains) domains_str = '(' + domains_str + ') ' self.color.print(domains_str, 'green', end='') @@ -185,3 +201,736 @@ def query(self, word: str): source=self.provider, ) return record + + +# Format of the Response Value +# ref: +""" +{ + "metadata": {}, + "results": [ + { + "id": "string", + "language": "string", + "lexicalEntries": [ + { + "compounds": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "derivativeOf": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "derivatives": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "entries": [ + { + "crossReferenceMarkers": [ + "string" + ], + "crossReferences": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "etymologies": [ + "string" + ], + "grammaticalFeatures": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "homographNumber": "string", + "inflections": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "grammaticalFeatures": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "inflectedForm": "string", + "lexicalCategory": { + "id": "string", + "text": "string" + }, + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "senses": [ + { + "antonyms": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "constructions": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "examples": [ + [ + "string" + ] + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "crossReferenceMarkers": [ + "string" + ], + "crossReferences": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "definitions": [ + "string" + ], + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "etymologies": [ + "string" + ], + "examples": [ + { + "definitions": [ + "string" + ], + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "senseIds": [ + "string" + ], + "text": "string" + } + ], + "id": "string", + "inflections": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "grammaticalFeatures": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "inflectedForm": "string", + "lexicalCategory": { + "id": "string", + "text": "string" + }, + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "shortDefinitions": [ + "string" + ], + "subsenses": [ + {} + ], + "synonyms": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "string" + } + ], + "variantForms": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ] + } + ], + "variantForms": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ] + } + ], + "grammaticalFeatures": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "language": "string", + "lexicalCategory": { + "id": "string", + "text": "string" + }, + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "phrasalVerbs": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "phrases": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "id": "string", + "language": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "text": "string", + "variantForms": [ + { + "domains": [ + { + "id": "string", + "text": "string" + } + ], + "notes": [ + { + "id": "string", + "text": "string", + "type": "string" + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ], + "text": "string" + } + ] + } + ], + "pronunciations": [ + { + "audioFile": "string", + "dialects": [ + "string" + ], + "phoneticNotation": "string", + "phoneticSpelling": "string", + "regions": [ + { + "id": "string", + "text": "string" + } + ], + "registers": [ + { + "id": "string", + "text": "string" + } + ] + } + ], + "type": "string", + "word": "string" + } + ] +} +""" diff --git a/zdict/tests/dictionaries/test_oxford.py b/zdict/tests/dictionaries/test_oxford.py index f2212f19..d03ac90f 100644 --- a/zdict/tests/dictionaries/test_oxford.py +++ b/zdict/tests/dictionaries/test_oxford.py @@ -1,3 +1,4 @@ +# flake8: noqa from pytest import raises from unittest.mock import Mock, mock_open, patch @@ -18,7 +19,7 @@ def test_provider(self): assert self.dict.provider == 'oxford' def test__get_url(self): - uri = 'https://od-api.oxforddictionaries.com/api/v1/entries/en/mock' + uri = 'https://od-api.oxforddictionaries.com/api/v2/entries/en/mock' assert self.dict._get_url('mock') == uri @patch('os.path.exists') @@ -66,292 +67,923 @@ def test_show(self): # the sample response copied from the official website SAMPLE_RESPONSE = """ { - "metadata": {}, - "results": [ - { - "id": "string", - "language": "string", - "lexicalEntries": [ + "id": "string", + "metadata": { + "operation": "retrieve", + "provider": "Oxford University Press", + "schema": "RetrieveEntry" + }, + "results": [ { - "derivativeOf": [ - { - "domains": [ - "string" - ], - "id": "string", - "language": "string", - "regions": [ - "string" - ], - "registers": [ - "string" - ], - "text": "string" - } - ], - "derivatives": [ - { - "domains": [ - "string" - ], - "id": "string", - "language": "string", - "regions": [ - "string" - ], - "registers": [ - "string" - ], - "text": "string" - } - ], - "entries": [ - { - "etymologies": [ - "string" - ], - "grammaticalFeatures": [ + "id": "string", + "language": "en-gb", + "lexicalEntries": [ { - "text": "string", - "type": "string" - } - ], - "homographNumber": "string", - "notes": [ - { - "id": "string", - "text": "string", - "type": "string" - } - ], - "pronunciations": [ - { - "audioFile": "string", - "dialects": [ - "string" - ], - "phoneticNotation": "string", - "phoneticSpelling": "string", - "regions": [ - "string" - ] - } - ], - "senses": [ - { - "crossReferenceMarkers": [ - "string" - ], - "crossReferences": [ - { - "id": "string", - "text": "string", - "type": "string" - } - ], - "definitions": [ - "string" - ], - "domains": [ - "string" - ], - "examples": [ - { - "definitions": [ - "string" - ], - "domains": [ - "string" - ], - "notes": [ + "derivatives": [ { - "id": "string", - "text": "string", - "type": "string" + "id": "stringless", + "text": "stringless" + }, + { + "id": "stringlike", + "text": "stringlike" } - ], - "regions": [ - "string" - ], - "registers": [ - "string" - ], - "senseIds": [ - "string" - ], - "text": "string", - "translations": [ + ], + "entries": [ { - "domains": [ - "string" - ], - "grammaticalFeatures": [ - { - "text": "string", - "type": "string" - } - ], - "language": "string", - "notes": [ - { - "id": "string", - "text": "string", - "type": "string" - } - ], - "regions": [ - "string" - ], - "registers": [ - "string" - ], - "text": "string" + "etymologies": [ + "Old English streng (noun), of Germanic origin; related to German Strang, also to strong. The verb (dating from late Middle English) is first recorded in the senses ‘arrange in a row’ and ‘fit with a string’" + ], + "pronunciations": [ + { + "audioFile": "https://audio.oxforddictionaries.com/en/mp3/string_gb_1.mp3", + "dialects": [ + "British English" + ], + "phoneticNotation": "IPA", + "phoneticSpelling": "strɪŋ" + } + ], + "senses": [ + { + "definitions": [ + "material consisting of threads of cotton, hemp, or other material twisted together to form a thin length" + ], + "examples": [ + { + "text": "unwieldy packs tied up with string" + } + ], + "id": "m_en_gbus1003050.006", + "notes": [ + { + "text": "mass noun", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "material consisting of threads of cotton, hemp" + ], + "subsenses": [ + { + "definitions": [ + "a piece of string used to tie round or attach to something" + ], + "examples": [ + { + "text": "the elephant mask had a trunk you could raise by pulling a string" + } + ], + "id": "m_en_gbus1003050.008", + "notes": [ + { + "text": "count noun", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "piece of string used to tie round or attach to something" + ] + }, + { + "definitions": [ + "a piece of catgut or similar material interwoven with others to form the head of a sports racket." + ], + "domains": [ + { + "id": "sport", + "text": "Sport" + } + ], + "id": "m_en_gbus1003050.011", + "notes": [ + { + "text": "count noun", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "piece of catgut or similar material interwoven with others" + ] + }, + { + "definitions": [ + "a length of catgut or wire on a musical instrument, producing a note by vibration" + ], + "domains": [ + { + "id": "music", + "text": "Music" + } + ], + "examples": [ + { + "text": "the D string broke" + } + ], + "id": "m_en_gbus1003050.012", + "notes": [ + { + "text": "count noun", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "length of catgut or wire on musical instrument" + ] + }, + { + "definitions": [ + "the stringed instruments in an orchestra" + ], + "domains": [ + { + "id": "instrument", + "text": "Instrument" + } + ], + "examples": [ + { + "text": "the blend of the wind-group is less perfect than that of the strings" + } + ], + "id": "m_en_gbus1003050.013", + "notes": [ + { + "text": "strings", + "type": "wordFormNote" + } + ], + "shortDefinitions": [ + "stringed instruments in orchestra" + ], + "synonyms": [ + { + "language": "en", + "text": "stringed instruments" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.006" + } + ] + }, + { + "definitions": [ + "relating to or consisting of stringed instruments" + ], + "examples": [ + { + "text": "a string quartet" + } + ], + "id": "m_en_gbus1003050.015", + "notes": [ + { + "text": "as modifier", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "relating to or consisting of stringed instruments" + ] + } + ], + "synonyms": [ + { + "language": "en", + "text": "twine" + }, + { + "language": "en", + "text": "cord" + }, + { + "language": "en", + "text": "yarn" + }, + { + "language": "en", + "text": "thread" + }, + { + "language": "en", + "text": "strand" + }, + { + "language": "en", + "text": "fibre" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.001" + } + ] + }, + { + "constructions": [ + { + "text": "a string of" + } + ], + "definitions": [ + "a set of things tied or threaded together on a thin cord" + ], + "examples": [ + { + "text": "she wore a string of agates round her throat" + } + ], + "id": "m_en_gbus1003050.018", + "shortDefinitions": [ + "set of things tied or threaded together on thin cord" + ], + "subsenses": [ + { + "constructions": [ + { + "text": "a string of" + } + ], + "definitions": [ + "a sequence of similar items or events" + ], + "examples": [ + { + "text": "a string of burglaries" + } + ], + "id": "m_en_gbus1003050.019", + "shortDefinitions": [ + "sequence of similar items or events" + ], + "synonyms": [ + { + "language": "en", + "text": "series" + }, + { + "language": "en", + "text": "succession" + }, + { + "language": "en", + "text": "chain" + }, + { + "language": "en", + "text": "sequence" + }, + { + "language": "en", + "text": "concatenation" + }, + { + "language": "en", + "text": "run" + }, + { + "language": "en", + "text": "streak" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.003" + } + ] + }, + { + "definitions": [ + "a linear sequence of characters, words, or other data." + ], + "domains": [ + { + "id": "computing", + "text": "Computing" + } + ], + "id": "m_en_gbus1003050.020", + "shortDefinitions": [ + "linear sequence of data" + ] + }, + { + "definitions": [ + "a group of racehorses trained at one stable." + ], + "domains": [ + { + "id": "racing", + "text": "Racing" + } + ], + "id": "m_en_gbus1003050.021", + "shortDefinitions": [ + "group of racehorses trained at one stable" + ] + }, + { + "definitions": [ + "a reserve team or player holding a specified position in an order of preference" + ], + "domains": [ + { + "id": "sport", + "text": "Sport" + } + ], + "examples": [ + { + "text": "the village team held Rangers' second string to a 0–0 draw" + } + ], + "id": "m_en_gbus1003050.022", + "shortDefinitions": [ + "reserve team or player holding specified position in order of preference" + ] + }, + { + "definitions": [ + "a player assigned a specified rank in a team in an individual sport such as squash" + ], + "domains": [ + { + "id": "sport", + "text": "Sport" + } + ], + "examples": [ + { + "text": "Taylor lost to third string Baines" + } + ], + "id": "m_en_gbus1003050.023", + "shortDefinitions": [ + "player assigned specified rank in team in individual sport such as squash" + ] + } + ], + "synonyms": [ + { + "language": "en", + "text": "strand" + }, + { + "language": "en", + "text": "rope" + }, + { + "language": "en", + "text": "necklace" + }, + { + "language": "en", + "text": "rosary" + }, + { + "language": "en", + "text": "chaplet" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.005" + } + ] + }, + { + "definitions": [ + "a tough piece of fibre in vegetables, meat, or other food, such as a tough elongated piece connecting the two halves of a bean pod." + ], + "domains": [ + { + "id": "food", + "text": "Food" + } + ], + "id": "m_en_gbus1003050.025", + "shortDefinitions": [ + "tough piece of fibre in food" + ] + }, + { + "definitions": [ + "a G-string or thong." + ], + "domains": [ + { + "id": "clothing", + "text": "Clothing" + } + ], + "id": "m_en_gbus1003050.027", + "shortDefinitions": [ + "G-string or thong" + ] + }, + { + "crossReferenceMarkers": [ + "short for stringboard" + ], + "crossReferences": [ + { + "id": "stringboard", + "text": "stringboard", + "type": "abbreviation of" + } + ], + "id": "m_en_gbus1003050.029" + }, + { + "definitions": [ + "a hypothetical one-dimensional subatomic particle having the dynamical properties of a flexible loop." + ], + "domains": [ + { + "id": "physics", + "text": "Physics" + } + ], + "id": "m_en_gbus1003050.031", + "shortDefinitions": [ + "hypothetical one-dimensional subatomic particle having dynamical properties of flexible loop" + ], + "subsenses": [ + { + "definitions": [ + "a hypothetical threadlike concentration of energy within the structure of space–time." + ], + "domains": [ + { + "id": "physics", + "text": "Physics" + } + ], + "id": "m_en_gbus1003050.032", + "shortDefinitions": [ + "hypothetical thread-like concentration of energy within structure of space-time" + ], + "variantForms": [ + { + "text": "cosmic string" + } + ] + } + ] + } + ] } - ] - } - ], - "id": "string", - "notes": [ - { - "id": "string", - "text": "string", - "type": "string" - } - ], - "pronunciations": [ - { - "audioFile": "string", - "dialects": [ - "string" - ], - "phoneticNotation": "string", - "phoneticSpelling": "string", - "regions": [ - "string" - ] - } - ], - "regions": [ - "string" - ], - "registers": [ - "string" - ], - "short_definitions": [ - "string" - ], - "subsenses": [ - {} - ], - "thesaurusLinks": [ - { - "entry_id": "string", - "sense_id": "string" - } - ], - "translations": [ - { - "domains": [ - "string" - ], - "grammaticalFeatures": [ + ], + "language": "en-gb", + "lexicalCategory": { + "id": "noun", + "text": "Noun" + }, + "phrasalVerbs": [ + { + "id": "string_along", + "text": "string along" + }, { - "text": "string", - "type": "string" + "id": "string_out", + "text": "string out" + }, + { + "id": "string_together", + "text": "string together" + }, + { + "id": "string_up", + "text": "string up" } - ], - "language": "string", - "notes": [ + ], + "phrases": [ + { + "id": "how_long_is_a_piece_of_string%3F", + "text": "how long is a piece of string?" + }, + { + "id": "no_strings_attached", + "text": "no strings attached" + }, { - "id": "string", - "text": "string", - "type": "string" + "id": "on_a_string", + "text": "on a string" } - ], - "regions": [ - "string" - ], - "registers": [ - "string" - ], - "text": "string" - } - ], - "variantForms": [ - { - "regions": [ - "string" - ], - "text": "string" - } - ] - } - ], - "variantForms": [ + ], + "text": "string" + }, { - "regions": [ - "string" - ], - "text": "string" + "derivatives": [ + { + "id": "stringless", + "text": "stringless" + }, + { + "id": "stringlike", + "text": "stringlike" + } + ], + "entries": [ + { + "inflections": [ + { + "grammaticalFeatures": [ + { + "id": "pastParticiple", + "text": "Past Participle", + "type": "Non Finiteness" + }, + { + "id": "past", + "text": "Past", + "type": "Tense" + } + ], + "inflectedForm": "strung", + "pronunciations": [ + { + "audioFile": "https://audio.oxforddictionaries.com/en/mp3/strung_gb_1.mp3", + "dialects": [ + "British English" + ], + "phoneticNotation": "IPA", + "phoneticSpelling": "strʌŋ" + } + ] + } + ], + "pronunciations": [ + { + "audioFile": "https://audio.oxforddictionaries.com/en/mp3/string_gb_1.mp3", + "dialects": [ + "British English" + ], + "phoneticNotation": "IPA", + "phoneticSpelling": "strɪŋ" + } + ], + "senses": [ + { + "definitions": [ + "hang (something) so that it stretches in a long line" + ], + "examples": [ + { + "text": "lights were strung across the promenade" + } + ], + "id": "m_en_gbus1003050.041", + "notes": [ + { + "text": "with object and adverbial", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "hang something so that it stretches in long line" + ], + "subsenses": [ + { + "definitions": [ + "thread (a series of small objects) on a string" + ], + "examples": [ + { + "text": "he collected stones with holes in them and strung them on a strong cord" + } + ], + "id": "m_en_gbus1003050.047", + "shortDefinitions": [ + "thread series of small objects on string" + ], + "synonyms": [ + { + "language": "en", + "text": "thread" + }, + { + "language": "en", + "text": "loop" + }, + { + "language": "en", + "text": "link" + }, + { + "language": "en", + "text": "join" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.010" + } + ] + }, + { + "definitions": [ + "be arranged in a long line" + ], + "examples": [ + { + "text": "the houses were strung along the road" + } + ], + "id": "m_en_gbus1003050.048", + "notes": [ + { + "text": "be strung", + "type": "wordFormNote" + } + ], + "shortDefinitions": [ + "be arranged in long line" + ], + "synonyms": [ + { + "language": "en", + "text": "spread out" + }, + { + "language": "en", + "text": "space out" + }, + { + "language": "en", + "text": "set apart" + }, + { + "language": "en", + "text": "place at intervals" + }, + { + "language": "en", + "text": "distribute" + }, + { + "language": "en", + "text": "extend" + }, + { + "language": "en", + "text": "fan out" + }, + { + "language": "en", + "text": "scatter" + }, + { + "language": "en", + "text": "straggle" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string_something_out", + "sense_id": "t_en_gb0014229.014" + } + ] + } + ], + "synonyms": [ + { + "language": "en", + "text": "hang" + }, + { + "language": "en", + "text": "suspend" + }, + { + "language": "en", + "text": "sling" + }, + { + "language": "en", + "text": "stretch" + }, + { + "language": "en", + "text": "stretch" + }, + { + "language": "en", + "text": "sling" + }, + { + "language": "en", + "text": "run" + }, + { + "language": "en", + "text": "fasten" + }, + { + "language": "en", + "text": "tie" + }, + { + "language": "en", + "text": "secure" + }, + { + "language": "en", + "text": "link" + } + ], + "thesaurusLinks": [ + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.008" + }, + { + "entry_id": "string", + "sense_id": "t_en_gb0014229.009" + } + ] + }, + { + "definitions": [ + "fit a string or strings to (a musical instrument, a racket, or a bow)" + ], + "examples": [ + { + "text": "the harp had been newly strung" + } + ], + "id": "m_en_gbus1003050.052", + "notes": [ + { + "text": "with object", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "fit string or strings to" + ] + }, + { + "definitions": [ + "remove the strings from (a bean)." + ], + "id": "m_en_gbus1003050.054", + "notes": [ + { + "text": "with object", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "remove strings from" + ] + }, + { + "definitions": [ + "hoax or trick (someone)" + ], + "domains": [ + { + "id": "billiards", + "text": "Billiards" + } + ], + "examples": [ + { + "text": "I'm not stringing you—I'll eat my shirt if it's not true" + } + ], + "id": "m_en_gbus1003050.056", + "notes": [ + { + "text": "with object", + "type": "grammaticalNote" + } + ], + "regions": [ + { + "id": "north_american", + "text": "North_American" + } + ], + "registers": [ + { + "id": "informal", + "text": "Informal" + } + ], + "shortDefinitions": [ + "hoax or trick" + ] + }, + { + "definitions": [ + "work as a stringer in journalism" + ], + "domains": [ + { + "id": "journalism", + "text": "Journalism" + } + ], + "examples": [ + { + "text": "he strings for almost every French radio service" + } + ], + "id": "m_en_gbus1003050.058", + "notes": [ + { + "text": "no object", + "type": "grammaticalNote" + } + ], + "registers": [ + { + "id": "informal", + "text": "Informal" + } + ], + "shortDefinitions": [ + "work as stringer in journalism" + ] + }, + { + "definitions": [ + "determine the order of play by striking the cue ball from baulk to rebound off the top cushion, first stroke going to the player whose ball comes to rest nearer the bottom cushion." + ], + "domains": [ + { + "id": "billiards", + "text": "Billiards" + } + ], + "id": "m_en_gbus1003050.060", + "notes": [ + { + "text": "no object", + "type": "grammaticalNote" + } + ], + "shortDefinitions": [ + "determine order of play by striking cue ball from baulk to rebound off top cushion" + ] + } + ] + } + ], + "language": "en-gb", + "lexicalCategory": { + "id": "verb", + "text": "Verb" + }, + "phrasalVerbs": [ + { + "id": "string_along", + "text": "string along" + }, + { + "id": "string_out", + "text": "string out" + }, + { + "id": "string_together", + "text": "string together" + }, + { + "id": "string_up", + "text": "string up" + } + ], + "phrases": [ + { + "id": "how_long_is_a_piece_of_string%3F", + "text": "how long is a piece of string?" + }, + { + "id": "no_strings_attached", + "text": "no strings attached" + }, + { + "id": "on_a_string", + "text": "on a string" + } + ], + "text": "string" } - ] - } - ], - "grammaticalFeatures": [ - { - "text": "string", - "type": "string" - } - ], - "language": "string", - "lexicalCategory": "string", - "notes": [ - { - "id": "string", - "text": "string", - "type": "string" - } - ], - "pronunciations": [ - { - "audioFile": "string", - "dialects": [ - "string" - ], - "phoneticNotation": "string", - "phoneticSpelling": "string", - "regions": [ - "string" - ] - } - ], - "text": "string", - "variantForms": [ - { - "regions": [ - "string" - ], - "text": "string" - } - ] - } - ], - "pronunciations": [ - { - "audioFile": "string", - "dialects": [ - "string" - ], - "phoneticNotation": "string", - "phoneticSpelling": "string", - "regions": [ - "string" - ] + ], + "type": "headword", + "word": "string" } - ], - "type": "string", - "word": "string" - } - ] + ], + "word": "string" } """ From 0cc556dddd7090f1bad3dec2ce172c7627266d14 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 30 May 2020 03:10:24 +0800 Subject: [PATCH 323/508] Version 3.5.0 - Major update - [#385] Fix Oxford dictionary (#423) - Dependencies updat - Update pytest-cov from 2.8.1 to 2.9.0 (#422) - Update beautifulsoup4 from 4.9.0 to 4.9.1 (#420) - Update pytest-flake8 from 1.0.5 to 1.0.6 (#416) - Update pytest from 5.4.1 to 5.4.2 (#414) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index ecb5d985..988f0ba5 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.4.1' +VERSION = '3.5.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From e31b8d95bf445aedb665415bc5d2c4f55d0893e0 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 31 May 2020 17:21:36 +0800 Subject: [PATCH 324/508] Fix for pyup bot missings [#422, #420, #416, #414] pyup bot didn't modify Pipfile. --- Pipfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 97e579fd..5dd59f65 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ name = "pypi" [packages] -beautifulsoup4 = "==4.9.0" +beautifulsoup4 = "==4.9.1" peewee = "==3.13.3" requests = "==2.23.0" @@ -17,6 +17,6 @@ requests = "==2.23.0" coverage = "==5.1" flake8 = "==3.7.9" pyjokes = "==0.6.0" -pytest = "==5.4.1" -pytest-cov = "==2.8.1" -pytest-flake8 = "==1.0.5" +pytest = "==5.4.2" +pytest-cov = "==2.9.0" +pytest-flake8 = "==1.0.6" From c4fb29c8914818a610cbed54244e36d4bcc5ecdc Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 31 May 2020 11:41:50 +0200 Subject: [PATCH 325/508] Update pytest-cov to 2.9.0 (#424) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 93ce7cd7..e75210b2 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.1 flake8==3.7.9 pyjokes==0.6.0 pytest==5.4.2 -pytest-cov==2.8.1 +pytest-cov==2.9.0 pytest-flake8==1.0.6 From 6b169ce09eb5a8db444c8160516b0f41a590a78a Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 31 May 2020 17:42:37 +0800 Subject: [PATCH 326/508] [#425] Remove Pipfile and Pipfile.lock (#426) --- .circleci/config.yml | 8 +- .pyup.yml | 1 - Pipfile | 22 ---- Pipfile.lock | 245 ------------------------------------------- 4 files changed, 4 insertions(+), 272 deletions(-) delete mode 100644 Pipfile delete mode 100644 Pipfile.lock diff --git a/.circleci/config.yml b/.circleci/config.yml index 521119ca..a31faa07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,7 +51,7 @@ variables: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - run: name: install dependencies @@ -66,7 +66,7 @@ variables: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - run: name: run tests @@ -119,7 +119,7 @@ jobs: - restore_cache: keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} + - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - run: name: install dependencies @@ -133,7 +133,7 @@ jobs: - save_cache: paths: - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }}-{{ checksum "Pipfile" }} + key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - run: diff --git a/.pyup.yml b/.pyup.yml index d1ccac56..d7347999 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -3,4 +3,3 @@ requirements: - requirements.txt - test-requirements.txt - - Pipfile diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 5dd59f65..00000000 --- a/Pipfile +++ /dev/null @@ -1,22 +0,0 @@ -[[source]] - -url = "https://pypi.python.org/simple" -verify_ssl = true -name = "pypi" - - -[packages] - -beautifulsoup4 = "==4.9.1" -peewee = "==3.13.3" -requests = "==2.23.0" - - -[dev-packages] - -coverage = "==5.1" -flake8 = "==3.7.9" -pyjokes = "==0.6.0" -pytest = "==5.4.2" -pytest-cov = "==2.9.0" -pytest-flake8 = "==1.0.6" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index 9d277332..00000000 --- a/Pipfile.lock +++ /dev/null @@ -1,245 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "298be599d454d99040878076586fdd45a13be917cf18120657aed941b8c1e999" - }, - "pipfile-spec": 6, - "requires": {}, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.python.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "beautifulsoup4": { - "hashes": [ - "sha256:034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", - "sha256:945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", - "sha256:ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718" - ], - "index": "pypi", - "version": "==4.7.1" - }, - "certifi": { - "hashes": [ - "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", - "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" - ], - "version": "==2019.6.16" - }, - "chardet": { - "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" - ], - "version": "==3.0.4" - }, - "idna": { - "hashes": [ - "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", - "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" - ], - "version": "==2.8" - }, - "peewee": { - "hashes": [ - "sha256:bc879e1ffb7f7684f90d9dd236c77b5042118d079f94764f35e3806948829ac8" - ], - "version": "==3.9.6" - }, - "requests": { - "hashes": [ - "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", - "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" - ], - "version": "==2.22.0" - }, - "soupsieve": { - "hashes": [ - "sha256:6898e82ecb03772a0d82bd0d0a10c0d6dcc342f77e0701d0ec4a8271be465ece", - "sha256:b20eff5e564529711544066d7dc0f7661df41232ae263619dede5059799cdfca" - ], - "version": "==1.9.1" - }, - "urllib3": { - "hashes": [ - "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4", - "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb" - ], - "version": "==1.24.3" - } - }, - "develop": { - "atomicwrites": { - "hashes": [ - "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", - "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" - ], - "version": "==1.3.0" - }, - "attrs": { - "hashes": [ - "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", - "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" - ], - "version": "==19.1.0" - }, - "coverage": { - "hashes": [ - "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", - "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", - "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", - "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", - "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", - "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", - "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", - "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", - "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", - "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", - "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", - "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", - "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", - "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", - "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", - "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", - "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", - "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", - "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", - "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", - "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", - "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", - "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", - "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", - "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", - "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", - "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", - "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", - "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", - "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", - "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" - ], - "index": "pypi", - "version": "==4.5.3" - }, - "entrypoints": { - "hashes": [ - "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", - "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" - ], - "version": "==0.3" - }, - "flake8": { - "hashes": [ - "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", - "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" - ], - "index": "pypi", - "version": "==3.7.7" - }, - "importlib-metadata": { - "hashes": [ - "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", - "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" - ], - "version": "==0.18" - }, - "mccabe": { - "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" - ], - "version": "==0.6.1" - }, - "more-itertools": { - "hashes": [ - "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", - "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" - ], - "markers": "python_version > '2.7'", - "version": "==7.0.0" - }, - "pluggy": { - "hashes": [ - "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", - "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" - ], - "version": "==0.12.0" - }, - "py": { - "hashes": [ - "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", - "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" - ], - "version": "==1.8.0" - }, - "pycodestyle": { - "hashes": [ - "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", - "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" - ], - "version": "==2.5.0" - }, - "pyflakes": { - "hashes": [ - "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", - "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" - ], - "version": "==2.1.1" - }, - "pyjokes": { - "hashes": [ - "sha256:01b90474d5c889c21cae88f0d5fc8db1334b2891a16df75cbf9a0886bfdea653", - "sha256:745299c99b7a4015251b4876ecd59dd62803f458a9f0540d036f0f6627dcc67e" - ], - "index": "pypi", - "version": "==0.5.0" - }, - "pytest": { - "hashes": [ - "sha256:4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", - "sha256:926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da" - ], - "version": "==4.6.3" - }, - "pytest-cov": { - "hashes": [ - "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6", - "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a" - ], - "index": "pypi", - "version": "==2.7.1" - }, - "pytest-flake8": { - "hashes": [ - "sha256:4d225c13e787471502ff94409dcf6f7927049b2ec251c63b764a4b17447b60c0", - "sha256:d7e2b6b274a255b7ae35e9224c85294b471a83b76ecb6bd53c337ae977a499af" - ], - "index": "pypi", - "version": "==1.0.4" - }, - "six": { - "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" - ], - "version": "==1.12.0" - }, - "wcwidth": { - "hashes": [ - "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", - "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" - ], - "version": "==0.1.7" - }, - "zipp": { - "hashes": [ - "sha256:8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", - "sha256:ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3" - ], - "version": "==0.5.1" - } - } -} From 87583e5e5af327229b4a4e4cfc8d4ed8c5c1bf5a Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 31 May 2020 19:00:31 +0800 Subject: [PATCH 327/508] Update flake8 from 3.7.9 to 3.8.2 (#421) Co-authored-by: pyup-bot --- requirements-test.txt | 2 +- zdict/dictionaries/yahoo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-test.txt b/requirements-test.txt index e75210b2..a042433e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==5.1 -flake8==3.7.9 +flake8==3.8.2 pyjokes==0.6.0 pytest==5.4.2 pytest-cov==2.9.0 diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index d73e0c32..be5cd911 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -258,7 +258,7 @@ def get_grammar(d: bs4.element.Tag): } def parse_explain(self, data): - def getitem(node) -> {'type': 'item', 'text': '...'}: + def getitem(node): # This method will glitch when there are more the one sentence. s = node.find_all('span') # s should be ['${index}', '${meaning}', '${example_sentence}'] From 402604226e830b705afb0583c0b8304ea1763020 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 31 May 2020 19:05:26 +0800 Subject: [PATCH 328/508] Version 3.5.1 - Fix for correct dependency versions - Don't support pipenv anymore. (Remove Pipfile and Pipfile.lock) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 988f0ba5..a365cfd4 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.5.0' +VERSION = '3.5.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 38469af8ef71bff8c6d6336f1a7fb4543938f800 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 1 Jun 2020 18:24:18 +0800 Subject: [PATCH 329/508] [#427] Cache $HOME/.pyenv for Travis CI build --- .travis.yml | 5 +++++ ci/install_python_for_osx.sh | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fe6c871a..09585184 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: python +cache: + directories: + - $HOME/.pyenv + - $HOME/venv + jobs: fast_finish: true diff --git a/ci/install_python_for_osx.sh b/ci/install_python_for_osx.sh index cc7ddd48..e14f0882 100755 --- a/ci/install_python_for_osx.sh +++ b/ci/install_python_for_osx.sh @@ -2,7 +2,13 @@ set -ev -curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash +# if $HOME/.pyenv is empty, remove it so it can be installed by pyenv-installer +# because Travis CI cache will create $HOME/.pyenv, +# but pyenv-installer won't install if $HOME/.pyenv exists even if it's empty. +if [ -z "$(ls -A $HOME/.pyenv)" ]; then + rmdir $HOME/.pyenv; + curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash; +fi # Make it use openssl only brew uninstall --ignore-dependencies openssl@1.1 From 1fab1cda5ea15a88d2c35e44f0bba908b0e13e01 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 1 Jun 2020 18:28:26 +0800 Subject: [PATCH 330/508] [Travis CI] Rearrange pip install related commands - Remove double quotes for pip commands. - pytest should be installed by "pip install -r requirements-test.txt". --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 09585184..7d6f45be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,11 +32,11 @@ before_install: - python --version # Check the specifically installed Python version install: - - "pip install -U setuptools" # for upgrade issue with setuptools and CPython 3.6 on Travis CI - - "pip install -U pip wheel" # Install wheel for gnureadline which used bdist_wheel on Travis CI with Mac OSX environment. - - "pip install -U pytest coveralls" - - "pip install ." - - "pip freeze" + - pip install -U pip wheel # Install wheel for gnureadline which used bdist_wheel on Travis CI with Mac OSX environment. + - pip install -U setuptools # for upgrade issue with setuptools and CPython 3.6 on Travis CI + - pip install . # Should use this command, not `pip install -r requirements.txt` because there is OS-related dependency in setup.py for OSX + - pip install -U coveralls + - pip freeze script: - python setup.py test From 467e5efd23f9a8d0aaa8c90d25867ca100fbb961 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 1 Jun 2020 19:32:38 +0800 Subject: [PATCH 331/508] [#427] Make pyenv skip installation if the version has be installed --- ci/install_python_for_osx.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/install_python_for_osx.sh b/ci/install_python_for_osx.sh index e14f0882..c16b2abb 100755 --- a/ci/install_python_for_osx.sh +++ b/ci/install_python_for_osx.sh @@ -16,8 +16,8 @@ brew uninstall --ignore-dependencies openssl@1.1 # print openssl path brew --prefix openssl -# Install specific version of Python via pyenv -~/.pyenv/bin/pyenv install -v $PYTHON_VERSION +# Install specific version of Python via pyenv if it hasn't be installed. +~/.pyenv/bin/pyenv install --skip-existing -v $PYTHON_VERSION # Create venv with the specific Python version ~/.pyenv/versions/$PYTHON_VERSION/bin/python3 -m venv ~/venv From 1fc2a948727800da9c6c692e8dfb163e8e1348e0 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 1 Jun 2020 21:11:07 +0800 Subject: [PATCH 332/508] [#430] Remove testing requirements in deploy stage for CircleCI (#431) --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a31faa07..5028a63f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -127,7 +127,6 @@ jobs: python3 -m venv venv . venv/bin/activate pip install -U pip - pip install -r requirements-test.txt pip install twine - save_cache: From 37d0835fe8c79fb1d829d5faf85d8bcc4796c2a3 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 1 Jun 2020 21:12:04 +0800 Subject: [PATCH 333/508] Version 3.5.2 - 1fc2a94 [#430] Remove testing requirements in deploy stage for CircleCI (#431) - db3586c Merge pull request #429 from zdict/issue-427 - 467e5ef [#427] Make pyenv skip - installation if the version has be installed - 1fab1cd [Travis CI] Rearrange pip install related commands - 38469af [#427] Cache $HOME/.pyenv for Travis CI build --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index a365cfd4..6d0aa823 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.5.1' +VERSION = '3.5.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From d2ea4fd16996b39df28cc566e1f9e0a1aa33961c Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 2 Jun 2020 15:10:27 +0800 Subject: [PATCH 334/508] [README] Add zdict_jupyter into Related Projects --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9ff66d82..08123798 100644 --- a/README.rst +++ b/README.rst @@ -282,6 +282,8 @@ Related Projects * A vim plugin integrates with zdict. * `zdict.sh `_ * A collection of shell completion scripts for zdict. +* `zdict_jupyter `_ + * Use zdict in Jupyter Notebook. Stargazers over time @@ -331,7 +333,7 @@ Stargazers over time .. |stargazers| image:: https://starcharts.herokuapp.com/zdict/zdict.svg :target: https://starcharts.herokuapp.com/zdict/zdict - + .. |docker automated build| image:: https://img.shields.io/docker/automated/zdict/zdict :target: https://hub.docker.com/r/zdict/zdict From e28299d9a007f614b660101b3b86bff2b55f9050 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 2 Jun 2020 17:43:31 +0800 Subject: [PATCH 335/508] [#428] Depracate `python setup.py test` - Use `py.test` - Add `make test` and `make test-with-pdb` into Makefile - Make Travis CI and CircleCI use `make test` while testing - So we just have to modify Makefile if execute command for testing need to be changed in the future. - Update README - Remove `python setup.py test` related code in setup.py --- .circleci/config.yml | 2 +- .travis.yml | 2 +- Makefile | 5 ++++- README.rst | 15 +++++++++------ setup.py | 21 --------------------- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5028a63f..2c884c5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,7 +72,7 @@ variables: name: run tests command: | . venv/bin/activate - python setup.py test + make test - store_test_results: path: test-reports diff --git a/.travis.yml b/.travis.yml index 7d6f45be..9f5a066b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ install: - pip freeze script: - - python setup.py test + - make test after_success: - coveralls diff --git a/Makefile b/Makefile index a289a58d..3e4db430 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,10 @@ clean: clean-pyc clean-vim-swap-files rm -rf build dist htmlcov .coverage* .cache .eggs test: - python setup.py test + py.test + +test-with-pdb: + py.test --pdb # Make docker-zdict don't complain about no make rules for apple, bird, ... %: diff --git a/README.rst b/README.rst index 08123798..3c4c782f 100644 --- a/README.rst +++ b/README.rst @@ -228,17 +228,20 @@ If you use `virtualenv`, you may want to create a new enviroment for `zdict`:: Once you installed it with the command above, just execute `zdict` after modification. -Don't need to install it again. +No need to install it again. -We use ``py.test``:: +Install the packages for testing:: $ pip install pytest pytest-cov coverage - $ python setup.py test -or:: +We use ``py.test``:: $ py.test +or:: + + $ make test + After runing testing, we will get a coverage report in html. We can browse around it:: @@ -254,11 +257,11 @@ Debugging ``py.test`` can prompt ``pdb`` shell when your test case failed:: - $ python setup.py test -a "--pdb" + $ py.test --pdb or:: - $ py.test --pdb + $ make test-with-pdb Bug Report diff --git a/setup.py b/setup.py index 38fe7652..dceafe21 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ import os from setuptools import find_packages, setup -from setuptools.command.test import test as TestCommand ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -40,25 +39,6 @@ def get_test_req(): version = get_zdict_version() -class PyTest(TestCommand): - user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = [] - - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - # import here, cause outside the eggs aren't loaded - import pytest - errno = pytest.main(self.pytest_args) - sys.exit(errno) - - install_requirements = parse_requirements( os.path.join(ROOT_DIR, 'requirements.txt') ) @@ -72,7 +52,6 @@ def run_tests(self): scripts=['scripts/zdict'], install_requires=install_requirements, tests_require=get_test_req(), - cmdclass={'test': PyTest}, name='zdict', version=version, From d8d97db503534227d9c498cde3a2b38cb611bad9 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 2 Jun 2020 17:50:40 +0800 Subject: [PATCH 336/508] [Travis CI] Install require packages for testing --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9f5a066b..104208a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ install: - pip freeze script: + - pip install -r requirements-test.txt - make test after_success: From 3d09189e0360e78882483a3707a574794756c587 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 2 Jun 2020 18:15:16 +0800 Subject: [PATCH 337/508] [Travis CI] Purge some files before uploading cache Delete *.pyo, *.pyc files and __pycaches__ dirs before upload cache --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 104208a4..eed9f19d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,13 @@ script: - pip install -r requirements-test.txt - make test +before_cache: + # Remove __pycahce__ dirs and *.pyc, *.pyo files before uploading cache. + # Which will changes between every single builds. + # This could make Travis CI don't upload cache every time. + - python3 -Bc "import pathlib; [p.unlink() for p in pathlib.Path('$HOME/venv').rglob('*.py[co]')]" + - python3 -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('$HOME/venv').rglob('__pycache__')]" + after_success: - coveralls From 95e7592c3b9537ee6e7b90041dff267c65526cf1 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 2 Jun 2020 19:03:18 +0800 Subject: [PATCH 338/508] [CircleCI] Fix typo in config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c884c5f..756a5883 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,4 @@ -# eython CircleCI 2.0 configuration file +# Python CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-python/ for more details # From 9a7d6b5deb3cab3478d9495941a54b16d62eb125 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 3 Jun 2020 19:43:06 +0800 Subject: [PATCH 339/508] [#405] Add python 3.8 support - Testing environments - Travis CI - CircleCI - Doc - setup.py - For description on PyPI. --- .circleci/config.yml | 11 +++++++++++ .travis.yml | 4 ++++ setup.py | 1 + 3 files changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 756a5883..af7fecca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,10 @@ workflows: version: 2 build-test-deploy: jobs: + - linux-python-3.8: + filters: + tags: + only: /.*/ - linux-python-3.7: filters: tags: @@ -21,6 +25,7 @@ workflows: only: /.*/ - deploy: requires: + - linux-python-3.8 - linux-python-3.7 - linux-python-3.6 - linux-python-3.5 @@ -39,6 +44,7 @@ workflows: branches: only: master jobs: + - linux-python-3.8 - linux-python-3.7 - linux-python-3.6 - linux-python-3.5 @@ -92,6 +98,11 @@ variables: jobs: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + linux-python-3.8: + <<: *test-template + docker: + - image: circleci/python:3.8 + linux-python-3.7: <<: *test-template docker: diff --git a/.travis.yml b/.travis.yml index eed9f19d..c9fe586b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,10 @@ jobs: os: osx language: generic env: PYTHON_VERSION=3.7.2 + - stage: test + os: osx + language: generic + env: PYTHON_VERSION=3.8.2 before_install: # workaround for Travis CI stdout write error diff --git a/setup.py b/setup.py index dceafe21..15e314be 100644 --- a/setup.py +++ b/setup.py @@ -85,6 +85,7 @@ def get_test_req(): "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Utilities", ], ) From 1271c71f3bb9f136562996224f6d005bcd2dd3ac Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 3 Jun 2020 15:33:24 +0200 Subject: [PATCH 340/508] Update pytest to 5.4.3 (#433) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index a042433e..f284e9d4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.1 flake8==3.8.2 pyjokes==0.6.0 -pytest==5.4.2 +pytest==5.4.3 pytest-cov==2.9.0 pytest-flake8==1.0.6 From d7dee117d67cc731951b550282d075e551d16499 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 3 Jun 2020 20:38:21 +0800 Subject: [PATCH 341/508] [Travis CI] Make new Python version build first Newer Python version should be place at first to make it build earlier. Because when you add new Python version, it takes time for installing pyenv due to there is no cache for pyenv. --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9fe586b..d03d5876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,22 +10,24 @@ jobs: include: # Python runtime is not yet available on OS X # https://github.com/travis-ci/travis-ci/issues/2312 + # Newer Python version should be place at first to make it build earlier. + # Because when you add new Python version, it takes time for installing pyenv due to there is no cache for pyenv. - stage: test os: osx language: generic - env: PYTHON_VERSION=3.5.6 + env: PYTHON_VERSION=3.8.2 - stage: test os: osx language: generic - env: PYTHON_VERSION=3.6.8 + env: PYTHON_VERSION=3.7.2 - stage: test os: osx language: generic - env: PYTHON_VERSION=3.7.2 + env: PYTHON_VERSION=3.6.8 - stage: test os: osx language: generic - env: PYTHON_VERSION=3.8.2 + env: PYTHON_VERSION=3.5.6 before_install: # workaround for Travis CI stdout write error From 6cb88a2c148c3f66fb6fd3d30e517980827fe10c Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 3 Jun 2020 21:35:51 +0800 Subject: [PATCH 342/508] Version 3.5.3 - d7dee11 [Travis CI] Make new Python version build first - 1271c71 Update pytest to 5.4.3 (#433) - 3154884 Merge pull request #434 from zdict/issue-405 - 9a7d6b5 (origin/issue-405, issue-405) [#405] Add python 3.8 support - f8456d6 Merge pull request #432 from zdict/issue-428 - 95e7592 (origin/issue-428, issue-428) [CircleCI] Fix typo in config - 3d09189 [Travis CI] Purge some files before uploading cache - d8d97db [Travis CI] Install require packages for testing - e28299d [#428] Depracate `python setup.py test` - d2ea4fd [README] Add zdict_jupyter into Related Projects --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 6d0aa823..eae49494 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.5.2' +VERSION = '3.5.3' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 2ccad0baf60a5c6f9dceafa5f2c7203ef88aa6e4 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 3 Jun 2020 22:00:56 +0800 Subject: [PATCH 343/508] [CircleCI] Enable pipelines for CircleCI 2.0 config --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index af7fecca..d0639859 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,8 @@ # Check https://circleci.com/docs/2.0/language-python/ for more details # version: 2 +experimental: + pipelines: true workflows: version: 2 build-test-deploy: From 72c63583f8c8de1036d0006749b022fd9e77ac07 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 4 Jun 2020 14:53:37 +0800 Subject: [PATCH 344/508] [CircleCI] Upload to PyPI via token No need to use my account and password anymore. ref: --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d0639859..5d1264d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -152,8 +152,8 @@ jobs: name: init .pypirc command: | echo -e "[pypi]" >> ~/.pypirc - echo -e "username = M157q" >> ~/.pypirc - echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + echo -e "username = __token__" >> ~/.pypirc + echo -e "password = $PYPI_TOKEN" >> ~/.pypirc - run: name: create packages From 7acc3f662f1b0d75037b273719d23779462fb5c0 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 4 Jun 2020 15:27:33 +0800 Subject: [PATCH 345/508] [Dockerfile] Change from python:3.6.3-alpine to python:3.8-alpine --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 45a71d25..2f5498e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6.5-alpine +FROM python:3.8-alpine WORKDIR /srv/work/ ADD . /srv/work/ From 364bc7e872a0d40ec11abd704d5133a533a51af8 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 4 Jun 2020 15:29:46 +0800 Subject: [PATCH 346/508] Version 3.5.4 - 7acc3f6 [Dockerfile] Change from python:3.6.3-alpine to python:3.8-alpine - 72c6358 [CircleCI] Upload to PyPI via token - 2ccad0b [CircleCI] Enable pipelines for CircleCI 2.0 config --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index eae49494..2872fa21 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.5.3' +VERSION = '3.5.4' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 07f57cb26087df752d25e44807fcce00f42ea9cd Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 9 Jun 2020 14:21:02 +0800 Subject: [PATCH 347/508] [README] Change command for installing testing deps Also add a rule "install-test-deps" for this instruction. --- Makefile | 2 ++ README.rst | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3e4db430..3f6c709b 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,8 @@ clean-vim-swap-files: clean: clean-pyc clean-vim-swap-files rm -rf build dist htmlcov .coverage* .cache .eggs +install-test-deps: + pip install -r requirements-test.txt test: py.test diff --git a/README.rst b/README.rst index 3c4c782f..8488f75a 100644 --- a/README.rst +++ b/README.rst @@ -232,9 +232,13 @@ No need to install it again. Install the packages for testing:: - $ pip install pytest pytest-cov coverage + $ pip install -r requirements-test.txt -We use ``py.test``:: +or:: + + $ make install-test-deps + +Use the command below to execute the tests:: $ py.test From 74843db6ff083936f28b456a95b2b7d945bf1b04 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 9 Jun 2020 08:39:05 +0200 Subject: [PATCH 348/508] Update flake8 to 3.8.3 (#435) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index f284e9d4..3a0c36a5 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==5.1 -flake8==3.8.2 +flake8==3.8.3 pyjokes==0.6.0 pytest==5.4.3 pytest-cov==2.9.0 From d5b8a037c70d766eef02cdbcf8123d45ad40a0e1 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 10 Jun 2020 14:49:43 +0800 Subject: [PATCH 349/508] [.gitignore] Add .python-version for pyenv --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b47d4513..3e9c5786 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.python-version *.py[co] dist MANIFEST From eee33c6ee2baaebc1f825765d4f975f12fa94066 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 10 Jun 2020 14:58:51 +0800 Subject: [PATCH 350/508] [#436] Add "Dependencies scanned by PyUp.io" Also add pyup badge. --- README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.rst b/README.rst index 8488f75a..85f089d4 100644 --- a/README.rst +++ b/README.rst @@ -12,6 +12,10 @@ zdict |gitter| +|pyup status| + +**[ ~ Dependencies scanned by PyUp.io ~ ]** + ---- zdict is a CLI dictionary framework mainly focus on any kind of online dictionary. @@ -346,3 +350,7 @@ Stargazers over time .. |docker build status| image:: https://img.shields.io/docker/build/zdict/zdict :target: https://hub.docker.com/r/zdict/zdict + +.. |pyup status| image:: https://pyup.io/repos/github/zdict/zdict/shield.svg + :target: https://pyup.io/repos/github/zdict/zdict/ + :alt: pyup.io badge From f1df120a11fccd9bf5e20609397cea94b4701cc0 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Thu, 18 Jun 2020 14:51:44 +0800 Subject: [PATCH 351/508] [#438] Create codeql-analysis.yml (#440) --- .github/workflows/codeql-analysis.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..18147bca --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,51 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 5 * * 2' + +jobs: + CodeQL-Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + with: + languages: python + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 7bd78236049222a6ffd0ac930699829af6201b65 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 18 Jun 2020 08:53:17 +0200 Subject: [PATCH 352/508] Update pytest-cov to 2.10.0 (#437) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 3a0c36a5..158d3fab 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.1 flake8==3.8.3 pyjokes==0.6.0 pytest==5.4.3 -pytest-cov==2.9.0 +pytest-cov==2.10.0 pytest-flake8==1.0.6 From 58d0f46dde7526634f90a75d22747e0b3091eb12 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 18 Jun 2020 08:54:18 +0200 Subject: [PATCH 353/508] Update requests to 2.24.0 (#439) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ff05f2bc..37934046 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.1 peewee==3.13.3 -requests==2.23.0 +requests==2.24.0 From 2437d30fe26dc982f54eb716435896e727d88887 Mon Sep 17 00:00:00 2001 From: Louie Lu Date: Mon, 6 Jul 2020 16:05:51 +0800 Subject: [PATCH 354/508] Add NAER terms to dictionaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit provider: 國家教育研究院 - 雙語詞彙、學術名詞暨辭書資訊網 site: https://terms.naer.edu.tw --- zdict/dictionaries/naer.py | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 zdict/dictionaries/naer.py diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py new file mode 100644 index 00000000..61a7114d --- /dev/null +++ b/zdict/dictionaries/naer.py @@ -0,0 +1,58 @@ +import json + +from collections import defaultdict + +from bs4 import BeautifulSoup + +from zdict.dictionary import DictBase +from zdict.exceptions import QueryError, NotFoundError +from zdict.models import Record + + +class NaerDict(DictBase): + API = "https://terms.naer.edu.tw/search?q={word}&field=ti&match=smart" + + @property + def provider(self): + return "NAER" + + @property + def title(self): + return "國家教育研究院" + + def _get_url(self, word) -> str: + return self.API.format(word=word) + + def show(self, record: Record): + content = json.loads(record.content) + + self.color.print("Query: {}".format(content["title"]), "lyellow") + print() + + for index, source in enumerate(content["sources"]): + self.color.print("{:-2d}. ".format(index + 1), end="") + self.color.print(source, "lred") + for en, zhtw in content["sources"][source]: + if len(zhtw) < 30: + self.color.print(zhtw, "lindigo", indent=5, end=": ") + print(en) + else: + self.color.print(zhtw, "lindigo", indent=5) + self.color.print(en, indent=5) + + def query(self, word: str): + try: + content = self._get_raw(word, verify=False) + except QueryError as exception: + raise NotFoundError(exception.word) + + data = {"title": word, "sources": defaultdict(list)} + soup = BeautifulSoup(content, "html.parser") + for tr in soup.find_all("tr", {"class": "dash"}): + source = tr.find("td", attrs={"class": "sourceW"}).find("a").text.strip() + en = tr.find("td", attrs={"class": "ennameW"}).text.strip() + zhtw = tr.find("td", attrs={"class": "zhtwnameW"}).text.strip() + data["sources"][source].append((en, zhtw)) + + record = Record(word=word, content=json.dumps(data), source=self.provider) + return record From 1de8d27dcc10d37a744458fffc86d452f15c7887 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 16:48:11 +0800 Subject: [PATCH 355/508] [#442] Fix for flake8 --- zdict/dictionaries/naer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index 61a7114d..b802afd2 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -49,10 +49,14 @@ def query(self, word: str): data = {"title": word, "sources": defaultdict(list)} soup = BeautifulSoup(content, "html.parser") for tr in soup.find_all("tr", {"class": "dash"}): - source = tr.find("td", attrs={"class": "sourceW"}).find("a").text.strip() + source = ( + tr.find("td", attrs={"class": "sourceW"}).find("a").text + ).strip() en = tr.find("td", attrs={"class": "ennameW"}).text.strip() zhtw = tr.find("td", attrs={"class": "zhtwnameW"}).text.strip() data["sources"][source].append((en, zhtw)) - record = Record(word=word, content=json.dumps(data), source=self.provider) + record = Record( + word=word, content=json.dumps(data), source=self.provider + ) return record From b933a361a6bf6229cfc1304f007f2d216ff4c88e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 7 Jul 2020 09:07:32 +0000 Subject: [PATCH 356/508] Update coverage from 5.1 to 5.2 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 158d3fab..6ea5fb62 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==5.1 +coverage==5.2 flake8==3.8.3 pyjokes==0.6.0 pytest==5.4.3 From 7744d8f8972f8191cb85df49b04d7f88cca06a2e Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 17:18:26 +0800 Subject: [PATCH 357/508] [#443] Add Not Found for NAER --- zdict/dictionaries/naer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index b802afd2..99d037f9 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -56,6 +56,9 @@ def query(self, word: str): zhtw = tr.find("td", attrs={"class": "zhtwnameW"}).text.strip() data["sources"][source].append((en, zhtw)) + if len(data["sources"]) == 0: + raise NotFoundError(word) + record = Record( word=word, content=json.dumps(data), source=self.provider ) From 03501b6072788b601d9032772fcb9d8ca8ea7db5 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 17:50:02 +0800 Subject: [PATCH 358/508] [#443] Ignore SSL warnings for NAER https://terms.naer.edu.tw/ uses an outdated security configuration which causes the SSL warning. --- zdict/dictionaries/naer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index 99d037f9..c2b34aa0 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -1,5 +1,5 @@ import json - +import requests from collections import defaultdict from bs4 import BeautifulSoup @@ -41,6 +41,7 @@ def show(self, record: Record): self.color.print(en, indent=5) def query(self, word: str): + requests.packages.urllib3.disable_warnings() try: content = self._get_raw(word, verify=False) except QueryError as exception: From c47a63eb9fde9f26d8c397af955dde58e7e81678 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 17:52:50 +0800 Subject: [PATCH 359/508] [#443] `-dt NAER` => `-dt naer` Lowercase is more convenient. --- zdict/dictionaries/naer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index c2b34aa0..9358985b 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -14,7 +14,7 @@ class NaerDict(DictBase): @property def provider(self): - return "NAER" + return "naer" @property def title(self): From 7ae05c945676c591b373ed6f3504920c41a75778 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 17:57:21 +0800 Subject: [PATCH 360/508] [#443] Remove `Query: ` for NAER It's redundant. --- zdict/dictionaries/naer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index 9358985b..5e21ea64 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -26,7 +26,7 @@ def _get_url(self, word) -> str: def show(self, record: Record): content = json.loads(record.content) - self.color.print("Query: {}".format(content["title"]), "lyellow") + self.color.print("{}".format(content["title"]), "lyellow") print() for index, source in enumerate(content["sources"]): From 49492d599a065a2b9e27891f6f5e5ec4272284fd Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 18:10:20 +0800 Subject: [PATCH 361/508] [#443] Make NAER title more precise --- zdict/dictionaries/naer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index 5e21ea64..1ce67ab5 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -18,7 +18,7 @@ def provider(self): @property def title(self): - return "國家教育研究院" + return "國家教育研究院 - 雙語詞彙、學術名詞暨辭書資訊網" def _get_url(self, word) -> str: return self.API.format(word=word) From 63d28588102351d71cbb3aada4c7d7d9ae29dc95 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 18:38:26 +0800 Subject: [PATCH 362/508] [#443] Should not treat QueryError as NotFoundError --- zdict/dictionaries/naer.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index 1ce67ab5..1ba1c5e5 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -5,7 +5,7 @@ from bs4 import BeautifulSoup from zdict.dictionary import DictBase -from zdict.exceptions import QueryError, NotFoundError +from zdict.exceptions import NotFoundError from zdict.models import Record @@ -42,10 +42,7 @@ def show(self, record: Record): def query(self, word: str): requests.packages.urllib3.disable_warnings() - try: - content = self._get_raw(word, verify=False) - except QueryError as exception: - raise NotFoundError(exception.word) + content = self._get_raw(word, verify=False) data = {"title": word, "sources": defaultdict(list)} soup = BeautifulSoup(content, "html.parser") From 3fb67cda040db471bfc08a18226f77a22c6099b6 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 18:39:41 +0800 Subject: [PATCH 363/508] Make unexpected exception message more readable --- zdict/dictionary.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/zdict/dictionary.py b/zdict/dictionary.py index 3ccfd539..ba62b100 100644 --- a/zdict/dictionary.py +++ b/zdict/dictionary.py @@ -143,13 +143,19 @@ def lookup(self, word): print() except Exception: import traceback + + print('='*80) traceback.print_exc() - url = "https://github.com/zdict/zdict/issues" print() - print("We have problem for this word 😢") - print("Please report this word to {}".format(url)) - print("Dictionary: {}".format(self.title)) + print("Dictionary: {} ({})".format(self.title, self.provider)) print("Word: '{}'".format(word)) + print('='*80) + print() + + url = "https://github.com/zdict/zdict/issues" + print("Houston, we got a problem 😢") + print("Please report the error message above to {}".format(url)) + import sys sys.exit(1) else: From fb3ce93dbffe1ddc99000f50a6b3ef8cb3ca1b01 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 18:51:00 +0800 Subject: [PATCH 364/508] [#443] Add testings for NAER --- zdict/tests/dictionaries/test_naer.py | 86 +++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 zdict/tests/dictionaries/test_naer.py diff --git a/zdict/tests/dictionaries/test_naer.py b/zdict/tests/dictionaries/test_naer.py new file mode 100644 index 00000000..5fc9360e --- /dev/null +++ b/zdict/tests/dictionaries/test_naer.py @@ -0,0 +1,86 @@ +from pytest import raises +from unittest.mock import patch + +from zdict.exceptions import NotFoundError +from zdict.zdict import get_args + +from zdict.dictionaries.naer import NaerDict + + +class TestNaerDict: + @classmethod + def setup_class(cls): + cls.dict = NaerDict(get_args()) + + # You may want to change words to some certain test cases. + cls.words = ['西爾河', 'spring mass'] + cls.not_found_word = 'dsafwwe' + + # Setup normal query data + cls.dict.args.verbose = False + cls.records = [cls.dict.query(word) for word in cls.words] + + # Setup verbose query data + cls.dict.args.verbose = True + cls.verbose_records = [cls.dict.query(word) for word in cls.words] + + # Change back to default verbose config + cls.dict.args.verbose = False + + @classmethod + def teardown_class(cls): + del cls.dict + del cls.words + del cls.records + del cls.verbose_records + + def test_provider(self): + assert self.dict.provider == 'naer' + + def test_title(self): + assert self.dict.title == '國家教育研究院 - 雙語詞彙、學術名詞暨辭書資訊網' + + def test__get_url(self): + url = 'https://terms.naer.edu.tw/search?q=test&field=ti&match=smart' + assert url == self.dict._get_url('test') + + def test_show(self): + self.dict.args.verbose = False + + for record in self.records: + self.dict.show(record) + + def test_show_verbose(self): + self.dict.args.verbose = True + + for record in self.verbose_records: + self.dict.show(record) + + @patch('zdict.dictionaries.naer.Record') + def test_query_normal(self, Record): + self.dict.args.verbose = False + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.records[i].content, + source='naer', + ) + + @patch('zdict.dictionaries.naer.Record') + def test_query_verbose(self, Record): + self.dict.args.verbose = True + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.verbose_records[i].content, + source='naer', + ) + + def test_query_not_found(self): + # Trigger NotFoundError intentionally and see if it works. + with raises(NotFoundError): + self.dict.query(self.not_found_word) From 5160f8660322727799b12a3343deb891c22c63bc Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 19:01:06 +0800 Subject: [PATCH 365/508] [#443] Update README for NAER --- README.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 85f089d4..0a573b9a 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ zdict |gitter| -|pyup status| +|pyup status| **[ ~ Dependencies scanned by PyUp.io ~ ]** @@ -94,7 +94,7 @@ Usage :: usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,wiktionary,urban,yandex,all] + [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all] [-ld] [-V] [-c] [--dump [PATTERN]] [-D] [word [word ...]] @@ -114,7 +114,7 @@ Usage the number of CPUs in the system. -sp, --show-provider Show the dictionary provider of the queried word -su, --show-url Show the url of the queried word - -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,wiktionary,urban,yandex,all + -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all Must be seperated by comma and no spaces after each comma. Choose the dictionary you want. (default: yahoo) Use 'all' for qureying all dictionaries. If @@ -217,6 +217,13 @@ To use this source, you should first `apply `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: https://user-images.githubusercontent.com/1645228/86770837-e6951480-c083-11ea-95f2-51b1e6f7e04f.jpg + +.. image:: https://user-images.githubusercontent.com/1645228/86770828-e432ba80-c083-11ea-813a-e357f213826a.jpg + Development & Contributing --------------------------- From f20a560abba5faa6d75f471418b63884b3879a23 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 20:01:54 +0800 Subject: [PATCH 366/508] [#443] Try to fix SSL error on CircleCI --- .circleci/config.yml | 4 ++++ zdict/tests/dictionaries/test_naer.py | 1 + 2 files changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d1264d7..5bc7f7e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,6 +80,10 @@ variables: name: run tests command: | . venv/bin/activate + # The website of NaerDict use TLSv1.0 + # The MinProtocol of TLS on CircleCI is v1.2 + # If we don't do this, testings for NaerDict will fail on CircleCI + sudo sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /etc/ssl/openssl.cnf make test - store_test_results: diff --git a/zdict/tests/dictionaries/test_naer.py b/zdict/tests/dictionaries/test_naer.py index 5fc9360e..9b72e5bc 100644 --- a/zdict/tests/dictionaries/test_naer.py +++ b/zdict/tests/dictionaries/test_naer.py @@ -31,6 +31,7 @@ def setup_class(cls): def teardown_class(cls): del cls.dict del cls.words + del cls.not_found_word del cls.records del cls.verbose_records From be7547b1a3326c1b63c5cab756bf0f7ccd798f91 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 21:40:26 +0800 Subject: [PATCH 367/508] Version 3.6.0 - 9c87f3d Merge pull request #446 from zdict/issue-443 - f20a560 [#443] Try to fix SSL error on CircleCI - 5160f86 [#443] Update README for NAER - fb3ce93 [#443] Add testings for NAER - 3fb67cd Make unexpected exception message more readable - 63d2858 [#443] Should not treat QueryError as NotFoundError - 49492d5 [#443] Make NAER title more precise - 7ae05c9 [#443] Remove `Query: ` for NAER - c47a63e [#443] `-dt NAER` => `-dt naer` - 03501b6 [#443] Ignore SSL warnings for NAER - 7744d8f [#443] Add Not Found for NAER - 1d92f43 Merge pull request #444 from zdict/pyup-update-coverage-5.1-to-5.2 - b933a36 Update coverage from 5.1 to 5.2 - f0dc67d Merge pull request #442 from mlouielu/add-naer-terms - 1de8d27 [#442] Fix for flake8 - 2437d30 Add NAER terms to dictionaries - 58d0f46 Update requests to 2.24.0 (#439) - 7bd7823 Update pytest-cov to 2.10.0 (#437) - f1df120 [#438] Create codeql-analysis.yml (#440) - eee33c6 [#436] Add "Dependencies scanned by PyUp.io" - d5b8a03 [.gitignore] Add .python-version for pyenv - 74843db Update flake8 to 3.8.3 (#435) - 07f57cb [README] Change command for installing testing deps --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 2872fa21..1bd39f02 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.5.4' +VERSION = '3.6.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From e215a06d63cf1e20e81deed2c407378b3a8f7393 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 22:06:18 +0800 Subject: [PATCH 368/508] [README] Fix for uploading to PyPI with twine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the error below: ``` `long_description` has syntax errors in markup and would not be rendered on PyPI. line 221: Warning: Title underline too short. `國家教育研究院 - 雙語詞彙、學術名詞暨辭書資訊網 `_ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0a573b9a..f3b03dd3 100644 --- a/README.rst +++ b/README.rst @@ -218,7 +218,7 @@ To use this source, you should first `apply `_ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. image:: https://user-images.githubusercontent.com/1645228/86770837-e6951480-c083-11ea-95f2-51b1e6f7e04f.jpg From e8c1b7babbdcf59cb55aa9e2b637cc18b5dae2e5 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Jul 2020 22:07:24 +0800 Subject: [PATCH 369/508] Version 3.6.1 - e215a06 [README] Fix for uploading to PyPI with twine --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 1bd39f02..6043a2ed 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.6.0' +VERSION = '3.6.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 0cbf9a7b177af486a06319e2a45cb8d08449a678 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 11 Jul 2020 19:42:46 +0800 Subject: [PATCH 370/508] [setup.py] Modify description on PyPI dictionary => online dictionary --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 15e314be..0c584848 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ def get_test_req(): 'wdv4758h@gmail.com'), url='https://github.com/zdict/zdict', keywords="cli, dictionary, framework", - description="The last dictionary framework you need. (?)", + description="The last online dictionary framework you need. (?)", long_description=open("README.rst", encoding='utf-8').read(), download_url="https://github.com/zdict/zdict/archive/v{}.zip".format( version From 55edb93659196a8e3c6629879c2e53916932711d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 26 Jul 2020 05:18:29 +0200 Subject: [PATCH 371/508] Update coverage to 5.2.1 (#449) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 6ea5fb62..72498107 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==5.2 +coverage==5.2.1 flake8==3.8.3 pyjokes==0.6.0 pytest==5.4.3 From 4552db6e53ca2ab1d00f7e01b14248d318fb343c Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 3 Aug 2020 20:28:38 +0800 Subject: [PATCH 372/508] [#452] Sort iTaigi basic_words before saving into database (#454) --- zdict/dictionaries/itaigi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zdict/dictionaries/itaigi.py b/zdict/dictionaries/itaigi.py index 281a8122..17603c4d 100644 --- a/zdict/dictionaries/itaigi.py +++ b/zdict/dictionaries/itaigi.py @@ -106,6 +106,13 @@ def query(self, word: str): content['basic_words'].append(d) + # Fix issue-452 for iTaigi testings + # iTaigi returns basic_words in random order. + # Since we store basic_words in a list, + # We have to sort it before saving into database + # or the unit-testings would fail. + content['basic_words'].sort(key=lambda word: word['text']) + # Fetch related words try: related_words = response["其他建議"] From dfeec3bf36da1ef201b8aa4334e76bfc8f8a4b7e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 3 Aug 2020 15:02:32 +0200 Subject: [PATCH 373/508] Update pytest to 6.0.1 (#451) Co-authored-by: Frank Jheng --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 72498107..f877a3cf 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.2.1 flake8==3.8.3 pyjokes==0.6.0 -pytest==5.4.3 +pytest==6.0.1 pytest-cov==2.10.0 pytest-flake8==1.0.6 From 95f1a379c6d915662344e95983bf21c36a1b5e1e Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 4 Aug 2020 22:24:08 +0800 Subject: [PATCH 374/508] Make `zdict -ld` shows HOMEPAGE_URL of dictionaries --- zdict/dictionaries/itaigi.py | 1 + zdict/dictionaries/jisho.py | 3 +-- zdict/dictionaries/moe.py | 2 ++ zdict/dictionaries/naer.py | 1 + zdict/dictionaries/oxford.py | 1 + zdict/dictionaries/spanish.py | 1 + zdict/dictionaries/template.py | 5 +++++ zdict/dictionaries/urban.py | 1 + zdict/dictionaries/wiktionary.py | 1 + zdict/dictionaries/yahoo.py | 1 + zdict/dictionaries/yandex.py | 3 +-- zdict/zdict.py | 10 ++++------ 12 files changed, 20 insertions(+), 10 deletions(-) diff --git a/zdict/dictionaries/itaigi.py b/zdict/dictionaries/itaigi.py index 17603c4d..56213d00 100644 --- a/zdict/dictionaries/itaigi.py +++ b/zdict/dictionaries/itaigi.py @@ -11,6 +11,7 @@ class iTaigiDict(DictBase): + HOMEPAGE_URL = "https://itaigi.tw/" API = 'https://itaigi.tw/平臺項目列表/揣列表?關鍵字={word}' @property diff --git a/zdict/dictionaries/jisho.py b/zdict/dictionaries/jisho.py index eb850797..1c8771b4 100644 --- a/zdict/dictionaries/jisho.py +++ b/zdict/dictionaries/jisho.py @@ -7,8 +7,7 @@ class JishoDict(DictBase): - # Change the url below to the API url of the new dictionary. - # Need to keep the `{word}` for `_get_url()` usage. + HOMEPAGE_URL = "https://jisho.org/" API = 'http://jisho.org/api/v1/search/words?keyword={word}' @property diff --git a/zdict/dictionaries/moe.py b/zdict/dictionaries/moe.py index 91b8fde0..42cd2153 100644 --- a/zdict/dictionaries/moe.py +++ b/zdict/dictionaries/moe.py @@ -8,6 +8,7 @@ class MoeDict(DictBase): + HOMEPAGE_URL = "https://www.moedict.tw/" API = 'https://www.moedict.tw/uni/{word}' @property @@ -122,6 +123,7 @@ def clean(data, clean_cf=False): class MoeDictTaiwanese(DictBase): + HOMEPAGE_URL = "https://www.moedict.tw/" API = 'https://www.moedict.tw/t/{word}.json' @property diff --git a/zdict/dictionaries/naer.py b/zdict/dictionaries/naer.py index 1ba1c5e5..914e9de0 100644 --- a/zdict/dictionaries/naer.py +++ b/zdict/dictionaries/naer.py @@ -10,6 +10,7 @@ class NaerDict(DictBase): + HOMEPAGE_URL = "https://terms.naer.edu.tw/" API = "https://terms.naer.edu.tw/search?q={word}&field=ti&match=smart" @property diff --git a/zdict/dictionaries/oxford.py b/zdict/dictionaries/oxford.py index e3ef5fe2..7e0b578c 100644 --- a/zdict/dictionaries/oxford.py +++ b/zdict/dictionaries/oxford.py @@ -17,6 +17,7 @@ class OxfordDictionary(DictBase): KEY_FILE = os.path.join(BASE_DIR, 'oxford.key') + HOMEPAGE_URL = "https://oxforddictionaries.com/" API = 'https://od-api.oxforddictionaries.com/api/v2/entries/en/{word}' # https://developer.oxforddictionaries.com/documentation/response-codes diff --git a/zdict/dictionaries/spanish.py b/zdict/dictionaries/spanish.py index 0a83651c..dff5227a 100644 --- a/zdict/dictionaries/spanish.py +++ b/zdict/dictionaries/spanish.py @@ -19,6 +19,7 @@ class SpanishDict(DictBase): Tested words : ('soy', 'manzana', 'python', 'perdón') ''' + HOMEPAGE_URL = "https://www.spanishdict.com/" API = 'https://www.spanishdict.com/translate/{word}' @property diff --git a/zdict/dictionaries/template.py b/zdict/dictionaries/template.py index aa946448..f13049d4 100644 --- a/zdict/dictionaries/template.py +++ b/zdict/dictionaries/template.py @@ -10,6 +10,11 @@ # Change `Template` to the name of new dictionary. like xxxDict. class TemplateDict(DictBase): + # Change the HOMEPAGE_URL to the online dictionary you want to add. + # This will be showed when using `zdict --list-dicts` to help users + # find out the dictionary they might need. + HOMEPAGE_URL = "https://tw.dictionary.yahoo.com/" + # Change the url below to the API url of the new dictionary. # Need to keep the `{word}` for `_get_url()` usage. API = 'https://tw.dictionary.search.yahoo.com/search?p={word}' diff --git a/zdict/dictionaries/urban.py b/zdict/dictionaries/urban.py index c811bec7..b9771050 100644 --- a/zdict/dictionaries/urban.py +++ b/zdict/dictionaries/urban.py @@ -7,6 +7,7 @@ class UrbanDict(DictBase): + HOMEPAGE_URL = "https://www.urbandictionary.com/" API = 'http://api.urbandictionary.com/v0/define?term={word}' @property diff --git a/zdict/dictionaries/wiktionary.py b/zdict/dictionaries/wiktionary.py index 87e73962..505eabf5 100644 --- a/zdict/dictionaries/wiktionary.py +++ b/zdict/dictionaries/wiktionary.py @@ -9,6 +9,7 @@ class WiktionaryDict(DictBase): + HOMEPAGE_URL = "https://en.wiktionary.org/" API = 'https://en.wiktionary.org/api/rest_v1/page/definition/{word}' @property diff --git a/zdict/dictionaries/yahoo.py b/zdict/dictionaries/yahoo.py index be5cd911..f09e28da 100644 --- a/zdict/dictionaries/yahoo.py +++ b/zdict/dictionaries/yahoo.py @@ -21,6 +21,7 @@ def foreach(f: type(lambda: None), i: iter) -> None: class YahooDict(DictBase): + HOMEPAGE_URL = "https://tw.dictionary.yahoo.com/" API = 'https://tw.dictionary.yahoo.com/dictionary?p={word}' @property diff --git a/zdict/dictionaries/yandex.py b/zdict/dictionaries/yandex.py index 404b1d2a..1f14c002 100644 --- a/zdict/dictionaries/yandex.py +++ b/zdict/dictionaries/yandex.py @@ -20,8 +20,7 @@ class YandexDict(DictBase): """ - # Change the url below to the API url of the new dictionary. - # Need to keep the `{word}` for `_get_url()` usage. + HOMEPAGE_URL = "https://translate.yandex.com/" # TODO: support different translate direction # TODO: use Dictionary API API = 'https://translate.yandex.net/api/v1.5/tr.json/translate?' \ diff --git a/zdict/zdict.py b/zdict/zdict.py index 7b1a8140..180f7359 100644 --- a/zdict/zdict.py +++ b/zdict/zdict.py @@ -272,14 +272,12 @@ def interactive_mode(args): def execute_zdict(args): if args.list_dicts: - for provider in sorted( - dictionary_map, - key=lambda x: {'yahoo': 0, 'pyjokes': 2}.get(x, 1) - ): + for provider in sorted(dictionary_map): print( - '{}: {}'.format( + '{}: {}\n{}\n'.format( provider, - dictionary_map[provider](args).title + dictionary_map[provider](args).title, + dictionary_map[provider](args).HOMEPAGE_URL, ) ) exit() From f8ddb0ce23c89e77b678100f60c113d14ebac5f4 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 4 Aug 2020 22:25:15 +0800 Subject: [PATCH 375/508] [jisho] Update API URL from http to https --- zdict/dictionaries/jisho.py | 2 +- zdict/tests/dictionaries/test_jisho.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zdict/dictionaries/jisho.py b/zdict/dictionaries/jisho.py index 1c8771b4..d060e854 100644 --- a/zdict/dictionaries/jisho.py +++ b/zdict/dictionaries/jisho.py @@ -8,7 +8,7 @@ class JishoDict(DictBase): HOMEPAGE_URL = "https://jisho.org/" - API = 'http://jisho.org/api/v1/search/words?keyword={word}' + API = 'https://jisho.org/api/v1/search/words?keyword={word}' @property def provider(self): diff --git a/zdict/tests/dictionaries/test_jisho.py b/zdict/tests/dictionaries/test_jisho.py index b5997a49..0ecb9c8f 100644 --- a/zdict/tests/dictionaries/test_jisho.py +++ b/zdict/tests/dictionaries/test_jisho.py @@ -29,7 +29,7 @@ def test_title(self): def test__get_url(self): url = ( - 'http://jisho.org/api/v1/search/words?keyword={}' + 'https://jisho.org/api/v1/search/words?keyword={}' ).format(self.word) assert url == self.dict._get_url(self.word) From ee9bc0566d1c83d00b5d41f24cee50e7a4c2a4eb Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 4 Aug 2020 22:32:10 +0800 Subject: [PATCH 376/508] [moe] Use enmerate(..., start=1) to avoid "count + 1" --- zdict/dictionaries/moe.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zdict/dictionaries/moe.py b/zdict/dictionaries/moe.py index 42cd2153..27383038 100644 --- a/zdict/dictionaries/moe.py +++ b/zdict/dictionaries/moe.py @@ -46,11 +46,11 @@ def show(self, record: Record): print() # print explain - for count, explain in enumerate(word.get('definitions', '')): + for count, explain in enumerate(word.get('definitions', ''), 1): self.color.print( '{order}. {text}'.format( - order=count + 1, + order=count, text=explain.get('def', '') ), ) @@ -161,9 +161,9 @@ def show(self, record: Record): print() # print explain - for count, explain in enumerate(word.get('d', '')): + for count, explain in enumerate(word.get('d', ''), start=1): - self.color.print('{order}. '.format(order=count + 1), end='') + self.color.print('{order}. '.format(order=count), end='') type = clean(explain.get('type', '')) if type: self.color.print( From 8d4636f659a864ba88a2a346ab9b3ccd1f8a9320 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 4 Aug 2020 23:12:25 +0800 Subject: [PATCH 377/508] [moe] Show the type of the definition --- zdict/dictionaries/moe.py | 99 ++++++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 38 deletions(-) diff --git a/zdict/dictionaries/moe.py b/zdict/dictionaries/moe.py index 27383038..bdf1a8a6 100644 --- a/zdict/dictionaries/moe.py +++ b/zdict/dictionaries/moe.py @@ -1,5 +1,6 @@ import json import unicodedata # to detect Unicode category +from collections import OrderedDict from zdict.dictionary import DictBase from zdict.exceptions import QueryError, NotFoundError @@ -43,47 +44,69 @@ def show(self, record: Record): end=' ', ) print() - print() - - # print explain - for count, explain in enumerate(word.get('definitions', ''), 1): - - self.color.print( - '{order}. {text}'.format( - order=count, - text=explain.get('def', '') - ), - ) - - if explain.get('synonyms'): - self.color.print( - '同義詞: {text}'.format(text=explain['synonyms']), - 'magenta', - indent=2, - ) - - if explain.get('antonyms'): - self.color.print( - '反義詞: {text}'.format(text=explain['antonyms']), - 'magenta', - indent=2, - ) - for example in explain.get('example', ''): + # Gather definitions with same type + # in the same key-value of a dictionary. + # Use OrderedDict to remain the original order from API. + definitions = OrderedDict() + for definition in word.get('definitions'): + definitions.setdefault( + definition.get('type', ''), + [] + ).append(definition) + + # print definition + for word_type, word_definitions in definitions.items(): + if word_type: self.color.print( - example, - 'indigo', - indent=2, + '{text}'.format(text=word_type), + 'red', ) - - for quote in explain.get('quote', ''): - self.color.print( - '[引用] {text}'.format(text=quote), - 'green', - indent=2, - ) - - print() + for count, explain in enumerate(word_definitions, 1): + if explain.get('link'): + self.color.print( + '{text}'.format(text=explain['link'][0]), + indent=2, + ) + + if explain.get('def'): + self.color.print( + '{order}. {text}'.format( + order=count, + text=explain['def'], + ), + indent=2, + ) + + if explain.get('synonyms'): + self.color.print( + '同義詞: {text}'.format(text=explain['synonyms']), + 'magenta', + indent=4, + ) + + if explain.get('antonyms'): + self.color.print( + '反義詞: {text}'.format(text=explain['antonyms']), + 'magenta', + indent=4, + ) + + for example in explain.get('example', ''): + self.color.print( + example, + 'indigo', + indent=4, + ) + + for quote in explain.get('quote', ''): + self.color.print( + '[引用] {text}'.format(text=quote), + 'green', + indent=4, + ) + + print() def query(self, word: str): try: From 06493d8f36af96ef54ac4e6d4751800ad3a3dc15 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 4 Aug 2020 23:34:29 +0800 Subject: [PATCH 378/508] [GitHub Actions] Trim codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 18147bca..641c2533 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 From 1c4cc4cd272cdb3b02702a2ac219bc3fe29b02f2 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 4 Aug 2020 23:34:59 +0800 Subject: [PATCH 379/508] Version 3.6.2 - 06493d8 [GitHub Actions] Trim codeql-analysis.yml - 8d4636f [moe] Show the type of the definition - ee9bc05 [moe] Use enmerate(..., start=1) to avoid "count + 1" - f8ddb0c [jisho] Update API URL from http to https - 95f1a37 Make `zdict -ld` shows HOMEPAGE_URL of dictionaries - dfeec3b Update pytest to 6.0.1 (#451) - 4552db6 [#452] Sort iTaigi basic_words before saving into database (#454) - 55edb93 Update coverage to 5.2.1 (#449) - 0cbf9a7 [setup.py] Modify description on PyPI --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 6043a2ed..df6c22ba 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.6.1' +VERSION = '3.6.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 365de115171b49a189030b30bdd18a31d29ce139 Mon Sep 17 00:00:00 2001 From: Louie Lu Date: Wed, 12 Aug 2020 14:11:51 +0800 Subject: [PATCH 380/508] =?UTF-8?q?Add=20APC=20e-dictionary=20to=20diction?= =?UTF-8?q?aries=20(=E5=8E=9F=E4=BD=8F=E6=B0=91=E6=97=8F=E5=A7=94=E5=93=A1?= =?UTF-8?q?=E6=9C=83=20-=20=E5=8E=9F=E4=BD=8F=E6=B0=91=E6=97=8F=E8=AA=9E?= =?UTF-8?q?=E8=A8=80=E7=B7=9A=E4=B8=8A=E8=A9=9E=E5=85=B8)=20(#448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Frank Jheng --- .circleci/config.yml | 54 +++++--- zdict/dictionaries/apc.py | 196 +++++++++++++++++++++++++++ zdict/tests/dictionaries/test_apc.py | 85 ++++++++++++ 3 files changed, 316 insertions(+), 19 deletions(-) create mode 100644 zdict/dictionaries/apc.py create mode 100644 zdict/tests/dictionaries/test_apc.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 5bc7f7e7..fb9ce720 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,35 +2,34 @@ # # Check https://circleci.com/docs/2.0/language-python/ for more details # -version: 2 -experimental: - pipelines: true +version: 2.1 + workflows: version: 2 build-test-deploy: jobs: - - linux-python-3.8: + - linux-python-3_8: filters: tags: only: /.*/ - - linux-python-3.7: + - linux-python-3_7: filters: tags: only: /.*/ - - linux-python-3.6: + - linux-python-3_6: filters: tags: only: /.*/ - - linux-python-3.5: + - linux-python-3_5: filters: tags: only: /.*/ - deploy: requires: - - linux-python-3.8 - - linux-python-3.7 - - linux-python-3.6 - - linux-python-3.5 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 + - linux-python-3_5 filters: tags: only: /[0-9]+(\.[0-9]+)*/ @@ -46,10 +45,25 @@ workflows: branches: only: master jobs: - - linux-python-3.8 - - linux-python-3.7 - - linux-python-3.6 - - linux-python-3.5 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 + - linux-python-3_5 + +# https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ +commands: + early_return_for_forked_pull_requests: + description: >- + If this build is from a fork, stop executing the current job and return success. + This is useful to avoid steps that will fail due to missing credentials. + steps: + - run: + name: Early return if this build is from a forked PR + command: | + if [ -n "$CIRCLE_PR_NUMBER" ]; then + echo "Nothing to do for forked PRs, so marking this step successful" + circleci step halt + fi variables: test-template: &test-template @@ -96,6 +110,8 @@ variables: path: htmlcov destination: htmlcov + - early_return_for_forked_pull_requests + - run: name: send coverage to coveralls command: | @@ -104,22 +120,22 @@ variables: jobs: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - linux-python-3.8: + linux-python-3_8: <<: *test-template docker: - image: circleci/python:3.8 - linux-python-3.7: + linux-python-3_7: <<: *test-template docker: - image: circleci/python:3.7 - linux-python-3.6: + linux-python-3_6: <<: *test-template docker: - image: circleci/python:3.6 - linux-python-3.5: + linux-python-3_5: <<: *test-template docker: - image: circleci/python:3.5 diff --git a/zdict/dictionaries/apc.py b/zdict/dictionaries/apc.py new file mode 100644 index 00000000..7919b040 --- /dev/null +++ b/zdict/dictionaries/apc.py @@ -0,0 +1,196 @@ +import json +import requests + +from collections import defaultdict + +from bs4 import BeautifulSoup + +from zdict.dictionary import DictBase +from zdict.exceptions import NotFoundError +from zdict.models import Record + + +class ApcDict(DictBase): + BASE_URL = "https://e-dictionary.apc.gov.tw" + + # To get the result of APC online dictionary + # We have to send a POST request to the POST_API first + # (with the word we want to query in the JSON payload) + # Then, the webpage will save result in the cookies + # we use the cookies to request the API with GET + # It will shows the result. + # Then, we parse the webpage. + POST_API = "{}/index.aspx/_crossTribes".format(BASE_URL) + API = "{}/search/list.htm".format(BASE_URL) + + ''' + # Ref: + # http://ilrdc.tw/research/athousand/area16.php + # 原住民族語言研究中心 - 16族族語學習詞表 + NOT_FOUND_WORD_INDIGENOUS = [ + "awaay", # 南勢/秀姑巒/海岸/馬蘭/恆春阿美語 + "ungat", # 賽考利克/澤敖/萬大/宜蘭澤敖利泰雅語 + "ukas", # 汶水泰雅語 + "uka", # 四季泰雅語 + "neka", # 東/北/中/南排灣語 + "uka", # 卓群/卡群/丹群/巒群/郡群布農語 + "uniyan", # 南王/知本/初鹿/建和卑南語 + "iniyan", # 知本/建和卑南語 + "kadrwa", # 東/霧台魯凱語 + "kadruwa", # 大武魯凱語 + "kadrowa", # 多納魯凱語 + "tédra", # 茂林魯凱語 + "akaodho", # 萬山魯凱語 + "uk'a", # 鄒語 + "'okay", # 賽夏語 + "'oka'", # 賽夏語 + "'inoka'", # 賽夏語 + "abo", # 雅美語 + "uka", # 邵語 + "mai", # 噶瑪蘭語 + "ini", # 太魯閣語 + "ungat", # 太魯閣語 + "nai'", # 撒奇萊雅語 + "ungac", # 都達語 (賽德克語) + "uka", # 都達語 (賽德克語) + "ini", # 德固達雅語 (賽德克語) + "ungac", # 德路固語 (賽德克語) + "ungat", # 德路固語 (賽德克語) + "uka'a", # 拉阿魯哇語 + "'akia", # 卡那卡那富語 + ] + ''' + + @property + def provider(self): + return "apc" + + @property + def title(self): + return "原住民族委員會 - 原住民族語言線上詞典" + + def _get_url(self, word) -> str: + return self.API.format(word=word) + + def show(self, record: Record): + content = json.loads(record.content) + + self.color.print("{}".format(content["title"]), "lyellow") + print() + + self.color.print("精確搜尋結果", "lmagenta") + for index, source in enumerate(content["exact_sources"]): + self.color.print("{:-2d}. ".format(index + 1), end="") + self.color.print(source, "lred", end=": ") + self.color.print( + content["exact_sources"][source]["title"], + "lindigo", + ) + for i, d in enumerate(content["exact_sources"][source]["defs"]): + self.color.print("{i:-2d}. {d}".format(i=i + 1, d=d), indent=4) + + self.color.print("detail: ", "indigo", end="", indent=4) + self.color.print(content["exact_sources"][source]["link"], "white") + print() + if not content["exact_sources"]: + print() + self.color.print("無精確搜尋結果", "green") + print() + + self.color.print("模糊搜尋結果", "lmagenta") + for index, source in enumerate(content["fuzzy_sources"]): + self.color.print("{:-2d}. ".format(index + 1), end="") + self.color.print(source, "red") + + for word in content["fuzzy_sources"][source]: + self.color.print(word["title"], "lindigo", indent=5) + for i, d in enumerate(word["defs"]): + self.color.print( + "{i:-2d}. {d}".format(i=i + 1, d=d), + indent=6, + ) + print() + if not content["fuzzy_sources"]: + print() + self.color.print("無模糊搜尋結果", "green") + print() + + def query(self, word: str): + r = requests.post( + self.POST_API, + json={ + "c": "1", + "t": "all", + "q": word, + }, + ) + content = self._get_raw(word, cookies=r.cookies) + + data = { + "title": word, + "exact_sources": defaultdict(list), + "fuzzy_sources": defaultdict(list), + } + soup = BeautifulSoup(content, "html.parser") + + # Exact matching + exact = soup.find(id="accordion_cross") + if exact: + for div in exact.find_all("div", {"class": "panel"}): + title = div.find("div", {"class": "title"}).find("a").text + defs = [ + div.find("strong", {"class": "word"}) + .find_all("span")[-1] + .text.strip() + ] + source = div.find("strong", {"class": "race"}).text + + for i in div.find_all("li")[1:]: + d = i.find("strong", {"class": "word"}) + if d: + defs.append(d.find_all("span")[-1].text.strip()) + + link = ( + self.BASE_URL + + div.find("a", {"class": "btn-more"})["href"] + ) + data["exact_sources"][source] = { + "title": title, + "defs": defs, + "link": link, + } + + # Fuzzy matching + fuzzy = soup.find(id="accordion") + if fuzzy: + for div in fuzzy.find_all("div", {"class": "panel"}): + title = div.find("div", {"class": "title"}).find("a").text + defs = [ + div.find("strong", {"class": "word"}) + .find_all("span")[-1] + .text.strip() + ] + source = div.find("strong", {"class": "race"}).text + + for i in div.find_all("li")[1:]: + d = i.find("strong", {"class": "word"}) + if d: + defs.append(d.find_all("span")[-1].text.strip()) + + link = ( + self.BASE_URL + + div.find("div", {"class": "title"}).find("a")["href"] + ) + data["fuzzy_sources"][source].append( + {"title": title, "defs": defs, "link": link} + ) + + if not exact and not fuzzy: + raise NotFoundError(word) + + record = Record( + word=word, + content=json.dumps(data), + source=self.provider, + ) + return record diff --git a/zdict/tests/dictionaries/test_apc.py b/zdict/tests/dictionaries/test_apc.py new file mode 100644 index 00000000..b925465e --- /dev/null +++ b/zdict/tests/dictionaries/test_apc.py @@ -0,0 +1,85 @@ +from pytest import raises +from unittest.mock import patch + +from zdict.exceptions import NotFoundError +from zdict.zdict import get_args + +from zdict.dictionaries.apc import ApcDict + + +class TestApcDict: + @classmethod + def setup_class(cls): + cls.dict = ApcDict(get_args()) + + # You may want to change words to some certain test cases. + cls.words = ["utux", "tux"] + cls.not_found_word = "dsafwwe" + + # Setup normal query data + cls.dict.args.verbose = False + cls.records = [cls.dict.query(word) for word in cls.words] + + # Setup verbose query data + cls.dict.args.verbose = True + cls.verbose_records = [cls.dict.query(word) for word in cls.words] + + # Change back to default verbose config + cls.dict.args.verbose = False + + @classmethod + def teardown_class(cls): + del cls.dict + del cls.words + del cls.not_found_word + del cls.records + del cls.verbose_records + + def test_provider(self): + assert self.dict.provider == "apc" + + def test_title(self): + assert self.dict.title == "原住民族委員會 - 原住民族語言線上詞典" + + def test__get_url(self): + url = "https://e-dictionary.apc.gov.tw/search/list.htm" + assert url == self.dict._get_url("test") + + def test_show(self): + self.dict.args.verbose = False + + for record in self.records: + self.dict.show(record) + + def test_show_verbose(self): + self.dict.args.verbose = True + + for record in self.verbose_records: + self.dict.show(record) + + @patch("zdict.dictionaries.apc.Record") + def test_query_normal(self, Record): + self.dict.args.verbose = False + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, content=self.records[i].content, source="apc", + ) + + @patch("zdict.dictionaries.apc.Record") + def test_query_verbose(self, Record): + self.dict.args.verbose = True + + for i, word in enumerate(self.words): + self.dict.query(word) + Record.assert_called_with( + word=word, + content=self.verbose_records[i].content, + source="apc", + ) + + def test_query_not_found(self): + # Trigger NotFoundError intentionally and see if it works. + with raises(NotFoundError): + self.dict.query(self.not_found_word) From e034e03719c7df24b7b7af7b870c040e375840ff Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 12 Aug 2020 15:01:07 +0800 Subject: [PATCH 381/508] [#448] Add screenshots for APC dictionary in README --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index f3b03dd3..6adf9895 100644 --- a/README.rst +++ b/README.rst @@ -224,6 +224,15 @@ To use this source, you should first `apply `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: https://user-images.githubusercontent.com/1645228/89984560-2b782080-dcac-11ea-8183-acfbd45f799b.jpg + +.. image:: https://user-images.githubusercontent.com/1645228/89984570-2e731100-dcac-11ea-9a09-de09e7631402.jpg + + Development & Contributing --------------------------- From 5e3f73501eefef02ef7736c335bfe04354a30f10 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 12 Aug 2020 15:02:59 +0800 Subject: [PATCH 382/508] Version 3.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - e034e03 [#448] Add screenshots for APC dictionary in README - 365de11 Add APC e-dictionary to dictionaries (原住民族委員會 - 原住民族語言線上詞典) (#448) --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index df6c22ba..e7cc0166 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.6.2' +VERSION = '3.7.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 411641f5b2a4f610ac8fa89cf4954ea89aa6e225 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 20 Aug 2020 11:09:22 +0200 Subject: [PATCH 383/508] Update pytest-cov to 2.10.1 (#455) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index f877a3cf..3d40cebf 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.2.1 flake8==3.8.3 pyjokes==0.6.0 pytest==6.0.1 -pytest-cov==2.10.0 +pytest-cov==2.10.1 pytest-flake8==1.0.6 From 49ed8dea370a14a66f20a044970e2185c52abe56 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 13 Sep 2020 06:58:28 +0200 Subject: [PATCH 384/508] Update pytest to 6.0.2 (#456) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 3d40cebf..39bf37b1 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.2.1 flake8==3.8.3 pyjokes==0.6.0 -pytest==6.0.1 +pytest==6.0.2 pytest-cov==2.10.1 pytest-flake8==1.0.6 From ff74e2e098b17aad40ff27f9be599adaa455226a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 15 Sep 2020 07:34:12 +0200 Subject: [PATCH 385/508] Update coverage from 5.2.1 to 5.3 (#457) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 39bf37b1..4d4a956b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==5.2.1 +coverage==5.3 flake8==3.8.3 pyjokes==0.6.0 pytest==6.0.2 From 5a80b0be5476d1985454db2ce0a682fc2d9eda07 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 28 Sep 2020 10:56:05 +0200 Subject: [PATCH 386/508] Update pytest to 6.1.0 (#458) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 4d4a956b..76d4751a 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.3 flake8==3.8.3 pyjokes==0.6.0 -pytest==6.0.2 +pytest==6.1.0 pytest-cov==2.10.1 pytest-flake8==1.0.6 From 4f8e0cefc8d5f2873efa8a80d3e1e4c60a7052d2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 29 Sep 2020 09:27:25 +0200 Subject: [PATCH 387/508] Update beautifulsoup4 to 4.9.2 (#459) Co-authored-by: Frank Jheng --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 37934046..2e15e57e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.9.1 +beautifulsoup4==4.9.2 peewee==3.13.3 requests==2.24.0 From eccfbd01870df3a7c53bc908110da143fcfdf536 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 5 Oct 2020 05:53:04 +0200 Subject: [PATCH 388/508] Update pytest from 6.1.0 to 6.1.1 (#462) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 76d4751a..c52f4224 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.3 flake8==3.8.3 pyjokes==0.6.0 -pytest==6.1.0 +pytest==6.1.1 pytest-cov==2.10.1 pytest-flake8==1.0.6 From 35d398864cf3851d8f124635e315fdbf1c748d09 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 6 Oct 2020 09:52:07 +0200 Subject: [PATCH 389/508] Update flake8 to 3.8.4 (#460) Co-authored-by: Iblis Lin --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index c52f4224..80cc3ef8 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==5.3 -flake8==3.8.3 +flake8==3.8.4 pyjokes==0.6.0 pytest==6.1.1 pytest-cov==2.10.1 From e33e7f640ab8f813fc9a2ba88d6fa4920032c2b2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 6 Oct 2020 10:10:20 +0200 Subject: [PATCH 390/508] Update beautifulsoup4 to 4.9.3 (#461) Co-authored-by: Frank Jheng --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2e15e57e..affcc706 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.9.2 +beautifulsoup4==4.9.3 peewee==3.13.3 requests==2.24.0 From 010b749afe7fc0f357cff23de505c3ac0130a2bb Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 12 Oct 2020 02:12:07 +0800 Subject: [PATCH 391/508] Add CHANGELOG.md generated by github-changelog-generator --- CHANGELOG.md | 841 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 841 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..2f0689c2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,841 @@ +# Changelog + +## [3.7.0](https://github.com/zdict/zdict/tree/3.7.0) (2020-08-12) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.6.2...3.7.0) + +**Closed issues:** + +- Don't run coveralls for forked pr on CircleCI [\#445](https://github.com/zdict/zdict/issues/445) + +**Merged pull requests:** + +- Add APC e-dictionary to dictionaries \(原住民族委員會 - 原住民族語言線上詞典\) [\#448](https://github.com/zdict/zdict/pull/448) ([mlouielu](https://github.com/mlouielu)) + +## [3.6.2](https://github.com/zdict/zdict/tree/3.6.2) (2020-08-04) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.6.1...3.6.2) + +**Closed issues:** + +- zdict only works with UTF-8 [\#453](https://github.com/zdict/zdict/issues/453) +- Fix iTaigi testings [\#452](https://github.com/zdict/zdict/issues/452) + +**Merged pull requests:** + +- \[\#452\] Sort iTaigi basic\_words before saving into database [\#454](https://github.com/zdict/zdict/pull/454) ([M157q](https://github.com/M157q)) +- Update pytest to 6.0.1 [\#451](https://github.com/zdict/zdict/pull/451) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 5.2.1 [\#449](https://github.com/zdict/zdict/pull/449) ([pyup-bot](https://github.com/pyup-bot)) + +## [3.6.1](https://github.com/zdict/zdict/tree/3.6.1) (2020-07-07) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.6.0...3.6.1) + +## [3.6.0](https://github.com/zdict/zdict/tree/3.6.0) (2020-07-07) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.5.4...3.6.0) + +**Fixed bugs:** + +- could not use oxford dictionary [\#385](https://github.com/zdict/zdict/issues/385) + +**Closed issues:** + +- Enhancements for \#442 [\#443](https://github.com/zdict/zdict/issues/443) +- Add GitHub Code Scanning [\#438](https://github.com/zdict/zdict/issues/438) +- Add "\[ ~ Dependencies scanned by PyUp.io ~ \]" into READAME [\#436](https://github.com/zdict/zdict/issues/436) + +**Merged pull requests:** + +- Issue \#443 [\#446](https://github.com/zdict/zdict/pull/446) ([M157q](https://github.com/M157q)) +- Update coverage to 5.2 [\#444](https://github.com/zdict/zdict/pull/444) ([pyup-bot](https://github.com/pyup-bot)) +- Add NAER terms to dictionaries [\#442](https://github.com/zdict/zdict/pull/442) ([mlouielu](https://github.com/mlouielu)) +- \[\#438\] Create codeql-analysis.yml [\#440](https://github.com/zdict/zdict/pull/440) ([M157q](https://github.com/M157q)) +- Update requests to 2.24.0 [\#439](https://github.com/zdict/zdict/pull/439) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-cov to 2.10.0 [\#437](https://github.com/zdict/zdict/pull/437) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.8.3 [\#435](https://github.com/zdict/zdict/pull/435) ([pyup-bot](https://github.com/pyup-bot)) + +## [3.5.4](https://github.com/zdict/zdict/tree/3.5.4) (2020-06-04) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.5.3...3.5.4) + +**Closed issues:** + +- Add Python 3.8 testings [\#405](https://github.com/zdict/zdict/issues/405) + +## [3.5.3](https://github.com/zdict/zdict/tree/3.5.3) (2020-06-03) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.5.2...3.5.3) + +**Closed issues:** + +- \[CircleCI\] Probably no need to install testing requirements in deploy stage [\#430](https://github.com/zdict/zdict/issues/430) +- `python setup.py test` is deprecated and will be removed in a future version [\#428](https://github.com/zdict/zdict/issues/428) + +**Merged pull requests:** + +- \[\#405\] Add python 3.8 support [\#434](https://github.com/zdict/zdict/pull/434) ([M157q](https://github.com/M157q)) +- Update pytest to 5.4.3 [\#433](https://github.com/zdict/zdict/pull/433) ([pyup-bot](https://github.com/pyup-bot)) +- \[\#428\] Depracate `python setup.py test` [\#432](https://github.com/zdict/zdict/pull/432) ([M157q](https://github.com/M157q)) + +## [3.5.2](https://github.com/zdict/zdict/tree/3.5.2) (2020-06-01) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.5.1...3.5.2) + +**Closed issues:** + +- Use cache for Travis CI OSX build [\#427](https://github.com/zdict/zdict/issues/427) + +**Merged pull requests:** + +- \[\#430\] Remove testing requirements in deploy stage for CircleCI [\#431](https://github.com/zdict/zdict/pull/431) ([M157q](https://github.com/M157q)) +- \[\#427\] Use cache for Travis CI OSX build [\#429](https://github.com/zdict/zdict/pull/429) ([M157q](https://github.com/M157q)) + +## [3.5.1](https://github.com/zdict/zdict/tree/3.5.1) (2020-05-31) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.5.0...3.5.1) + +**Closed issues:** + +- Remove Pipfile and Pipfile.lock [\#425](https://github.com/zdict/zdict/issues/425) +- Run test code with installation from Pipfile too [\#159](https://github.com/zdict/zdict/issues/159) + +**Merged pull requests:** + +- \[\#425\] Remove Pipfile and Pipfile.lock [\#426](https://github.com/zdict/zdict/pull/426) ([M157q](https://github.com/M157q)) +- Update pytest-cov to 2.9.0 [\#424](https://github.com/zdict/zdict/pull/424) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 from 3.7.9 to 3.8.2 [\#421](https://github.com/zdict/zdict/pull/421) ([M157q](https://github.com/M157q)) + +## [3.5.0](https://github.com/zdict/zdict/tree/3.5.0) (2020-05-29) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.4.1...3.5.0) + +**Closed issues:** + +- pip 20.1 changed something related to `parse\_requirements` [\#418](https://github.com/zdict/zdict/issues/418) + +**Merged pull requests:** + +- \[\#385\] Fix Oxford dictionary [\#423](https://github.com/zdict/zdict/pull/423) ([M157q](https://github.com/M157q)) +- Update pytest-cov from 2.8.1 to 2.9.0 [\#422](https://github.com/zdict/zdict/pull/422) ([M157q](https://github.com/M157q)) +- Update beautifulsoup4 from 4.9.0 to 4.9.1 [\#420](https://github.com/zdict/zdict/pull/420) ([M157q](https://github.com/M157q)) +- Update pytest-flake8 from 1.0.5 to 1.0.6 [\#416](https://github.com/zdict/zdict/pull/416) ([M157q](https://github.com/M157q)) +- Update pytest from 5.4.1 to 5.4.2 [\#414](https://github.com/zdict/zdict/pull/414) ([M157q](https://github.com/M157q)) + +## [3.4.1](https://github.com/zdict/zdict/tree/3.4.1) (2020-05-29) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.4.0...3.4.1) + +**Fixed bugs:** + +- Spanish dict is broken again [\#413](https://github.com/zdict/zdict/issues/413) + +**Merged pull requests:** + +- \[\#418\] Fix CI problem for pip\>=20.1 related to parse\_requirements [\#419](https://github.com/zdict/zdict/pull/419) ([M157q](https://github.com/M157q)) + +## [3.4.0](https://github.com/zdict/zdict/tree/3.4.0) (2020-05-16) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.3.0...3.4.0) + +**Fixed bugs:** + +- Failed to build gnureadline on Travis CI with Python 3.6.8 & 3.7.2 [\#407](https://github.com/zdict/zdict/issues/407) + +**Closed issues:** + +- How to run in Jupiter notebook? [\#412](https://github.com/zdict/zdict/issues/412) + +**Merged pull requests:** + +- \[\#413\] Fix spanish dict [\#417](https://github.com/zdict/zdict/pull/417) ([M157q](https://github.com/M157q)) +- \[\#407\] Fix gnureadline installation on Travis CI with Python 3.6.8 & 3.7.2 [\#411](https://github.com/zdict/zdict/pull/411) ([M157q](https://github.com/M157q)) +- Update peewee to 3.13.3 [\#410](https://github.com/zdict/zdict/pull/410) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-flake8 to 1.0.5 [\#409](https://github.com/zdict/zdict/pull/409) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 5.1 [\#404](https://github.com/zdict/zdict/pull/404) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.9.0 [\#403](https://github.com/zdict/zdict/pull/403) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.4.1 [\#400](https://github.com/zdict/zdict/pull/400) ([pyup-bot](https://github.com/pyup-bot)) +- Update requests to 2.23.0 [\#399](https://github.com/zdict/zdict/pull/399) ([pyup-bot](https://github.com/pyup-bot)) + +## [3.3.0](https://github.com/zdict/zdict/tree/3.3.0) (2020-04-22) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.2.0...3.3.0) + +**Fixed bugs:** + +- Something went wrong on YahooDict [\#406](https://github.com/zdict/zdict/issues/406) + +**Merged pull requests:** + +- \[\#406\] Fix yahoo dict missing example sentences bug [\#408](https://github.com/zdict/zdict/pull/408) ([M157q](https://github.com/M157q)) + +## [3.2.0](https://github.com/zdict/zdict/tree/3.2.0) (2020-04-22) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.1.0...3.2.0) + +**Merged pull requests:** + +- spanish: migrate query URL to HTTPS [\#396](https://github.com/zdict/zdict/pull/396) ([iblis17](https://github.com/iblis17)) +- Fix travis ci [\#394](https://github.com/zdict/zdict/pull/394) ([iblis17](https://github.com/iblis17)) +- Update pytest to 5.3.0 [\#383](https://github.com/zdict/zdict/pull/383) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.2.4 [\#382](https://github.com/zdict/zdict/pull/382) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.7.9 [\#380](https://github.com/zdict/zdict/pull/380) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.2.2 [\#379](https://github.com/zdict/zdict/pull/379) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-cov to 2.8.1 [\#377](https://github.com/zdict/zdict/pull/377) ([pyup-bot](https://github.com/pyup-bot)) + +## [3.1.0](https://github.com/zdict/zdict/tree/3.1.0) (2019-11-04) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.0.2...3.1.0) + +**Closed issues:** + +- Is Urban Dictionary API free to use? [\#369](https://github.com/zdict/zdict/issues/369) +- iTaigi is not working [\#365](https://github.com/zdict/zdict/issues/365) + +**Merged pull requests:** + +- update for yahoo dictionary web changes [\#381](https://github.com/zdict/zdict/pull/381) ([iblis17](https://github.com/iblis17)) +- Update beautifulsoup4 to 4.8.1 [\#378](https://github.com/zdict/zdict/pull/378) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.2.0 [\#375](https://github.com/zdict/zdict/pull/375) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.11.2 [\#374](https://github.com/zdict/zdict/pull/374) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.11.1 [\#373](https://github.com/zdict/zdict/pull/373) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.1.3 [\#372](https://github.com/zdict/zdict/pull/372) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.11.0 [\#371](https://github.com/zdict/zdict/pull/371) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.1.2 [\#370](https://github.com/zdict/zdict/pull/370) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.1.1 [\#368](https://github.com/zdict/zdict/pull/368) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.1.0 [\#367](https://github.com/zdict/zdict/pull/367) ([pyup-bot](https://github.com/pyup-bot)) +- Update pyjokes to 0.6.0 [\#366](https://github.com/zdict/zdict/pull/366) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.10.0 [\#364](https://github.com/zdict/zdict/pull/364) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.5.4 [\#363](https://github.com/zdict/zdict/pull/363) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.8.0 [\#362](https://github.com/zdict/zdict/pull/362) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.0.1 [\#361](https://github.com/zdict/zdict/pull/361) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 5.0.0 [\#359](https://github.com/zdict/zdict/pull/359) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2019.6.16 [\#356](https://github.com/zdict/zdict/pull/356) ([pyup-bot](https://github.com/pyup-bot)) + +## [3.0.2](https://github.com/zdict/zdict/tree/3.0.2) (2019-06-20) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.0.1...3.0.2) + +**Closed issues:** + +- Make testings of iTaigi dictionary stable [\#357](https://github.com/zdict/zdict/issues/357) + +**Merged pull requests:** + +- \[\#357\] Extends query\_timeout for iTaigi to avoid timeout [\#358](https://github.com/zdict/zdict/pull/358) ([M157q](https://github.com/M157q)) + +## [3.0.1](https://github.com/zdict/zdict/tree/3.0.1) (2019-06-18) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.0.0...3.0.1) + +## [3.0.0](https://github.com/zdict/zdict/tree/3.0.0) (2019-06-18) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.1.1...3.0.0) + +**Merged pull requests:** + +- Update requests to 2.22.0 [\#349](https://github.com/zdict/zdict/pull/349) ([pyup-bot](https://github.com/pyup-bot)) + +## [2.1.1](https://github.com/zdict/zdict/tree/2.1.1) (2019-06-17) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.1.0...2.1.1) + +**Closed issues:** + +- iTaigi 愛台語 [\#115](https://github.com/zdict/zdict/issues/115) + +**Merged pull requests:** + +- Update flake8 to 3.7.8 [\#360](https://github.com/zdict/zdict/pull/360) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.6.3 [\#355](https://github.com/zdict/zdict/pull/355) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.6 [\#354](https://github.com/zdict/zdict/pull/354) ([pyup-bot](https://github.com/pyup-bot)) +- Update pluggy to 0.12.0 [\#351](https://github.com/zdict/zdict/pull/351) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.25.3 [\#350](https://github.com/zdict/zdict/pull/350) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.5.0 [\#348](https://github.com/zdict/zdict/pull/348) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.4.2 [\#347](https://github.com/zdict/zdict/pull/347) ([pyup-bot](https://github.com/pyup-bot)) +- Update pluggy to 0.11.0 [\#346](https://github.com/zdict/zdict/pull/346) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-cov to 2.7.1 [\#345](https://github.com/zdict/zdict/pull/345) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.25.2 [\#344](https://github.com/zdict/zdict/pull/344) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.5 [\#341](https://github.com/zdict/zdict/pull/341) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.25.1 [\#340](https://github.com/zdict/zdict/pull/340) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.25 [\#339](https://github.com/zdict/zdict/pull/339) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.24.2 [\#338](https://github.com/zdict/zdict/pull/338) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.4.1 [\#337](https://github.com/zdict/zdict/pull/337) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.4 [\#336](https://github.com/zdict/zdict/pull/336) ([pyup-bot](https://github.com/pyup-bot)) + +## [2.1.0](https://github.com/zdict/zdict/tree/2.1.0) (2019-04-06) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.0.4...2.1.0) + +**Merged pull requests:** + +- Update pytest to 4.4.0 [\#335](https://github.com/zdict/zdict/pull/335) ([pyup-bot](https://github.com/pyup-bot)) +- \[\#115\] Add iTaigi [\#334](https://github.com/zdict/zdict/pull/334) ([M157q](https://github.com/M157q)) +- Update more-itertools to 7.0.0 [\#333](https://github.com/zdict/zdict/pull/333) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.3 [\#332](https://github.com/zdict/zdict/pull/332) ([pyup-bot](https://github.com/pyup-bot)) + +## [2.0.4](https://github.com/zdict/zdict/tree/2.0.4) (2019-03-22) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.0.3...2.0.4) + +**Closed issues:** + +- Command "python setup.py egg\_info" failed with error code 1 in /private/tmp/pip-install-d6jh0yc4/zdict/ [\#331](https://github.com/zdict/zdict/issues/331) + +## [2.0.3](https://github.com/zdict/zdict/tree/2.0.3) (2019-03-21) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.0.2...2.0.3) + +**Merged pull requests:** + +- Update pytest to 4.3.1 [\#330](https://github.com/zdict/zdict/pull/330) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.5.3 [\#329](https://github.com/zdict/zdict/pull/329) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2019.3.9 [\#328](https://github.com/zdict/zdict/pull/328) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.2 [\#327](https://github.com/zdict/zdict/pull/327) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.1 [\#326](https://github.com/zdict/zdict/pull/326) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.9.0 [\#325](https://github.com/zdict/zdict/pull/325) ([pyup-bot](https://github.com/pyup-bot)) +- Update attrs to 19.1.0 [\#324](https://github.com/zdict/zdict/pull/324) ([pyup-bot](https://github.com/pyup-bot)) +- Update pyflakes to 2.1.1 [\#323](https://github.com/zdict/zdict/pull/323) ([pyup-bot](https://github.com/pyup-bot)) + +## [2.0.2](https://github.com/zdict/zdict/tree/2.0.2) (2019-02-26) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.0.1...2.0.2) + +**Fixed bugs:** + +- Search exception for Urban if word is not existing [\#314](https://github.com/zdict/zdict/issues/314) + +**Merged pull requests:** + +- \[\#314\] Fix bug of Urban dict [\#322](https://github.com/zdict/zdict/pull/322) ([M157q](https://github.com/M157q)) + +## [2.0.1](https://github.com/zdict/zdict/tree/2.0.1) (2019-02-25) + +[Full Changelog](https://github.com/zdict/zdict/compare/2.0.0...2.0.1) + +**Fixed bugs:** + +- Search exception for Spanish with "tranquilo" [\#315](https://github.com/zdict/zdict/issues/315) + +**Merged pull requests:** + +- \[\#315\] Fix bug of Spanish Dict [\#321](https://github.com/zdict/zdict/pull/321) ([M157q](https://github.com/M157q)) +- Update flake8 to 3.7.7 [\#320](https://github.com/zdict/zdict/pull/320) ([pyup-bot](https://github.com/pyup-bot)) +- Update pluggy to 0.9.0 [\#319](https://github.com/zdict/zdict/pull/319) ([pyup-bot](https://github.com/pyup-bot)) +- Update py to 1.8.0 [\#318](https://github.com/zdict/zdict/pull/318) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.3.0 [\#317](https://github.com/zdict/zdict/pull/317) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.7.6 [\#316](https://github.com/zdict/zdict/pull/316) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.2.1 [\#313](https://github.com/zdict/zdict/pull/313) ([pyup-bot](https://github.com/pyup-bot)) +- Update more-itertools to 6.0.0 [\#312](https://github.com/zdict/zdict/pull/312) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.7.5 [\#311](https://github.com/zdict/zdict/pull/311) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-flake8 to 1.0.4 [\#309](https://github.com/zdict/zdict/pull/309) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.2.0 [\#308](https://github.com/zdict/zdict/pull/308) ([pyup-bot](https://github.com/pyup-bot)) + +## [2.0.0](https://github.com/zdict/zdict/tree/2.0.0) (2019-02-16) + +[Full Changelog](https://github.com/zdict/zdict/compare/1.0.2...2.0.0) + +**Closed issues:** + +- Add CircleCI [\#278](https://github.com/zdict/zdict/issues/278) + +**Merged pull requests:** + +- Update pycodestyle to 2.5.0 [\#306](https://github.com/zdict/zdict/pull/306) ([pyup-bot](https://github.com/pyup-bot)) +- Update pyflakes to 2.1.0 [\#305](https://github.com/zdict/zdict/pull/305) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.8.2 [\#304](https://github.com/zdict/zdict/pull/304) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-flake8 to 1.0.3 [\#303](https://github.com/zdict/zdict/pull/303) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.1.1 [\#302](https://github.com/zdict/zdict/pull/302) ([pyup-bot](https://github.com/pyup-bot)) +- Update pluggy to 0.8.1 [\#301](https://github.com/zdict/zdict/pull/301) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.8.1 [\#300](https://github.com/zdict/zdict/pull/300) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.7.1 [\#299](https://github.com/zdict/zdict/pull/299) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-cov to 2.6.1 [\#298](https://github.com/zdict/zdict/pull/298) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.7.0 [\#296](https://github.com/zdict/zdict/pull/296) ([pyup-bot](https://github.com/pyup-bot)) +- Update more-itertools to 5.0.0 [\#295](https://github.com/zdict/zdict/pull/295) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.8.0 [\#294](https://github.com/zdict/zdict/pull/294) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.0.2 [\#293](https://github.com/zdict/zdict/pull/293) ([pyup-bot](https://github.com/pyup-bot)) +- Update requests to 2.21.0 [\#292](https://github.com/zdict/zdict/pull/292) ([pyup-bot](https://github.com/pyup-bot)) +- Update six to 1.12.0 [\#291](https://github.com/zdict/zdict/pull/291) ([pyup-bot](https://github.com/pyup-bot)) +- Update idna to 2.8 [\#290](https://github.com/zdict/zdict/pull/290) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2018.11.29 [\#288](https://github.com/zdict/zdict/pull/288) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.0.1 [\#287](https://github.com/zdict/zdict/pull/287) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 4.0.0 [\#286](https://github.com/zdict/zdict/pull/286) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.5.2 [\#285](https://github.com/zdict/zdict/pull/285) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.10.1 [\#284](https://github.com/zdict/zdict/pull/284) ([pyup-bot](https://github.com/pyup-bot)) +- Update requests to 2.20.1 [\#283](https://github.com/zdict/zdict/pull/283) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.10.0 [\#282](https://github.com/zdict/zdict/pull/282) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.24.1 [\#281](https://github.com/zdict/zdict/pull/281) ([pyup-bot](https://github.com/pyup-bot)) +- \[\#278\] Add CircleCI [\#279](https://github.com/zdict/zdict/pull/279) ([M157q](https://github.com/M157q)) + +## [1.0.2](https://github.com/zdict/zdict/tree/1.0.2) (2018-10-28) + +[Full Changelog](https://github.com/zdict/zdict/compare/v1.0.1...1.0.2) + +**Closed issues:** + +- Wiktionary support [\#196](https://github.com/zdict/zdict/issues/196) + +**Merged pull requests:** + +- Update pytest to 3.9.3 [\#280](https://github.com/zdict/zdict/pull/280) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.6.0 [\#277](https://github.com/zdict/zdict/pull/277) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.9.2 [\#276](https://github.com/zdict/zdict/pull/276) ([pyup-bot](https://github.com/pyup-bot)) +- Update requests to 2.20.0 [\#275](https://github.com/zdict/zdict/pull/275) ([pyup-bot](https://github.com/pyup-bot)) +- Add verbose mode to Wiktionary [\#274](https://github.com/zdict/zdict/pull/274) ([Offpics](https://github.com/Offpics)) +- Update urllib3 to 1.24 [\#273](https://github.com/zdict/zdict/pull/273) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.9.1 [\#272](https://github.com/zdict/zdict/pull/272) ([pyup-bot](https://github.com/pyup-bot)) + +## [v1.0.1](https://github.com/zdict/zdict/tree/v1.0.1) (2018-10-16) + +[Full Changelog](https://github.com/zdict/zdict/compare/v1.0.0...v1.0.1) + +## [v1.0.0](https://github.com/zdict/zdict/tree/v1.0.0) (2018-10-16) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.12.3...v1.0.0) + +**Fixed bugs:** + +- Fix test of Jisho [\#265](https://github.com/zdict/zdict/issues/265) + +**Merged pull requests:** + +- Update pluggy to 0.8.0 [\#271](https://github.com/zdict/zdict/pull/271) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2018.10.15 [\#270](https://github.com/zdict/zdict/pull/270) ([pyup-bot](https://github.com/pyup-bot)) +- Add wiktionary [\#269](https://github.com/zdict/zdict/pull/269) ([Offpics](https://github.com/Offpics)) +- Update beautifulsoup4 to 4.6.3 [\#268](https://github.com/zdict/zdict/pull/268) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.6.3 [\#267](https://github.com/zdict/zdict/pull/267) ([pyup-bot](https://github.com/pyup-bot)) +- \[\#265\] Fix test of Jisho [\#266](https://github.com/zdict/zdict/pull/266) ([M157q](https://github.com/M157q)) +- Update py to 1.7.0 [\#264](https://github.com/zdict/zdict/pull/264) ([pyup-bot](https://github.com/pyup-bot)) +- Update urllib3 to 1.23 [\#263](https://github.com/zdict/zdict/pull/263) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.7.1 [\#261](https://github.com/zdict/zdict/pull/261) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.8.2 [\#260](https://github.com/zdict/zdict/pull/260) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.8.1 [\#259](https://github.com/zdict/zdict/pull/259) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.8.0 [\#258](https://github.com/zdict/zdict/pull/258) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.7.0 [\#257](https://github.com/zdict/zdict/pull/257) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-cov to 2.6.0 [\#256](https://github.com/zdict/zdict/pull/256) ([pyup-bot](https://github.com/pyup-bot)) +- Update attrs to 18.2.0 [\#255](https://github.com/zdict/zdict/pull/255) ([pyup-bot](https://github.com/pyup-bot)) + +## [v0.12.3](https://github.com/zdict/zdict/tree/v0.12.3) (2018-08-29) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.12.2...v0.12.3) + +**Closed issues:** + +- Oxford dictionary support [\#199](https://github.com/zdict/zdict/issues/199) +- Yandex Translate support [\#109](https://github.com/zdict/zdict/issues/109) +- Fallback feature for db [\#92](https://github.com/zdict/zdict/issues/92) +- Does zdict has to query every arguments, or concat them into one phrase? [\#61](https://github.com/zdict/zdict/issues/61) + +**Merged pull requests:** + +- Update beautifulsoup4 from 4.6.1 to 4.6.3 [\#254](https://github.com/zdict/zdict/pull/254) ([M157q](https://github.com/M157q)) +- Update pytest from 3.7.1 to 3.7.3 [\#253](https://github.com/zdict/zdict/pull/253) ([M157q](https://github.com/M157q)) +- Update py to 1.6.0 [\#252](https://github.com/zdict/zdict/pull/252) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2018.8.24 [\#251](https://github.com/zdict/zdict/pull/251) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2018.8.13 [\#250](https://github.com/zdict/zdict/pull/250) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.7.1 [\#249](https://github.com/zdict/zdict/pull/249) ([pyup-bot](https://github.com/pyup-bot)) +- Update more-itertools to 4.3.0 [\#248](https://github.com/zdict/zdict/pull/248) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.7.0 [\#247](https://github.com/zdict/zdict/pull/247) ([pyup-bot](https://github.com/pyup-bot)) +- Update pluggy to 0.7.1 [\#246](https://github.com/zdict/zdict/pull/246) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.6.4 [\#245](https://github.com/zdict/zdict/pull/245) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.6.1 [\#244](https://github.com/zdict/zdict/pull/244) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-flake8 to 1.0.2 [\#243](https://github.com/zdict/zdict/pull/243) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.6.4 [\#242](https://github.com/zdict/zdict/pull/242) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.6.3 [\#239](https://github.com/zdict/zdict/pull/239) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.5.2 [\#238](https://github.com/zdict/zdict/pull/238) ([pyup-bot](https://github.com/pyup-bot)) +- 📖 Add table of content to README [\#237](https://github.com/zdict/zdict/pull/237) ([wdv4758h](https://github.com/wdv4758h)) + +## [v0.12.2](https://github.com/zdict/zdict/tree/v0.12.2) (2018-07-01) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.12.1...v0.12.2) + +**Closed issues:** + +- python 2 support [\#235](https://github.com/zdict/zdict/issues/235) + +**Merged pull requests:** + +- Fix yahoo dict exception [\#236](https://github.com/zdict/zdict/pull/236) ([wdv4758h](https://github.com/wdv4758h)) +- Update peewee to 3.5.1 [\#234](https://github.com/zdict/zdict/pull/234) ([pyup-bot](https://github.com/pyup-bot)) +- Update py to 1.5.4 [\#233](https://github.com/zdict/zdict/pull/233) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.6.2 [\#232](https://github.com/zdict/zdict/pull/232) ([pyup-bot](https://github.com/pyup-bot)) +- Update requests to 2.19.1 [\#231](https://github.com/zdict/zdict/pull/231) ([pyup-bot](https://github.com/pyup-bot)) +- Update idna to 2.7 [\#229](https://github.com/zdict/zdict/pull/229) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.6.1 [\#228](https://github.com/zdict/zdict/pull/228) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.5.0 [\#227](https://github.com/zdict/zdict/pull/227) ([pyup-bot](https://github.com/pyup-bot)) +- Update more-itertools to 4.2.0 [\#226](https://github.com/zdict/zdict/pull/226) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.6.0 [\#225](https://github.com/zdict/zdict/pull/225) ([pyup-bot](https://github.com/pyup-bot)) +- Update pyflakes to 2.0.0 [\#224](https://github.com/zdict/zdict/pull/224) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.4.0 [\#223](https://github.com/zdict/zdict/pull/223) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.3.4 [\#222](https://github.com/zdict/zdict/pull/222) ([pyup-bot](https://github.com/pyup-bot)) +- Update attrs to 18.1.0 [\#221](https://github.com/zdict/zdict/pull/221) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.3.3 [\#220](https://github.com/zdict/zdict/pull/220) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.3.2 [\#219](https://github.com/zdict/zdict/pull/219) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-flake8 to 1.0.1 [\#218](https://github.com/zdict/zdict/pull/218) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.3.1 [\#217](https://github.com/zdict/zdict/pull/217) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.5.1 [\#216](https://github.com/zdict/zdict/pull/216) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.3.0 [\#215](https://github.com/zdict/zdict/pull/215) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.2.5 [\#214](https://github.com/zdict/zdict/pull/214) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.2.4 [\#213](https://github.com/zdict/zdict/pull/213) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2018.4.16 [\#212](https://github.com/zdict/zdict/pull/212) ([pyup-bot](https://github.com/pyup-bot)) + +## [v0.12.1](https://github.com/zdict/zdict/tree/v0.12.1) (2018-04-15) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.12.0...v0.12.1) + +**Merged pull requests:** + +- Update pycodestyle to 2.4.0 [\#210](https://github.com/zdict/zdict/pull/210) ([pyup-bot](https://github.com/pyup-bot)) + +## [v0.12.0](https://github.com/zdict/zdict/tree/v0.12.0) (2018-04-10) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.11.0...v0.12.0) + +**Merged pull requests:** + +- Upgrade to v0.12.0 [\#211](https://github.com/zdict/zdict/pull/211) ([wdv4758h](https://github.com/wdv4758h)) +- add oxford dictionary [\#209](https://github.com/zdict/zdict/pull/209) ([tzing](https://github.com/tzing)) +- Update peewee to 3.2.2 [\#208](https://github.com/zdict/zdict/pull/208) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.5.0 [\#207](https://github.com/zdict/zdict/pull/207) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.2.1 [\#206](https://github.com/zdict/zdict/pull/206) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.2.0 [\#205](https://github.com/zdict/zdict/pull/205) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.1.7 [\#204](https://github.com/zdict/zdict/pull/204) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.5.0 [\#202](https://github.com/zdict/zdict/pull/202) ([pyup-bot](https://github.com/pyup-bot)) +- Update py to 1.5.3 [\#201](https://github.com/zdict/zdict/pull/201) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-flake8 to 1.0.0 [\#200](https://github.com/zdict/zdict/pull/200) ([pyup-bot](https://github.com/pyup-bot)) +- Upgrade OSX CI test version to CPython 3.4.8/3.5.5/3.6.4 [\#198](https://github.com/zdict/zdict/pull/198) ([wdv4758h](https://github.com/wdv4758h)) + +## [v0.11.0](https://github.com/zdict/zdict/tree/v0.11.0) (2018-03-17) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.10.3...v0.11.0) + +**Fixed bugs:** + +- Yahoo dictionary changed, zdict can not display the result [\#193](https://github.com/zdict/zdict/issues/193) + +**Closed issues:** + +- Upgrade to peewee 3.0.x [\#170](https://github.com/zdict/zdict/issues/170) + +**Merged pull requests:** + +- Upgrade to v0.11.0 [\#197](https://github.com/zdict/zdict/pull/197) ([wdv4758h](https://github.com/wdv4758h)) +- ydict: new format [\#195](https://github.com/zdict/zdict/pull/195) ([iblis17](https://github.com/iblis17)) +- Update peewee to 3.1.5 [\#194](https://github.com/zdict/zdict/pull/194) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.4.2 [\#191](https://github.com/zdict/zdict/pull/191) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.1.2 [\#190](https://github.com/zdict/zdict/pull/190) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 3.1.1 [\#189](https://github.com/zdict/zdict/pull/189) ([pyup-bot](https://github.com/pyup-bot)) + +## [v0.10.3](https://github.com/zdict/zdict/tree/v0.10.3) (2018-02-24) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.10.2...v0.10.3) + +**Merged pull requests:** + +- Update flake8 to 3.5.0, pytest-flake8 to 0.9.1 [\#188](https://github.com/zdict/zdict/pull/188) ([wdv4758h](https://github.com/wdv4758h)) +- Update peewee to 3.1.0 [\#185](https://github.com/zdict/zdict/pull/185) ([pyup-bot](https://github.com/pyup-bot)) + +## [v0.10.2](https://github.com/zdict/zdict/tree/v0.10.2) (2018-02-24) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.10.1...v0.10.2) + +**Fixed bugs:** + +- import error on Windows, no "HOME" environment variable [\#148](https://github.com/zdict/zdict/issues/148) + +**Merged pull requests:** + +- README: remove useless badge [\#187](https://github.com/zdict/zdict/pull/187) ([iblis17](https://github.com/iblis17)) + +## [v0.10.1](https://github.com/zdict/zdict/tree/v0.10.1) (2018-02-24) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.10.0...v0.10.1) + +**Closed issues:** + +- Interactive mode hangs when users change to the nework different from the one they were using when started zdict [\#134](https://github.com/zdict/zdict/issues/134) +- Initial Update [\#130](https://github.com/zdict/zdict/issues/130) +- Auto deploying new image to Docker Hub when there's a new version. [\#98](https://github.com/zdict/zdict/issues/98) + +**Merged pull requests:** + +- Upgrade version to 0.10.1 [\#186](https://github.com/zdict/zdict/pull/186) ([M157q](https://github.com/M157q)) +- Update pytest to 3.4.1 [\#183](https://github.com/zdict/zdict/pull/183) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.5.1 [\#181](https://github.com/zdict/zdict/pull/181) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.5 [\#173](https://github.com/zdict/zdict/pull/173) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.4.0 [\#168](https://github.com/zdict/zdict/pull/168) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.3.2 [\#160](https://github.com/zdict/zdict/pull/160) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 2.10.2 [\#158](https://github.com/zdict/zdict/pull/158) ([pyup-bot](https://github.com/pyup-bot)) +- Update pyflakes to 1.6.0 [\#157](https://github.com/zdict/zdict/pull/157) ([pyup-bot](https://github.com/pyup-bot)) +- Update py to 1.5.2 [\#156](https://github.com/zdict/zdict/pull/156) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2018.1.18 [\#155](https://github.com/zdict/zdict/pull/155) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.4.2 [\#153](https://github.com/zdict/zdict/pull/153) ([pyup-bot](https://github.com/pyup-bot)) +- Open pyup support for Pipfile [\#151](https://github.com/zdict/zdict/pull/151) ([wdv4758h](https://github.com/wdv4758h)) +- Update pytest to 3.3.2 [\#150](https://github.com/zdict/zdict/pull/150) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.3.1 [\#147](https://github.com/zdict/zdict/pull/147) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.3.0 [\#146](https://github.com/zdict/zdict/pull/146) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.2.5 [\#145](https://github.com/zdict/zdict/pull/145) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.2.4 [\#144](https://github.com/zdict/zdict/pull/144) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 4.4.2 [\#143](https://github.com/zdict/zdict/pull/143) ([pyup-bot](https://github.com/pyup-bot)) +- Update peewee to 2.10.2 [\#138](https://github.com/zdict/zdict/pull/138) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 3.2.3 [\#137](https://github.com/zdict/zdict/pull/137) ([pyup-bot](https://github.com/pyup-bot)) +- Modify the part related to docker in README for issue-98 [\#133](https://github.com/zdict/zdict/pull/133) ([M157q](https://github.com/M157q)) +- \[\#98\] Install `locales` for using `locale-gen` for Docker [\#132](https://github.com/zdict/zdict/pull/132) ([M157q](https://github.com/M157q)) +- \[\#130\] Pinned versions of packages in requirements [\#131](https://github.com/zdict/zdict/pull/131) ([M157q](https://github.com/M157q)) + +## [v0.10.0](https://github.com/zdict/zdict/tree/v0.10.0) (2017-08-31) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.7...v0.10.0) + +**Closed issues:** + +- \[Bug\] zdict interactive mode failed with python3.6 on OSX [\#121](https://github.com/zdict/zdict/issues/121) + +**Merged pull requests:** + +- Add pipenv data [\#135](https://github.com/zdict/zdict/pull/135) ([wdv4758h](https://github.com/wdv4758h)) +- \[zdict-0.10.0\] [\#129](https://github.com/zdict/zdict/pull/129) ([wdv4758h](https://github.com/wdv4758h)) +- Upgrade all dependencies and CPython version [\#128](https://github.com/zdict/zdict/pull/128) ([wdv4758h](https://github.com/wdv4758h)) +- Add Yandex Translate API support [\#127](https://github.com/zdict/zdict/pull/127) ([wdv4758h](https://github.com/wdv4758h)) +- Fix typo in README.rst [\#126](https://github.com/zdict/zdict/pull/126) ([M157q](https://github.com/M157q)) +- \[README\] Fix some typos. [\#125](https://github.com/zdict/zdict/pull/125) ([M157q](https://github.com/M157q)) +- Fix the Docker Hub link in README. [\#124](https://github.com/zdict/zdict/pull/124) ([M157q](https://github.com/M157q)) + +## [v0.9.7](https://github.com/zdict/zdict/tree/v0.9.7) (2017-04-04) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.6...v0.9.7) + +**Fixed bugs:** + +- Interactive mode failed to start with peewee \>= 2.8.7 [\#119](https://github.com/zdict/zdict/issues/119) +- Interactive mode crashes due to gnureadline [\#111](https://github.com/zdict/zdict/pull/111) ([hungys](https://github.com/hungys)) + +**Closed issues:** + +- Taiwaness Moe Dict support [\#108](https://github.com/zdict/zdict/issues/108) + +**Merged pull requests:** + +- \[zdict-0.9.7\] [\#123](https://github.com/zdict/zdict/pull/123) ([M157q](https://github.com/M157q)) +- \[\#119\] Fix Peewee connection [\#120](https://github.com/zdict/zdict/pull/120) ([wdv4758h](https://github.com/wdv4758h)) +- \[\#108\] add Taiwanese Moe Dict [\#114](https://github.com/zdict/zdict/pull/114) ([wdv4758h](https://github.com/wdv4758h)) +- \[travis\] enable macOS [\#113](https://github.com/zdict/zdict/pull/113) ([wdv4758h](https://github.com/wdv4758h)) +- \[travis\] add python3.6 [\#112](https://github.com/zdict/zdict/pull/112) ([iblis17](https://github.com/iblis17)) +- Fix Yahoo Dictionary to get the url of mp3 file. [\#103](https://github.com/zdict/zdict/pull/103) ([M157q](https://github.com/M157q)) + +## [v0.9.6](https://github.com/zdict/zdict/tree/v0.9.6) (2016-08-31) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.5...v0.9.6) + +**Fixed bugs:** + +- zdict crashes when querying ``style`` [\#100](https://github.com/zdict/zdict/issues/100) + +**Closed issues:** + +- iblis need a zdict mascot [\#13](https://github.com/zdict/zdict/issues/13) + +**Merged pull requests:** + +- \[\#101\] Add unit test for YahooDict of vocabulary 'style' [\#102](https://github.com/zdict/zdict/pull/102) ([M157q](https://github.com/M157q)) +- \[\#100\] prevent ``KeyError`` being caused crash [\#101](https://github.com/zdict/zdict/pull/101) ([pi314](https://github.com/pi314)) +- Auto deploying to PyPI when there's a new version. [\#97](https://github.com/zdict/zdict/pull/97) ([M157q](https://github.com/M157q)) + +## [v0.9.5](https://github.com/zdict/zdict/tree/v0.9.5) (2016-06-30) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.4...v0.9.5) + +**Fixed bugs:** + +- Tests failed on Travis CI [\#95](https://github.com/zdict/zdict/issues/95) + +**Merged pull requests:** + +- Use requirements.txt and test-requirements.txt for setup.py [\#96](https://github.com/zdict/zdict/pull/96) ([M157q](https://github.com/M157q)) +- Add docker support [\#94](https://github.com/zdict/zdict/pull/94) ([M157q](https://github.com/M157q)) + +## [v0.9.4](https://github.com/zdict/zdict/tree/v0.9.4) (2016-05-16) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.3...v0.9.4) + +**Fixed bugs:** + +- Installed and get an exception [\#91](https://github.com/zdict/zdict/pull/91) ([simonweil](https://github.com/simonweil)) + +## [v0.9.3](https://github.com/zdict/zdict/tree/v0.9.3) (2016-05-09) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.2...v0.9.3) + +**Fixed bugs:** + +- zdict-0.9.2 ``-ld`` option is broken [\#93](https://github.com/zdict/zdict/pull/93) ([pi314](https://github.com/pi314)) + +**Closed issues:** + +- Multithread \(or Multiprocess\) support for dictionaries lookup [\#55](https://github.com/zdict/zdict/issues/55) +- `ydictrc` re-design [\#6](https://github.com/zdict/zdict/issues/6) + +## [v0.9.2](https://github.com/zdict/zdict/tree/v0.9.2) (2016-04-17) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.1...v0.9.2) + +**Fixed bugs:** + +- YahooDict quit unexpectedly while querying the word "relate" [\#89](https://github.com/zdict/zdict/pull/89) ([M157q](https://github.com/M157q)) + +## [v0.9.1](https://github.com/zdict/zdict/tree/v0.9.1) (2016-04-17) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.9.0...v0.9.1) + +**Fixed bugs:** + +- Can not initiate interactive mode [\#90](https://github.com/zdict/zdict/pull/90) ([M157q](https://github.com/M157q)) + +## [v0.9.0](https://github.com/zdict/zdict/tree/v0.9.0) (2016-04-17) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.8.0...v0.9.0) + +**Closed issues:** + +- Remove the `verbose` argument of `query\(\)` function for all dictionaries [\#80](https://github.com/zdict/zdict/issues/80) +- Add an option for shell completion [\#56](https://github.com/zdict/zdict/issues/56) + +**Merged pull requests:** + +- \[Refine \#76\] Avoid storing test data in repo. [\#84](https://github.com/zdict/zdict/pull/84) ([M157q](https://github.com/M157q)) +- Add `-D/--debug` mode? [\#82](https://github.com/zdict/zdict/pull/82) ([M157q](https://github.com/M157q)) + +## [v0.8.0](https://github.com/zdict/zdict/tree/v0.8.0) (2016-04-17) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.7.1...v0.8.0) + +**Fixed bugs:** + +- Use 0 as the argument for -j option causes error [\#87](https://github.com/zdict/zdict/pull/87) ([M157q](https://github.com/M157q)) + +**Merged pull requests:** + +- Interactive prompt with multiprocessing cannot catch `KeyboardInterrupt` [\#88](https://github.com/zdict/zdict/pull/88) ([M157q](https://github.com/M157q)) +- Using absolute import if possible [\#83](https://github.com/zdict/zdict/pull/83) ([iblis17](https://github.com/iblis17)) +- flake8 format checking in ci build [\#78](https://github.com/zdict/zdict/pull/78) ([iblis17](https://github.com/iblis17)) +- add multiprocessing support [\#86](https://github.com/zdict/zdict/pull/86) ([wdv4758h](https://github.com/wdv4758h)) + +## [v0.7.1](https://github.com/zdict/zdict/tree/v0.7.1) (2016-04-01) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.7...v0.7.1) + +**Fixed bugs:** + +- Tuple unpack error when Spanish dict query "resent" [\#76](https://github.com/zdict/zdict/pull/76) ([pi314](https://github.com/pi314)) + +**Closed issues:** + +- Upload to PyPI [\#2](https://github.com/zdict/zdict/issues/2) + +## [v0.0.7](https://github.com/zdict/zdict/tree/v0.0.7) (2016-03-27) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.6...v0.0.7) + +**Fixed bugs:** + +- YahooDict only colorize first word occurrence in a sentence [\#59](https://github.com/zdict/zdict/issues/59) +- \[Bug\] zdict hangs when user connected to network but no routing [\#52](https://github.com/zdict/zdict/issues/52) +- The `readline` module on Mac OS X has strange behavior [\#50](https://github.com/zdict/zdict/issues/50) +- Should limit the choices of `-dt/--dict` argument [\#79](https://github.com/zdict/zdict/pull/79) ([M157q](https://github.com/M157q)) +- \[Yahoo dict\] Got error when using verbose mode by searching word "accident" [\#53](https://github.com/zdict/zdict/pull/53) ([M157q](https://github.com/M157q)) + +**Closed issues:** + +- \[testing\] skip gnureadline testing on freebsd [\#73](https://github.com/zdict/zdict/issues/73) +- `coveralls` failure after travis ci built [\#71](https://github.com/zdict/zdict/issues/71) +- master branch build failed randomly on travis ci [\#69](https://github.com/zdict/zdict/issues/69) +- Reduce setup.py dependent to zdict [\#67](https://github.com/zdict/zdict/issues/67) +- Add a command line tool for completions [\#65](https://github.com/zdict/zdict/issues/65) +- SpanishDict dictionary support [\#58](https://github.com/zdict/zdict/issues/58) +- Performance improvement for `readline` completer [\#57](https://github.com/zdict/zdict/issues/57) +- Jisho dictionary support [\#31](https://github.com/zdict/zdict/issues/31) + +**Merged pull requests:** + +- Merge Jisho into master branch [\#77](https://github.com/zdict/zdict/pull/77) ([M157q](https://github.com/M157q)) +- \[testing\] skip gnureadline testing on freebsd [\#74](https://github.com/zdict/zdict/pull/74) ([iblis17](https://github.com/iblis17)) +- \[travis\] change coveralls client [\#72](https://github.com/zdict/zdict/pull/72) ([iblis17](https://github.com/iblis17)) +- Issue 69 [\#70](https://github.com/zdict/zdict/pull/70) ([iblis17](https://github.com/iblis17)) +- Add a Gitter chat badge to README.rst [\#15](https://github.com/zdict/zdict/pull/15) ([gitter-badger](https://github.com/gitter-badger)) + +## [v0.0.6](https://github.com/zdict/zdict/tree/v0.0.6) (2015-10-19) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.5...v0.0.6) + +**Fixed bugs:** + +- yahoo dict crashes when querying "運作" [\#51](https://github.com/zdict/zdict/issues/51) + +**Closed issues:** + +- Documentation for dictionaries' API or HTML parsing [\#30](https://github.com/zdict/zdict/issues/30) +- \[dev\] `zdict/zdict.py` flow redesign [\#20](https://github.com/zdict/zdict/issues/20) +- Replace standard options parse with `click` [\#5](https://github.com/zdict/zdict/issues/5) +- Testing for UrbanDict [\#46](https://github.com/zdict/zdict/issues/46) +- Add an option to list out supported dictionaries and their title [\#45](https://github.com/zdict/zdict/issues/45) +- Auto discover `XDict` in `dictionaries` dir [\#44](https://github.com/zdict/zdict/issues/44) +- \[dictionaries/moe.py\] Improve coverage rate [\#43](https://github.com/zdict/zdict/issues/43) +- \[utils.py\] Improve coverage rate [\#42](https://github.com/zdict/zdict/issues/42) +- \[travis\] Allow failed for python nightly version [\#41](https://github.com/zdict/zdict/issues/41) +- Migrate test cases to pytest [\#40](https://github.com/zdict/zdict/issues/40) +- Migrate test utils to `py.test` [\#39](https://github.com/zdict/zdict/issues/39) +- zdict vim plugin [\#36](https://github.com/zdict/zdict/issues/36) +- Add template.py into dictionaries/ [\#28](https://github.com/zdict/zdict/issues/28) +- Add no VT100 color print option [\#23](https://github.com/zdict/zdict/issues/23) +- shell completion files [\#11](https://github.com/zdict/zdict/issues/11) +- More complete testing [\#3](https://github.com/zdict/zdict/issues/3) + +## [v0.0.5](https://github.com/zdict/zdict/tree/v0.0.5) (2015-10-02) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.4...v0.0.5) + +**Fixed bugs:** + +- Parser for Yahoo dictionary is broken again [\#35](https://github.com/zdict/zdict/issues/35) +- search "django" will crash the program in version 0.0.4 [\#24](https://github.com/zdict/zdict/issues/24) +- BeautifulSoup warning [\#22](https://github.com/zdict/zdict/issues/22) + +**Closed issues:** + +- 萌典 support [\#26](https://github.com/zdict/zdict/issues/26) +- An option for choosing the available dictionaries [\#21](https://github.com/zdict/zdict/issues/21) + +## [v0.0.4](https://github.com/zdict/zdict/tree/v0.0.4) (2015-07-09) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.3...v0.0.4) + +**Closed issues:** + +- Request timeout should be configurable [\#7](https://github.com/zdict/zdict/issues/7) +- Should update the result store in the db for user if there is a new updated result. [\#4](https://github.com/zdict/zdict/issues/4) + +## [v0.0.3](https://github.com/zdict/zdict/tree/v0.0.3) (2015-07-03) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.2...v0.0.3) + +## [v0.0.2](https://github.com/zdict/zdict/tree/v0.0.2) (2015-06-26) + +[Full Changelog](https://github.com/zdict/zdict/compare/v0.0.1...v0.0.2) + +**Fixed bugs:** + +- Chinese will disappear while encountering the one line result. [\#19](https://github.com/zdict/zdict/issues/19) +- IndexError: list index out of range [\#18](https://github.com/zdict/zdict/issues/18) +- TypeError: Can't convert 'Tag' object to str implicitly [\#17](https://github.com/zdict/zdict/issues/17) + +## [v0.0.1](https://github.com/zdict/zdict/tree/v0.0.1) (2015-05-26) + +[Full Changelog](https://github.com/zdict/zdict/compare/7db492af9806c50f4b1093bdfa884cb8302f6b8f...v0.0.1) + +**Merged pull requests:** + +- Update README.rst [\#1](https://github.com/zdict/zdict/pull/1) ([iblis17](https://github.com/iblis17)) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* From 26989ca4bb7dcf24332499978b86f234b3ce8cd8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 30 Oct 2020 05:22:02 +0200 Subject: [PATCH 392/508] Update pytest to 6.1.2 (#463) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 80cc3ef8..3dce06fa 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.3 flake8==3.8.4 pyjokes==0.6.0 -pytest==6.1.1 +pytest==6.1.2 pytest-cov==2.10.1 pytest-flake8==1.0.6 From 4b693fd7782441db8ef7ba12eecfa3f67a97a9e9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 9 Nov 2020 07:08:39 +0200 Subject: [PATCH 393/508] Update peewee to 3.14.0 (#464) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index affcc706..b0d8b71f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 -peewee==3.13.3 +peewee==3.14.0 requests==2.24.0 From 664b4506b5c986c2af3ce4e352f728ee02d40f13 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 12 Nov 2020 16:47:18 +0000 Subject: [PATCH 394/508] Update requests from 2.24.0 to 2.25.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b0d8b71f..cca20043 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 peewee==3.14.0 -requests==2.24.0 +requests==2.25.0 From e17e38084e925c384a0c8c84ddee2b54ce12b1a7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 14 Dec 2020 02:32:51 +0000 Subject: [PATCH 395/508] Update pytest from 6.1.2 to 6.2.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 3dce06fa..9551e488 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.3 flake8==3.8.4 pyjokes==0.6.0 -pytest==6.1.2 +pytest==6.2.0 pytest-cov==2.10.1 pytest-flake8==1.0.6 From 9100b2d2d57513e4edadf2180d1f2bcf122d0fa6 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 00:17:34 +0800 Subject: [PATCH 396/508] [GitHub Actions] Only do CodeQL scanning when push on master branch and PR --- .github/workflows/codeql-analysis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 641c2533..871c828f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,6 +2,8 @@ name: "Code scanning - action" on: push: + branches: + - master pull_request: schedule: - cron: '0 5 * * 2' From 12bf125fe3d067d42b7f171582cf04efd2b39631 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 14 Dec 2020 22:57:07 +0800 Subject: [PATCH 397/508] [#467] Add macOS testings on GitHub Actions --- .github/workflows/macos_testings.yml | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/macos_testings.yml diff --git a/.github/workflows/macos_testings.yml b/.github/workflows/macos_testings.yml new file mode 100644 index 00000000..69d433bb --- /dev/null +++ b/.github/workflows/macos_testings.yml @@ -0,0 +1,85 @@ +name: macOS testings + +on: [push, pull_request, workflow_dispatch] +# workflow_dispatch is for manually trigger: +# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ + + +# +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8] + # Prevent from cancelling rest of jobs in matrix when one of them is failed. + fail-fast: false + env: + # Python 3.6 & 3.7 on macOS will crash during the unittest with multiproccessing if we don't add this envvar. + # + # This will make requests bypass the proxy on all hosts. + # + no_proxy: '*' + steps: + - name: Check out repo + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Configure pip caching + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'requirements-test.txt') }} + restore-keys: | + ${{ runner.os }}-pip-python-${{ matrix.python-version }}- + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Python dependencies + run: | + pip install . + pip install -r requirements-test.txt + pip freeze + + - name: Test + run: | + make test + + # For coveralls parallel mode: + - name: Send coverage to coveralls if above steps are all successful + if: ${{ success() }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -U coveralls + COVERALLS_PARALLEL=true coveralls + +# coveralls-finish will always run after all matrix builds are finished. +# Regardless if they are succeeded or failed +# + coveralls-finish: + needs: build + runs-on: ubuntu-latest + steps: + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Configure pip caching + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-python-3-coveralls + + - name: Make coveralls merged parallel coverage results + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pip install -U coveralls + coveralls --finish From 8dfaf46148d9596f98dfd09f79d9d78c01830fa7 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 20:36:21 +0800 Subject: [PATCH 398/508] [#467] Remove Travis CI related files --- .travis.yml | 64 ------------------------------------ ci/install_python_for_osx.sh | 23 ------------- 2 files changed, 87 deletions(-) delete mode 100644 .travis.yml delete mode 100755 ci/install_python_for_osx.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d03d5876..00000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -language: python -cache: - directories: - - $HOME/.pyenv - - $HOME/venv - - -jobs: - fast_finish: true - include: - # Python runtime is not yet available on OS X - # https://github.com/travis-ci/travis-ci/issues/2312 - # Newer Python version should be place at first to make it build earlier. - # Because when you add new Python version, it takes time for installing pyenv due to there is no cache for pyenv. - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.8.2 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.7.2 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.6.8 - - stage: test - os: osx - language: generic - env: PYTHON_VERSION=3.5.6 - -before_install: - # workaround for Travis CI stdout write error - # ref: - - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sh ci/install_python_for_osx.sh; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then source ~/venv/bin/activate; fi - - python --version # Check the specifically installed Python version - -install: - - pip install -U pip wheel # Install wheel for gnureadline which used bdist_wheel on Travis CI with Mac OSX environment. - - pip install -U setuptools # for upgrade issue with setuptools and CPython 3.6 on Travis CI - - pip install . # Should use this command, not `pip install -r requirements.txt` because there is OS-related dependency in setup.py for OSX - - pip install -U coveralls - - pip freeze - -script: - - pip install -r requirements-test.txt - - make test - -before_cache: - # Remove __pycahce__ dirs and *.pyc, *.pyo files before uploading cache. - # Which will changes between every single builds. - # This could make Travis CI don't upload cache every time. - - python3 -Bc "import pathlib; [p.unlink() for p in pathlib.Path('$HOME/venv').rglob('*.py[co]')]" - - python3 -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('$HOME/venv').rglob('__pycache__')]" - -after_success: - - coveralls - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/7498c1d7f0e50c212e1a diff --git a/ci/install_python_for_osx.sh b/ci/install_python_for_osx.sh deleted file mode 100755 index c16b2abb..00000000 --- a/ci/install_python_for_osx.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/sh - -set -ev - -# if $HOME/.pyenv is empty, remove it so it can be installed by pyenv-installer -# because Travis CI cache will create $HOME/.pyenv, -# but pyenv-installer won't install if $HOME/.pyenv exists even if it's empty. -if [ -z "$(ls -A $HOME/.pyenv)" ]; then - rmdir $HOME/.pyenv; - curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash; -fi - -# Make it use openssl only -brew uninstall --ignore-dependencies openssl@1.1 - -# print openssl path -brew --prefix openssl - -# Install specific version of Python via pyenv if it hasn't be installed. -~/.pyenv/bin/pyenv install --skip-existing -v $PYTHON_VERSION - -# Create venv with the specific Python version -~/.pyenv/versions/$PYTHON_VERSION/bin/python3 -m venv ~/venv From fd49641ae5ce84f90bf95151b326c8095025e4be Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 20:59:46 +0800 Subject: [PATCH 399/508] [#467] Remove Travis CI and add GitHub Actions badge in README --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 6adf9895..0f5737e7 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ zdict |stars| |forks| |contributors| |pull requests| |issues| -|travis| |circleci| |coveralls| +|github_actions| |circleci| |coveralls| |docker automated build| |docker build status| @@ -342,8 +342,8 @@ Stargazers over time .. |issues| image:: https://img.shields.io/github/issues/zdict/zdict.svg :target: https://github.com/zdict/zdict/issues -.. |travis| image:: https://api.travis-ci.org/zdict/zdict.svg?branch=master - :target: https://travis-ci.org/zdict/zdict +.. |github_actions| image:: https://github.com/zdict/zdict/workflows/macOS%20testings/badge.svg + :target: https://github.com/zdict/zdict/actions .. |circleci| image:: https://circleci.com/gh/zdict/zdict.svg?style=svg :target: https://circleci.com/gh/zdict/zdict From 1edb1351772917658a102d958f431611cd005136 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 22:14:01 +0800 Subject: [PATCH 400/508] [#466] Drop Python 3.6 and add Python 3.9 support pytest 6.2.0 requries python >= 3.6. Python 3.5 reached its EOL at 2020/09/13 FYI: --- .circleci/config.yml | 24 ++++++++++++------------ .github/workflows/macos_testings.yml | 2 +- setup.py | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb9ce720..1f2ae392 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,28 +8,28 @@ workflows: version: 2 build-test-deploy: jobs: - - linux-python-3_8: + - linux-python-3_9: filters: tags: only: /.*/ - - linux-python-3_7: + - linux-python-3_8: filters: tags: only: /.*/ - - linux-python-3_6: + - linux-python-3_7: filters: tags: only: /.*/ - - linux-python-3_5: + - linux-python-3_6: filters: tags: only: /.*/ - deploy: requires: + - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 - linux-python-3_6 - - linux-python-3_5 filters: tags: only: /[0-9]+(\.[0-9]+)*/ @@ -45,10 +45,10 @@ workflows: branches: only: master jobs: + - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 - linux-python-3_6 - - linux-python-3_5 # https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ commands: @@ -120,6 +120,11 @@ variables: jobs: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + linux-python-3_9: + <<: *test-template + docker: + - image: circleci/python:3.9 + linux-python-3_8: <<: *test-template docker: @@ -135,17 +140,12 @@ jobs: docker: - image: circleci/python:3.6 - linux-python-3_5: - <<: *test-template - docker: - - image: circleci/python:3.5 - # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ deploy: docker: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - - image: circleci/python:3.5 + - image: circleci/python:3.6 working_directory: ~/repo steps: - checkout diff --git a/.github/workflows/macos_testings.yml b/.github/workflows/macos_testings.yml index 69d433bb..c8961cdd 100644 --- a/.github/workflows/macos_testings.yml +++ b/.github/workflows/macos_testings.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] # Prevent from cancelling rest of jobs in matrix when one of them is failed. fail-fast: false env: diff --git a/setup.py b/setup.py index 0c584848..8b96f4e6 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ def get_test_req(): ), platforms=['Linux', 'Mac'], license="GPL3", - python_requires=">=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", + python_requires=">=3.6", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -82,10 +82,10 @@ def get_test_req(): "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Topic :: Utilities", ], ) From 32e48eac20f6ae9603fa222a3a8d7db21da190d5 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 22:16:59 +0800 Subject: [PATCH 401/508] [easter_eggs] Remove venv support for pyjokes Hardcoded 'lib/python3.5/site-packages' into sys.path is not good. --- zdict/easter_eggs.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/zdict/easter_eggs.py b/zdict/easter_eggs.py index 1040e45a..00cb1de9 100644 --- a/zdict/easter_eggs.py +++ b/zdict/easter_eggs.py @@ -1,5 +1,3 @@ -import os -import sys import re import random import importlib @@ -10,10 +8,6 @@ def import_pyjokes_module(): - v = os.environ.get('VIRTUAL_ENV', None) - if v: - sys.path = [v + '/lib/python3.5/site-packages'] + sys.path - if importlib.util.find_spec('pyjokes'): return importlib.import_module('pyjokes') From c12a41a42238a747755c09588d71c1ad73032c39 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 22:54:44 +0800 Subject: [PATCH 402/508] Version 3.8.0 !!! DROP Python 3.5 support !!! Python 3.5 has reached EOF at 2020/09/13 - 1edb135 [#466] Drop Python 3.5 and add Python 3.9 support - Dependencies - e17e380 Update pytest from 6.1.2 to 6.2.0 - 664b450 Update requests from 2.24.0 to 2.25.0 - 4b693fd Update peewee to 3.14.0 (#464) - 26989ca Update pytest to 6.1.2 (#463) - e33e7f6 Update beautifulsoup4 to 4.9.3 (#461) - 35d3988 Update flake8 to 3.8.4 (#460) - eccfbd0 Update pytest from 6.1.0 to 6.1.1 (#462) - 4f8e0ce Update beautifulsoup4 to 4.9.2 (#459) - 5a80b0b Update pytest to 6.1.0 (#458) - ff74e2e Update coverage from 5.2.1 to 5.3 (#457) - 49ed8de Update pytest to 6.0.2 (#456) - 411641f Update pytest-cov to 2.10.1 (#455) - CI - fd49641 [#467] Remove Travis CI and add GitHub Actions badge in README - 8dfaf46 [#467] Remove Travis CI related files - 12bf125 [#467] Add macOS testings on GitHub Actions - Misc - 32e48ea [easter_eggs] Remove venv support for pyjokes - 9100b2d [GitHub Actions] Only do CodeQL scanning when push on master branch and PR - 010b749 Add CHANGELOG.md generated by github-changelog-generator --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index e7cc0166..0147017e 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.7.0' +VERSION = '3.8.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 872a99a47dc0b016028961134521863648bb2d41 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 23:18:42 +0800 Subject: [PATCH 403/508] [README] Update usage for apc dictionary --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 0f5737e7..1a1b701c 100644 --- a/README.rst +++ b/README.rst @@ -94,7 +94,7 @@ Usage :: usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all] + [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,apc,wiktionary,urban,yandex,all] [-ld] [-V] [-c] [--dump [PATTERN]] [-D] [word [word ...]] @@ -114,7 +114,7 @@ Usage the number of CPUs in the system. -sp, --show-provider Show the dictionary provider of the queried word -su, --show-url Show the url of the queried word - -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all + -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,apc,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,apc,wiktionary,urban,yandex,all Must be seperated by comma and no spaces after each comma. Choose the dictionary you want. (default: yahoo) Use 'all' for qureying all dictionaries. If From c4291c0325b694b2d027ffe959603cb08768e5d6 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 15 Dec 2020 23:21:40 +0800 Subject: [PATCH 404/508] Version 3.8.1 - 872a99a [README] Update usage for apc dictionary --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 0147017e..4430e655 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.8.0' +VERSION = '3.8.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 9d9a4b1abc6bfb8c946561ac1cfdd81f01252da1 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 16 Dec 2020 01:39:40 +0800 Subject: [PATCH 405/508] [setup.cfg] py35+ => py36+ Forgot to change this for dropping Python 3.5 support. And this caused error when deploying to PyPI. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 6d39cd19..d3794572 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,4 +9,4 @@ flake8-ignore = # F841 - local variable name is assigned to but never used [bdist_wheel] -python-tag = py35+ +python-tag = py36+ From d51bf61d1bfc3a1570bb21fe839fb2becc167fed Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 16 Dec 2020 01:41:48 +0800 Subject: [PATCH 406/508] Version 3.8.2 - 9d9a4b1 [setup.cfg] py35+ => py36+ --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 4430e655..d7f947a6 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.8.1' +VERSION = '3.8.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 59b7100ce96546e40e14f33ed3bbe06cd7fd3210 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 15 Dec 2020 17:43:00 +0000 Subject: [PATCH 407/508] Update pytest from 6.2.0 to 6.2.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 9551e488..a786141c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.3 flake8==3.8.4 pyjokes==0.6.0 -pytest==6.2.0 +pytest==6.2.1 pytest-cov==2.10.1 pytest-flake8==1.0.6 From 2258a6315fee7475cae8bd8302f443ef7cfdbe2d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 16 Dec 2020 21:01:25 +0000 Subject: [PATCH 408/508] Update requests from 2.25.0 to 2.25.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cca20043..74080e5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 peewee==3.14.0 -requests==2.25.0 +requests==2.25.1 From e74af3fc3b25281f1adbe9302dbc6b8603a4ca32 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 16 Dec 2020 23:25:03 +0000 Subject: [PATCH 409/508] Update pytest-flake8 from 1.0.6 to 1.0.7 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index a786141c..ddcc0a24 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ flake8==3.8.4 pyjokes==0.6.0 pytest==6.2.1 pytest-cov==2.10.1 -pytest-flake8==1.0.6 +pytest-flake8==1.0.7 From 332597582e31d4a7d56834662b582353364ca4b4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 Dec 2020 02:58:56 +0000 Subject: [PATCH 410/508] Update coverage from 5.3 to 5.3.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ddcc0a24..3655b87e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==5.3 +coverage==5.3.1 flake8==3.8.4 pyjokes==0.6.0 pytest==6.2.1 From b1070a6da49bd75059b5412666a72d68276e7be9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 19 Jan 2021 05:10:41 +0000 Subject: [PATCH 411/508] Update pytest-cov from 2.10.1 to 2.11.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 3655b87e..6300203b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.3.1 flake8==3.8.4 pyjokes==0.6.0 pytest==6.2.1 -pytest-cov==2.10.1 +pytest-cov==2.11.0 pytest-flake8==1.0.7 From 28c4ec491eb8c039a9ec14d66e8971a60dce8609 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 20 Jan 2021 15:12:43 +0800 Subject: [PATCH 412/508] [github actions] Fix coveralls part for macos_testings --- .github/workflows/macos_testings.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos_testings.yml b/.github/workflows/macos_testings.yml index c8961cdd..aa69fe77 100644 --- a/.github/workflows/macos_testings.yml +++ b/.github/workflows/macos_testings.yml @@ -54,9 +54,12 @@ jobs: if: ${{ success() }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + COVERALLS_SERVICE_NAME: github-actions + COVERALLS_PARALLEL: true run: | pip install -U coveralls - COVERALLS_PARALLEL=true coveralls + coveralls # coveralls-finish will always run after all matrix builds are finished. # Regardless if they are succeeded or failed @@ -80,6 +83,7 @@ jobs: - name: Make coveralls merged parallel coverage results env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_SERVICE_NAME: github-actions run: | pip install -U coveralls coveralls --finish From 4903a2b317b57a29c2a08cd6a8803e7760dc09f2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 21 Jan 2021 05:12:27 +0000 Subject: [PATCH 413/508] Update pytest-cov from 2.11.0 to 2.11.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 6300203b..65cb26f3 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.3.1 flake8==3.8.4 pyjokes==0.6.0 pytest==6.2.1 -pytest-cov==2.11.0 +pytest-cov==2.11.1 pytest-flake8==1.0.7 From 6724fc0f9bb8f0547b17bfe3edd68fb49a135279 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 8 Feb 2021 00:28:14 +0000 Subject: [PATCH 414/508] Update peewee from 3.14.0 to 3.14.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 74080e5f..afe7329e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 -peewee==3.14.0 +peewee==3.14.1 requests==2.25.1 From 75bb41aebbe150fb874aa577a955c5d547fa0f69 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 6 Mar 2021 09:20:36 +0200 Subject: [PATCH 415/508] Update peewee from 3.14.1 to 3.14.2 (#477) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index afe7329e..4931a851 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 -peewee==3.14.1 +peewee==3.14.2 requests==2.25.1 From 3f0ac59fdad2749bb222f095c6a0ab38fffcd04c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Mar 2021 02:54:45 +0200 Subject: [PATCH 416/508] Update peewee from 3.14.2 to 3.14.3 (#478) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4931a851..319e1bbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 -peewee==3.14.2 +peewee==3.14.3 requests==2.25.1 From 95b3a9e3f2c9645f4115429243dc3fcfb9cdc3d2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Mar 2021 09:02:22 +0200 Subject: [PATCH 417/508] Update flake8 from 3.8.4 to 3.9.0 (#479) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 65cb26f3..3a8a16af 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==5.3.1 -flake8==3.8.4 +flake8==3.9.0 pyjokes==0.6.0 pytest==6.2.1 pytest-cov==2.11.1 From 45028e51002f1b671657f012e4a3500929e107d2 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Mar 2021 09:14:13 +0200 Subject: [PATCH 418/508] Update coverage from 5.3.1 to 5.5 (#476) Co-authored-by: Iblis Lin --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 3a8a16af..ef406488 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==5.3.1 +coverage==5.5 flake8==3.9.0 pyjokes==0.6.0 pytest==6.2.1 From b9f75632006d1746b993da76d6225d55e8a7d358 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 20 Mar 2021 11:25:13 +0000 Subject: [PATCH 419/508] Update peewee from 3.14.3 to 3.14.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 319e1bbd..a105b4a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 -peewee==3.14.3 +peewee==3.14.4 requests==2.25.1 From 18c72fa8c7211189689d68c7f927d3f1eea1e73c Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Wed, 7 Apr 2021 18:16:12 +0800 Subject: [PATCH 420/508] [CHANGELOG] Update CHANGELOG via github_changelog_generator --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0689c2..2e09088f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## [3.8.2](https://github.com/zdict/zdict/tree/3.8.2) (2020-12-15) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.8.1...3.8.2) + +## [3.8.1](https://github.com/zdict/zdict/tree/3.8.1) (2020-12-15) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.8.0...3.8.1) + +## [3.8.0](https://github.com/zdict/zdict/tree/3.8.0) (2020-12-15) + +[Full Changelog](https://github.com/zdict/zdict/compare/3.7.0...3.8.0) + +**Closed issues:** + +- Change CI from Travis CI and CircleCI to GitHub Actions [\#441](https://github.com/zdict/zdict/issues/441) +- Move macOS related testings from Travis CI to GitHub Actions [\#467](https://github.com/zdict/zdict/issues/467) + +**Merged pull requests:** + +- Update peewee to 3.14.0 [\#464](https://github.com/zdict/zdict/pull/464) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 6.1.2 [\#463](https://github.com/zdict/zdict/pull/463) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 6.1.1 [\#462](https://github.com/zdict/zdict/pull/462) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.9.3 [\#461](https://github.com/zdict/zdict/pull/461) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.8.4 [\#460](https://github.com/zdict/zdict/pull/460) ([pyup-bot](https://github.com/pyup-bot)) +- Update beautifulsoup4 to 4.9.2 [\#459](https://github.com/zdict/zdict/pull/459) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 6.1.0 [\#458](https://github.com/zdict/zdict/pull/458) ([pyup-bot](https://github.com/pyup-bot)) +- Update coverage to 5.3 [\#457](https://github.com/zdict/zdict/pull/457) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest to 6.0.2 [\#456](https://github.com/zdict/zdict/pull/456) ([pyup-bot](https://github.com/pyup-bot)) +- Update pytest-cov to 2.10.1 [\#455](https://github.com/zdict/zdict/pull/455) ([pyup-bot](https://github.com/pyup-bot)) +- \[\#467\] Move macOS related testings from Travis CI to GitHub Actions [\#468](https://github.com/zdict/zdict/pull/468) ([M157q](https://github.com/M157q)) +- Update pytest to 6.2.0 [\#466](https://github.com/zdict/zdict/pull/466) ([pyup-bot](https://github.com/pyup-bot)) +- Update requests to 2.25.0 [\#465](https://github.com/zdict/zdict/pull/465) ([pyup-bot](https://github.com/pyup-bot)) + ## [3.7.0](https://github.com/zdict/zdict/tree/3.7.0) (2020-08-12) [Full Changelog](https://github.com/zdict/zdict/compare/3.6.2...3.7.0) @@ -209,8 +242,8 @@ - Update coverage to 4.5.4 [\#363](https://github.com/zdict/zdict/pull/363) ([pyup-bot](https://github.com/pyup-bot)) - Update beautifulsoup4 to 4.8.0 [\#362](https://github.com/zdict/zdict/pull/362) ([pyup-bot](https://github.com/pyup-bot)) - Update pytest to 5.0.1 [\#361](https://github.com/zdict/zdict/pull/361) ([pyup-bot](https://github.com/pyup-bot)) +- Update flake8 to 3.7.8 [\#360](https://github.com/zdict/zdict/pull/360) ([pyup-bot](https://github.com/pyup-bot)) - Update pytest to 5.0.0 [\#359](https://github.com/zdict/zdict/pull/359) ([pyup-bot](https://github.com/pyup-bot)) -- Update certifi to 2019.6.16 [\#356](https://github.com/zdict/zdict/pull/356) ([pyup-bot](https://github.com/pyup-bot)) ## [3.0.2](https://github.com/zdict/zdict/tree/3.0.2) (2019-06-20) @@ -246,7 +279,7 @@ **Merged pull requests:** -- Update flake8 to 3.7.8 [\#360](https://github.com/zdict/zdict/pull/360) ([pyup-bot](https://github.com/pyup-bot)) +- Update certifi to 2019.6.16 [\#356](https://github.com/zdict/zdict/pull/356) ([pyup-bot](https://github.com/pyup-bot)) - Update pytest to 4.6.3 [\#355](https://github.com/zdict/zdict/pull/355) ([pyup-bot](https://github.com/pyup-bot)) - Update peewee to 3.9.6 [\#354](https://github.com/zdict/zdict/pull/354) ([pyup-bot](https://github.com/pyup-bot)) - Update pluggy to 0.12.0 [\#351](https://github.com/zdict/zdict/pull/351) ([pyup-bot](https://github.com/pyup-bot)) @@ -579,6 +612,7 @@ - Update coverage to 4.4.2 [\#143](https://github.com/zdict/zdict/pull/143) ([pyup-bot](https://github.com/pyup-bot)) - Update peewee to 2.10.2 [\#138](https://github.com/zdict/zdict/pull/138) ([pyup-bot](https://github.com/pyup-bot)) - Update pytest to 3.2.3 [\#137](https://github.com/zdict/zdict/pull/137) ([pyup-bot](https://github.com/pyup-bot)) +- Add pipenv data [\#135](https://github.com/zdict/zdict/pull/135) ([wdv4758h](https://github.com/wdv4758h)) - Modify the part related to docker in README for issue-98 [\#133](https://github.com/zdict/zdict/pull/133) ([M157q](https://github.com/M157q)) - \[\#98\] Install `locales` for using `locale-gen` for Docker [\#132](https://github.com/zdict/zdict/pull/132) ([M157q](https://github.com/M157q)) - \[\#130\] Pinned versions of packages in requirements [\#131](https://github.com/zdict/zdict/pull/131) ([M157q](https://github.com/M157q)) @@ -593,7 +627,6 @@ **Merged pull requests:** -- Add pipenv data [\#135](https://github.com/zdict/zdict/pull/135) ([wdv4758h](https://github.com/wdv4758h)) - \[zdict-0.10.0\] [\#129](https://github.com/zdict/zdict/pull/129) ([wdv4758h](https://github.com/wdv4758h)) - Upgrade all dependencies and CPython version [\#128](https://github.com/zdict/zdict/pull/128) ([wdv4758h](https://github.com/wdv4758h)) - Add Yandex Translate API support [\#127](https://github.com/zdict/zdict/pull/127) ([wdv4758h](https://github.com/wdv4758h)) @@ -761,7 +794,6 @@ - \[testing\] skip gnureadline testing on freebsd [\#74](https://github.com/zdict/zdict/pull/74) ([iblis17](https://github.com/iblis17)) - \[travis\] change coveralls client [\#72](https://github.com/zdict/zdict/pull/72) ([iblis17](https://github.com/iblis17)) - Issue 69 [\#70](https://github.com/zdict/zdict/pull/70) ([iblis17](https://github.com/iblis17)) -- Add a Gitter chat badge to README.rst [\#15](https://github.com/zdict/zdict/pull/15) ([gitter-badger](https://github.com/gitter-badger)) ## [v0.0.6](https://github.com/zdict/zdict/tree/v0.0.6) (2015-10-19) From 34d49cddc35d567cea7ea276fd851f0c70496fd2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 6 May 2021 06:19:36 +0800 Subject: [PATCH 421/508] Update pytest from 6.2.1 to 6.2.4 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ef406488..d324455d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.5 flake8==3.9.0 pyjokes==0.6.0 -pytest==6.2.1 +pytest==6.2.4 pytest-cov==2.11.1 pytest-flake8==1.0.7 From 0f77247ad65608cfebac314ce3632d04d4d815d9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 10 May 2021 11:04:36 +0800 Subject: [PATCH 422/508] Update flake8 from 3.9.0 to 3.9.2 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ef406488..f38d1add 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==5.5 -flake8==3.9.0 +flake8==3.9.2 pyjokes==0.6.0 pytest==6.2.1 pytest-cov==2.11.1 From ae2d67e5079ff8f29fef3f10f5a61b330c7b55b0 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 15 May 2021 12:42:25 +0800 Subject: [PATCH 423/508] Update pytest-cov from 2.11.1 to 2.12.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ef406488..ab04e173 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.5 flake8==3.9.0 pyjokes==0.6.0 pytest==6.2.1 -pytest-cov==2.11.1 +pytest-cov==2.12.0 pytest-flake8==1.0.7 From 2e0adabe1f5a9292978975bb1a3a68b949a9422f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 3 Jun 2021 13:59:16 +0800 Subject: [PATCH 424/508] Update pytest-cov from 2.12.0 to 2.12.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 32b46700..c5b49410 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.5 flake8==3.9.2 pyjokes==0.6.0 pytest==6.2.4 -pytest-cov==2.12.0 +pytest-cov==2.12.1 pytest-flake8==1.0.7 \ No newline at end of file From 927c7bc32dbda7161ef199a8adefea5a6d3a5903 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 22 Aug 2021 21:57:02 +0800 Subject: [PATCH 425/508] [#487][#491] Remove APC temporarily since it's broken --- README.rst | 84 ++++++------ zdict/dictionaries/apc.py | 196 --------------------------- zdict/tests/dictionaries/test_apc.py | 85 ------------ 3 files changed, 38 insertions(+), 327 deletions(-) delete mode 100644 zdict/dictionaries/apc.py delete mode 100644 zdict/tests/dictionaries/test_apc.py diff --git a/README.rst b/README.rst index 1a1b701c..48ab8e46 100644 --- a/README.rst +++ b/README.rst @@ -93,44 +93,44 @@ Usage :: - usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] - [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,apc,wiktionary,urban,yandex,all] - [-ld] [-V] [-c] [--dump [PATTERN]] [-D] - [word [word ...]] - - positional arguments: - word Words for searching its translation - - optional arguments: - -h, --help show this help message and exit - -v, --version show program's version number and exit - -d, --disable-db-cache - Temporarily not using the result from db cache. (still - save the result into db) - -t QUERY_TIMEOUT, --query-timeout QUERY_TIMEOUT - Set timeout for every query. default is 5 seconds. - -j [JOBS], --jobs [JOBS] - Allow N jobs at once. Do not pass any argument to use - the number of CPUs in the system. - -sp, --show-provider Show the dictionary provider of the queried word - -su, --show-url Show the url of the queried word - -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,apc,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,apc,wiktionary,urban,yandex,all - Must be seperated by comma and no spaces after each - comma. Choose the dictionary you want. (default: - yahoo) Use 'all' for qureying all dictionaries. If - 'all' or more than 1 dictionaries been chosen, --show- - provider will be set to True in order to provide more - understandable output. - -ld, --list-dicts Show currently supported dictionaries. - -V, --verbose Show more information for the queried word. (If the - chosen dictionary have implemented verbose related - functions) - -c, --force-color Force color printing (zdict automatically disable - color printing when output is not a tty, use this - option to force color printing) - --dump [PATTERN] Dump the querying history, can be filtered with regex - -D, --debug Print raw html prettified by BeautifulSoup for - debugging. + usage: zdict [-h] [-v] [-d] [-t QUERY_TIMEOUT] [-j [JOBS]] [-sp] [-su] + [-dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all] + [-ld] [-V] [-c] [--dump [PATTERN]] [-D] + [word [word ...]] + + positional arguments: + word Words for searching its translation + + optional arguments: + -h, --help show this help message and exit + -v, --version show program's version number and exit + -d, --disable-db-cache + Temporarily not using the result from db cache. (still + save the result into db) + -t QUERY_TIMEOUT, --query-timeout QUERY_TIMEOUT + Set timeout for every query. default is 5 seconds. + -j [JOBS], --jobs [JOBS] + Allow N jobs at once. Do not pass any argument to use + the number of CPUs in the system. + -sp, --show-provider Show the dictionary provider of the queried word + -su, --show-url Show the url of the queried word + -dt itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all, --dict itaigi,moe,moe-taiwanese,spanish,oxford,jisho,yahoo,naer,wiktionary,urban,yandex,all + Must be seperated by comma and no spaces after each + comma. Choose the dictionary you want. (default: + yahoo) Use 'all' for qureying all dictionaries. If + 'all' or more than 1 dictionaries been chosen, --show- + provider will be set to True in order to provide more + understandable output. + -ld, --list-dicts Show currently supported dictionaries. + -V, --verbose Show more information for the queried word. (If the + chosen dictionary have implemented verbose related + functions) + -c, --force-color Force color printing (zdict automatically disable + color printing when output is not a tty, use this + option to force color printing) + --dump [PATTERN] Dump the querying history, can be filtered with regex + -D, --debug Print raw html prettified by BeautifulSoup for + debugging. Screenshots @@ -225,14 +225,6 @@ To use this source, you should first `apply `_ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. image:: https://user-images.githubusercontent.com/1645228/89984560-2b782080-dcac-11ea-8183-acfbd45f799b.jpg - -.. image:: https://user-images.githubusercontent.com/1645228/89984570-2e731100-dcac-11ea-9a09-de09e7631402.jpg - - Development & Contributing --------------------------- diff --git a/zdict/dictionaries/apc.py b/zdict/dictionaries/apc.py deleted file mode 100644 index 7919b040..00000000 --- a/zdict/dictionaries/apc.py +++ /dev/null @@ -1,196 +0,0 @@ -import json -import requests - -from collections import defaultdict - -from bs4 import BeautifulSoup - -from zdict.dictionary import DictBase -from zdict.exceptions import NotFoundError -from zdict.models import Record - - -class ApcDict(DictBase): - BASE_URL = "https://e-dictionary.apc.gov.tw" - - # To get the result of APC online dictionary - # We have to send a POST request to the POST_API first - # (with the word we want to query in the JSON payload) - # Then, the webpage will save result in the cookies - # we use the cookies to request the API with GET - # It will shows the result. - # Then, we parse the webpage. - POST_API = "{}/index.aspx/_crossTribes".format(BASE_URL) - API = "{}/search/list.htm".format(BASE_URL) - - ''' - # Ref: - # http://ilrdc.tw/research/athousand/area16.php - # 原住民族語言研究中心 - 16族族語學習詞表 - NOT_FOUND_WORD_INDIGENOUS = [ - "awaay", # 南勢/秀姑巒/海岸/馬蘭/恆春阿美語 - "ungat", # 賽考利克/澤敖/萬大/宜蘭澤敖利泰雅語 - "ukas", # 汶水泰雅語 - "uka", # 四季泰雅語 - "neka", # 東/北/中/南排灣語 - "uka", # 卓群/卡群/丹群/巒群/郡群布農語 - "uniyan", # 南王/知本/初鹿/建和卑南語 - "iniyan", # 知本/建和卑南語 - "kadrwa", # 東/霧台魯凱語 - "kadruwa", # 大武魯凱語 - "kadrowa", # 多納魯凱語 - "tédra", # 茂林魯凱語 - "akaodho", # 萬山魯凱語 - "uk'a", # 鄒語 - "'okay", # 賽夏語 - "'oka'", # 賽夏語 - "'inoka'", # 賽夏語 - "abo", # 雅美語 - "uka", # 邵語 - "mai", # 噶瑪蘭語 - "ini", # 太魯閣語 - "ungat", # 太魯閣語 - "nai'", # 撒奇萊雅語 - "ungac", # 都達語 (賽德克語) - "uka", # 都達語 (賽德克語) - "ini", # 德固達雅語 (賽德克語) - "ungac", # 德路固語 (賽德克語) - "ungat", # 德路固語 (賽德克語) - "uka'a", # 拉阿魯哇語 - "'akia", # 卡那卡那富語 - ] - ''' - - @property - def provider(self): - return "apc" - - @property - def title(self): - return "原住民族委員會 - 原住民族語言線上詞典" - - def _get_url(self, word) -> str: - return self.API.format(word=word) - - def show(self, record: Record): - content = json.loads(record.content) - - self.color.print("{}".format(content["title"]), "lyellow") - print() - - self.color.print("精確搜尋結果", "lmagenta") - for index, source in enumerate(content["exact_sources"]): - self.color.print("{:-2d}. ".format(index + 1), end="") - self.color.print(source, "lred", end=": ") - self.color.print( - content["exact_sources"][source]["title"], - "lindigo", - ) - for i, d in enumerate(content["exact_sources"][source]["defs"]): - self.color.print("{i:-2d}. {d}".format(i=i + 1, d=d), indent=4) - - self.color.print("detail: ", "indigo", end="", indent=4) - self.color.print(content["exact_sources"][source]["link"], "white") - print() - if not content["exact_sources"]: - print() - self.color.print("無精確搜尋結果", "green") - print() - - self.color.print("模糊搜尋結果", "lmagenta") - for index, source in enumerate(content["fuzzy_sources"]): - self.color.print("{:-2d}. ".format(index + 1), end="") - self.color.print(source, "red") - - for word in content["fuzzy_sources"][source]: - self.color.print(word["title"], "lindigo", indent=5) - for i, d in enumerate(word["defs"]): - self.color.print( - "{i:-2d}. {d}".format(i=i + 1, d=d), - indent=6, - ) - print() - if not content["fuzzy_sources"]: - print() - self.color.print("無模糊搜尋結果", "green") - print() - - def query(self, word: str): - r = requests.post( - self.POST_API, - json={ - "c": "1", - "t": "all", - "q": word, - }, - ) - content = self._get_raw(word, cookies=r.cookies) - - data = { - "title": word, - "exact_sources": defaultdict(list), - "fuzzy_sources": defaultdict(list), - } - soup = BeautifulSoup(content, "html.parser") - - # Exact matching - exact = soup.find(id="accordion_cross") - if exact: - for div in exact.find_all("div", {"class": "panel"}): - title = div.find("div", {"class": "title"}).find("a").text - defs = [ - div.find("strong", {"class": "word"}) - .find_all("span")[-1] - .text.strip() - ] - source = div.find("strong", {"class": "race"}).text - - for i in div.find_all("li")[1:]: - d = i.find("strong", {"class": "word"}) - if d: - defs.append(d.find_all("span")[-1].text.strip()) - - link = ( - self.BASE_URL - + div.find("a", {"class": "btn-more"})["href"] - ) - data["exact_sources"][source] = { - "title": title, - "defs": defs, - "link": link, - } - - # Fuzzy matching - fuzzy = soup.find(id="accordion") - if fuzzy: - for div in fuzzy.find_all("div", {"class": "panel"}): - title = div.find("div", {"class": "title"}).find("a").text - defs = [ - div.find("strong", {"class": "word"}) - .find_all("span")[-1] - .text.strip() - ] - source = div.find("strong", {"class": "race"}).text - - for i in div.find_all("li")[1:]: - d = i.find("strong", {"class": "word"}) - if d: - defs.append(d.find_all("span")[-1].text.strip()) - - link = ( - self.BASE_URL - + div.find("div", {"class": "title"}).find("a")["href"] - ) - data["fuzzy_sources"][source].append( - {"title": title, "defs": defs, "link": link} - ) - - if not exact and not fuzzy: - raise NotFoundError(word) - - record = Record( - word=word, - content=json.dumps(data), - source=self.provider, - ) - return record diff --git a/zdict/tests/dictionaries/test_apc.py b/zdict/tests/dictionaries/test_apc.py deleted file mode 100644 index b925465e..00000000 --- a/zdict/tests/dictionaries/test_apc.py +++ /dev/null @@ -1,85 +0,0 @@ -from pytest import raises -from unittest.mock import patch - -from zdict.exceptions import NotFoundError -from zdict.zdict import get_args - -from zdict.dictionaries.apc import ApcDict - - -class TestApcDict: - @classmethod - def setup_class(cls): - cls.dict = ApcDict(get_args()) - - # You may want to change words to some certain test cases. - cls.words = ["utux", "tux"] - cls.not_found_word = "dsafwwe" - - # Setup normal query data - cls.dict.args.verbose = False - cls.records = [cls.dict.query(word) for word in cls.words] - - # Setup verbose query data - cls.dict.args.verbose = True - cls.verbose_records = [cls.dict.query(word) for word in cls.words] - - # Change back to default verbose config - cls.dict.args.verbose = False - - @classmethod - def teardown_class(cls): - del cls.dict - del cls.words - del cls.not_found_word - del cls.records - del cls.verbose_records - - def test_provider(self): - assert self.dict.provider == "apc" - - def test_title(self): - assert self.dict.title == "原住民族委員會 - 原住民族語言線上詞典" - - def test__get_url(self): - url = "https://e-dictionary.apc.gov.tw/search/list.htm" - assert url == self.dict._get_url("test") - - def test_show(self): - self.dict.args.verbose = False - - for record in self.records: - self.dict.show(record) - - def test_show_verbose(self): - self.dict.args.verbose = True - - for record in self.verbose_records: - self.dict.show(record) - - @patch("zdict.dictionaries.apc.Record") - def test_query_normal(self, Record): - self.dict.args.verbose = False - - for i, word in enumerate(self.words): - self.dict.query(word) - Record.assert_called_with( - word=word, content=self.records[i].content, source="apc", - ) - - @patch("zdict.dictionaries.apc.Record") - def test_query_verbose(self, Record): - self.dict.args.verbose = True - - for i, word in enumerate(self.words): - self.dict.query(word) - Record.assert_called_with( - word=word, - content=self.verbose_records[i].content, - source="apc", - ) - - def test_query_not_found(self): - # Trigger NotFoundError intentionally and see if it works. - with raises(NotFoundError): - self.dict.query(self.not_found_word) From a967bf9a8e7c673f670ef6487581485bec4821fa Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 22 Aug 2021 22:28:18 +0800 Subject: [PATCH 426/508] Try to fix iTaigi test --- zdict/tests/dictionaries/test_itaigi.py | 69 ++++++++++++++++++++----- 1 file changed, 55 insertions(+), 14 deletions(-) diff --git a/zdict/tests/dictionaries/test_itaigi.py b/zdict/tests/dictionaries/test_itaigi.py index 1bedea86..9230c85f 100644 --- a/zdict/tests/dictionaries/test_itaigi.py +++ b/zdict/tests/dictionaries/test_itaigi.py @@ -1,3 +1,4 @@ +import time from pytest import raises from unittest.mock import Mock, patch @@ -18,11 +19,35 @@ def setup_class(cls): cls.dict.args.query_timeout = 60 # Setup normal query data cls.dict.args.verbose = False - cls.records = [cls.dict.query(word) for word in cls.words] + cls.records = [] + for word in cls.words: + record = None + while True: + try: + record = cls.dict.query(word) + except Exception: + # prevent itaigi API 500 error + time.sleep(5) + continue + else: + cls.records.append(record) + break # Setup verbose query data cls.dict.args.verbose = True - cls.verbose_records = [cls.dict.query(word) for word in cls.words] + cls.verbose_records = [] + for word in cls.words: + record = None + while True: + try: + record = cls.dict.query(word) + except Exception: + # prevent itaigi API 500 error + time.sleep(5) + continue + else: + cls.verbose_records.append(record) + break # Change back to default verbose config cls.dict.args.verbose = False @@ -64,24 +89,40 @@ def test_query_normal(self, Record): self.dict.args.verbose = False for i, word in enumerate(self.words): - self.dict.query(word) - Record.assert_called_with( - word=word, - content=self.records[i].content, - source='itaigi', - ) + while True: + try: + self.dict.query(word) + except Exception: + # prevent itaigi API 500 error + time.sleep(5) + continue + else: + Record.assert_called_with( + word=word, + content=self.records[i].content, + source='itaigi', + ) + break @patch('zdict.dictionaries.itaigi.Record') def test_query_verbose(self, Record): self.dict.args.verbose = True for i, word in enumerate(self.words): - self.dict.query(word) - Record.assert_called_with( - word=word, - content=self.verbose_records[i].content, - source='itaigi', - ) + while True: + try: + self.dict.query(word) + except Exception: + # prevent itaigi API 500 error + time.sleep(5) + continue + else: + Record.assert_called_with( + word=word, + content=self.verbose_records[i].content, + source='itaigi', + ) + break def test_query_not_found(self): self.dict._get_raw = Mock(return_value='{"列表": []}') From 40c51248a1990ac7cc1045336c238af9f6140c8c Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 22 Aug 2021 23:44:45 +0800 Subject: [PATCH 427/508] [zdict 4.0.1] --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index d7f947a6..b362f57f 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '3.8.2' +VERSION = '4.0.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 8fbe1817a02766e774ee38f4f5c9284c6e5ebb51 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 23 Aug 2021 00:35:55 +0800 Subject: [PATCH 428/508] Update requests from 2.25.1 to 2.26.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a105b4a3..aa6cea38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.3 peewee==3.14.4 -requests==2.25.1 +requests==2.26.0 From dcb64561debf42e0670761ddd302171da51ade55 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Mon, 23 Aug 2021 01:03:33 +0800 Subject: [PATCH 429/508] [README] Remove stargazers since it's broken --- README.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.rst b/README.rst index 48ab8e46..91998b2b 100644 --- a/README.rst +++ b/README.rst @@ -305,10 +305,6 @@ Related Projects * Use zdict in Jupyter Notebook. -Stargazers over time ---------------------- - -|stargazers| .. |version| image:: https://img.shields.io/pypi/v/zdict.svg :target: https://pypi.org/project/zdict @@ -350,9 +346,6 @@ Stargazers over time .. |coveralls| image:: https://coveralls.io/repos/zdict/zdict/badge.svg :target: https://coveralls.io/github/zdict/zdict -.. |stargazers| image:: https://starcharts.herokuapp.com/zdict/zdict.svg - :target: https://starcharts.herokuapp.com/zdict/zdict - .. |docker automated build| image:: https://img.shields.io/docker/automated/zdict/zdict :target: https://hub.docker.com/r/zdict/zdict From 76c94284ad121467a7267c36eafc1cdab1a42b59 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 20:38:03 +0800 Subject: [PATCH 430/508] [#489] Modify CirclCI workflow to branch based - rename deploy to pypi-deploy --- .circleci/config.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f2ae392..e05030eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 workflows: version: 2 - build-test-deploy: + main: jobs: - linux-python-3_9: filters: @@ -24,7 +24,34 @@ workflows: filters: tags: only: /.*/ - - deploy: + + release: + jobs: + - linux-python-3_9: + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ + - linux-python-3_8: + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ + - linux-python-3_7: + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ + - linux-python-3_6: + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ + - pypi-deploy: requires: - linux-python-3_9 - linux-python-3_8 @@ -142,7 +169,7 @@ jobs: # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ - deploy: + pypi-deploy: docker: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - image: circleci/python:3.6 From 16017f32071355a65d690b0c80b8bcf437a8aa0a Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 21:29:50 +0800 Subject: [PATCH 431/508] [#489] Add dockerhub-push job for CircleCI --- .circleci/config.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e05030eb..06539baf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,15 @@ workflows: filters: tags: only: /.*/ + - dockerhub-push: + requires: + - linux-python-3_9 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 + filters: + tags: + only: /.*/ release: jobs: @@ -51,6 +60,17 @@ workflows: only: /[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ + - dockerhub-push: + requires: + - linux-python-3_9 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - pypi-deploy: requires: - linux-python-3_9 @@ -167,6 +187,25 @@ jobs: docker: - image: circleci/python:3.6 + # https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/ + dockerhub-push: + environment: + IMAGE_NAME: zdict/zdict + docker: + - image: circleci/buildpack-deps:stretch + steps: + - checkout + - setup_remote_docker + - run: + name: Publish Docker Image to Docker Hub + command: | + echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin + + if [ ! -z "$CIRCLE_TAG" ]; then + docker push ${IMAGE_NAME}:${CIRCLE_TAG} + else + docker push ${IMAGE_NAME}:latest + # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ pypi-deploy: From 714da49f351dfd46186256eef3ca364b8c5fb9bd Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 21:44:45 +0800 Subject: [PATCH 432/508] [#489] [CircleCI] Fix if-else statement --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06539baf..0636252c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -205,6 +205,7 @@ jobs: docker push ${IMAGE_NAME}:${CIRCLE_TAG} else docker push ${IMAGE_NAME}:latest + fi # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ From 9eb6af757a223f784ed8d904fb6a82a4f66897fd Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 21:46:23 +0800 Subject: [PATCH 433/508] [#489] [CircleCI] Fix envvar Should be DOCKERHUB_PASSWORD not DOCKERHUB_PASS. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0636252c..531147e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -199,7 +199,7 @@ jobs: - run: name: Publish Docker Image to Docker Hub command: | - echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin + echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin if [ ! -z "$CIRCLE_TAG" ]; then docker push ${IMAGE_NAME}:${CIRCLE_TAG} From ef6d171de34f82f8f7c75152e80a6f34447bd84e Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 22:01:18 +0800 Subject: [PATCH 434/508] [#489] [CircleCI] Add docker build for building docker image --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 531147e0..ac1b1994 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -196,6 +196,9 @@ jobs: steps: - checkout - setup_remote_docker + - run: + name: Build Docker Image + command: docker build -t ${IMAGE_NAME}:latest - run: name: Publish Docker Image to Docker Hub command: | From dfeda55fd207a14c15c505ad61671be8659ff11e Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 22:02:03 +0800 Subject: [PATCH 435/508] [#489] [CircleCI] Refine dockerhub-push If it's a release: push current docker image (docker_image_tag == version_tag) --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ac1b1994..42b0c108 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -204,12 +204,15 @@ jobs: command: | echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin + # If it's a release, push the version tag as docker image tag to docker hub if [ ! -z "$CIRCLE_TAG" ]; then + docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${CIRCLE_TAG} docker push ${IMAGE_NAME}:${CIRCLE_TAG} - else - docker push ${IMAGE_NAME}:latest fi + # Default just push to latest image + docker push ${IMAGE_NAME}:latest + # Deploy to PyPI if semvar git tag pushed # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ pypi-deploy: From 236043f27c43083f0e9f6bcbeba3a18f2ea8fd19 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 22:08:44 +0800 Subject: [PATCH 436/508] [#489] [CircleCI] Fix docker build for building docker image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42b0c108..e9d75797 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -198,7 +198,7 @@ jobs: - setup_remote_docker - run: name: Build Docker Image - command: docker build -t ${IMAGE_NAME}:latest + command: docker build -t ${IMAGE_NAME}:latest . - run: name: Publish Docker Image to Docker Hub command: | From ba32724e0f9f4881a4cfd7601aea134d969053d1 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 22:35:34 +0800 Subject: [PATCH 437/508] [zdict 4.0.2] - 236043f (origin/master, origin/HEAD) [#489] [CircleCI] Fix docker build for building docker image - dfeda55 [#489] [CircleCI] Refine dockerhub-push - ef6d171 [#489] [CircleCI] Add docker build for building docker image - 9eb6af7 [#489] [CircleCI] Fix envvar - 714da49 [#489] [CircleCI] Fix if-else statement - 16017f3 (issue-489) [#489] Add dockerhub-push job for CircleCI - 76c9428 [#489] Modify CirclCI workflow to branch based - dcb6456 [README] Remove stargazers since it's broken - bbe8ee8 Merge pull request #490 from zdict/pyup-update-requests-2.25.1-to-2.26.0 - 8fbe181 (origin/pyup-update-requests-2.25.1-to-2.26.0, pyup-update-requests-2.25.1-to-2.26.0) Update requests from 2.25.1 to 2.26.0 - 76a9241 Merge pull request #488 from zdict/pyup-update-pytest-cov-2.12.0-to-2.12.1 - c62072d Merge pull request #481 from zdict/pyup-update-peewee-3.14.3-to-3.14.4 - 3efd02c Merge branch 'master' into pyup-update-pytest-cov-2.12.0-to-2.12.1 - 3b1e9ba Merge branch 'master' into pyup-update-peewee-3.14.3-to-3.14.4 - 2e0adab (origin/pyup-update-pytest-cov-2.12.0-to-2.12.1) Update pytest-cov from 2.12.0 to 2.12.1 - d11f481 (origin/pyup-update-peewee-3.14.3-to-3.14.4) Merge branch 'master' into pyup-update-peewee-3.14.3-to-3.14.4 - b9f7563 Update peewee from 3.14.3 to 3.14.4 --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index b362f57f..5b4cf735 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '4.0.1' +VERSION = '4.0.2' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From b5d47fdc80908006a2bb4a7ef0fd8a35b5fcc71b Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 22:44:54 +0800 Subject: [PATCH 438/508] [CircleCI] Fix filter condition for main workflow Should only run for master branch. No need to run when there's tag been pushed. --- .circleci/config.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e9d75797..cee30ad0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,19 +11,27 @@ workflows: - linux-python-3_9: filters: tags: - only: /.*/ + ignore: /.*/ + branches: + only: master - linux-python-3_8: filters: tags: - only: /.*/ + ignore: /.*/ + branches: + only: master - linux-python-3_7: filters: tags: - only: /.*/ + ignore: /.*/ + branches: + only: master - linux-python-3_6: filters: tags: - only: /.*/ + ignore: /.*/ + branches: + only: master - dockerhub-push: requires: - linux-python-3_9 @@ -32,7 +40,9 @@ workflows: - linux-python-3_6 filters: tags: - only: /.*/ + ignore: /.*/ + branches: + only: master release: jobs: From a4920dbe6133e3973a3757f1b4d58574df847354 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 29 Aug 2021 22:46:13 +0800 Subject: [PATCH 439/508] [zdict-4.0.3] --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 5b4cf735..cd647678 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '4.0.2' +VERSION = '4.0.3' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 706624354b09f3998dcb9f7f3aed87a9cbd80472 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 1 Sep 2021 18:13:16 +0000 Subject: [PATCH 440/508] Update pytest from 6.2.4 to 6.2.5 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index c5b49410..906ae321 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==5.5 flake8==3.9.2 pyjokes==0.6.0 -pytest==6.2.4 +pytest==6.2.5 pytest-cov==2.12.1 pytest-flake8==1.0.7 \ No newline at end of file From 5452bc7ed418f9470b9b5e6b456eef145b30cd82 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Thu, 2 Sep 2021 13:19:05 +0800 Subject: [PATCH 441/508] [CircleCI] Pull Request should run main workflow --- .circleci/config.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cee30ad0..236b87e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,26 +12,18 @@ workflows: filters: tags: ignore: /.*/ - branches: - only: master - linux-python-3_8: filters: tags: ignore: /.*/ - branches: - only: master - linux-python-3_7: filters: tags: ignore: /.*/ - branches: - only: master - linux-python-3_6: filters: tags: ignore: /.*/ - branches: - only: master - dockerhub-push: requires: - linux-python-3_9 From 125124b5b63b8ebc63c6f4dfd022acc784161441 Mon Sep 17 00:00:00 2001 From: Apua <829295+apua@users.noreply.github.com> Date: Fri, 3 Sep 2021 22:10:15 +0800 Subject: [PATCH 442/508] Fix docker build status badge Ref: https://shields.io/category/build Docker Cloud Build Status: /docker/cloud/build/:user/:repo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 91998b2b..7620992c 100644 --- a/README.rst +++ b/README.rst @@ -349,7 +349,7 @@ Related Projects .. |docker automated build| image:: https://img.shields.io/docker/automated/zdict/zdict :target: https://hub.docker.com/r/zdict/zdict -.. |docker build status| image:: https://img.shields.io/docker/build/zdict/zdict +.. |docker build status| image:: https://img.shields.io/docker/cloud/build/zdict/zdict :target: https://hub.docker.com/r/zdict/zdict .. |pyup status| image:: https://pyup.io/repos/github/zdict/zdict/shield.svg From 229abf25b0a2a53d005fcdbe48e742ebecf8ef2e Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 4 Sep 2021 18:11:56 +0800 Subject: [PATCH 443/508] [#489] Remove Docker automated build in README --- README.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 7620992c..aa9443dc 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ zdict |github_actions| |circleci| |coveralls| -|docker automated build| |docker build status| +|docker build status| |gitter| @@ -346,9 +346,6 @@ Related Projects .. |coveralls| image:: https://coveralls.io/repos/zdict/zdict/badge.svg :target: https://coveralls.io/github/zdict/zdict -.. |docker automated build| image:: https://img.shields.io/docker/automated/zdict/zdict - :target: https://hub.docker.com/r/zdict/zdict - .. |docker build status| image:: https://img.shields.io/docker/cloud/build/zdict/zdict :target: https://hub.docker.com/r/zdict/zdict From bdd32f8b991885ed18dde63be380cf25f93e16c4 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Sep 2021 08:45:46 +0800 Subject: [PATCH 444/508] [#495] Ignore "pronounce" field during iTaigi unittest iTaigi sometimes returns different result on pronounce. Ignore them in the tests. --- zdict/tests/dictionaries/test_itaigi.py | 50 +++++++++++++++++-------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/zdict/tests/dictionaries/test_itaigi.py b/zdict/tests/dictionaries/test_itaigi.py index 9230c85f..363307d5 100644 --- a/zdict/tests/dictionaries/test_itaigi.py +++ b/zdict/tests/dictionaries/test_itaigi.py @@ -1,12 +1,26 @@ +import json import time from pytest import raises -from unittest.mock import Mock, patch +from unittest.mock import Mock from zdict.exceptions import NotFoundError from zdict.zdict import get_args from zdict.dictionaries.itaigi import iTaigiDict +def _filter_pronounce(d: dict) -> dict: + new_d = {} + for k, v in d.items(): + if k == "pronounce": + continue + + if isinstance(v, dict): + new_d[k] = _filter_pronounce(v) + else: + new_d[k] = v + return new_d + + class TestiTaigiDict: @classmethod def setup_class(cls): @@ -84,43 +98,49 @@ def test_show_verbose(self): for record in self.verbose_records: self.dict.show(record) - @patch('zdict.dictionaries.itaigi.Record') - def test_query_normal(self, Record): + def test_query_normal(self): self.dict.args.verbose = False + query_record = None for i, word in enumerate(self.words): while True: try: - self.dict.query(word) + query_record = self.dict.query(word) except Exception: # prevent itaigi API 500 error time.sleep(5) continue else: - Record.assert_called_with( - word=word, - content=self.records[i].content, - source='itaigi', + assert ( + _filter_pronounce( + json.loads(query_record.content) + ) == + _filter_pronounce( + json.loads(self.records[i].content) + ) ) break - @patch('zdict.dictionaries.itaigi.Record') - def test_query_verbose(self, Record): + def test_query_verbose(self): self.dict.args.verbose = True + verbose_query_record = None for i, word in enumerate(self.words): while True: try: - self.dict.query(word) + verbose_query_record = self.dict.query(word) except Exception: # prevent itaigi API 500 error time.sleep(5) continue else: - Record.assert_called_with( - word=word, - content=self.verbose_records[i].content, - source='itaigi', + assert ( + _filter_pronounce( + json.loads(verbose_query_record.content) + ) == + _filter_pronounce( + json.loads(self.verbose_records[i].content) + ) ) break From ba553195915e78e282cbea03a9847fcd5f974f20 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Sep 2021 21:51:53 +0800 Subject: [PATCH 445/508] [CI] Add twine check before uploading to pypi --- .circleci/config.yml | 1 + setup.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 236b87e4..323739f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -262,4 +262,5 @@ jobs: name: upload to pypi command: | . venv/bin/activate + twine check dist/* twine upload dist/* diff --git a/setup.py b/setup.py index 8b96f4e6..59c3fa8a 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ def get_test_req(): keywords="cli, dictionary, framework", description="The last online dictionary framework you need. (?)", long_description=open("README.rst", encoding='utf-8').read(), + long_description_content_type="text/x-rst", download_url="https://github.com/zdict/zdict/archive/v{}.zip".format( version ), From f2d2f68ce3278f10f1cb9ca604358dbd958ab41b Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Sep 2021 21:59:45 +0800 Subject: [PATCH 446/508] [#496] Fix python-tag for bdist_wheel --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d3794572..370ee52b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,4 +9,4 @@ flake8-ignore = # F841 - local variable name is assigned to but never used [bdist_wheel] -python-tag = py36+ +python-tag = py36 From 3795da1402d315e9eaa5775c413f0fd5c3561000 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Sep 2021 22:01:34 +0800 Subject: [PATCH 447/508] [CI] Build sdist and bdist_wheel in one command --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 323739f0..46d92857 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -255,8 +255,7 @@ jobs: command: | . venv/bin/activate pip install wheel - python setup.py sdist - python setup.py bdist_wheel + python setup.py sdist bdist_wheel - run: name: upload to pypi From 03276da64ba6feef2939129c85224df9ccfe0db0 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Sep 2021 22:27:09 +0800 Subject: [PATCH 448/508] [#495] Ignore "pronounce" in list and tuple --- zdict/tests/dictionaries/test_itaigi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zdict/tests/dictionaries/test_itaigi.py b/zdict/tests/dictionaries/test_itaigi.py index 363307d5..3ced756c 100644 --- a/zdict/tests/dictionaries/test_itaigi.py +++ b/zdict/tests/dictionaries/test_itaigi.py @@ -11,11 +11,18 @@ def _filter_pronounce(d: dict) -> dict: new_d = {} for k, v in d.items(): + # iTaigiDict sometimes return one item of result + # with same meaning but different pronounce + # which will make this unittest randomly fail. if k == "pronounce": continue if isinstance(v, dict): new_d[k] = _filter_pronounce(v) + elif isinstance(v, tuple): + new_d[k] = tuple(_filter_pronounce(_) for _ in v) + elif isinstance(v, list): + new_d[k] = list(_filter_pronounce(_) for _ in v) else: new_d[k] = v return new_d From 960ae12e755aaa840e703920a3947e8b53b9d041 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Tue, 7 Sep 2021 23:27:44 +0800 Subject: [PATCH 449/508] [tests] Set timout to 60 seconds for naer dict --- zdict/tests/dictionaries/test_naer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zdict/tests/dictionaries/test_naer.py b/zdict/tests/dictionaries/test_naer.py index 9b72e5bc..751cb31b 100644 --- a/zdict/tests/dictionaries/test_naer.py +++ b/zdict/tests/dictionaries/test_naer.py @@ -16,6 +16,10 @@ def setup_class(cls): cls.words = ['西爾河', 'spring mass'] cls.not_found_word = 'dsafwwe' + # Set query_timeout from 5 seconds to 60 seconds, + # so it won't timeout that often. + cls.dict.args.query_timeout = 60 + # Setup normal query data cls.dict.args.verbose = False cls.records = [cls.dict.query(word) for word in cls.words] From c3108ccce1e3605dba62ba51c9bd4a99bf0f95d0 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 8 Sep 2021 16:17:38 +0000 Subject: [PATCH 450/508] Update beautifulsoup4 from 4.9.3 to 4.10.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index aa6cea38..7bbf27af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.9.3 +beautifulsoup4==4.10.0 peewee==3.14.4 requests==2.26.0 From 4ac7533937d7ef1cd29a33ee178e387d3e602b37 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 11 Sep 2021 12:17:05 +0800 Subject: [PATCH 451/508] [#499][testings] set timeout to 120 seconds for naer --- zdict/tests/dictionaries/test_naer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zdict/tests/dictionaries/test_naer.py b/zdict/tests/dictionaries/test_naer.py index 751cb31b..ce334768 100644 --- a/zdict/tests/dictionaries/test_naer.py +++ b/zdict/tests/dictionaries/test_naer.py @@ -16,9 +16,9 @@ def setup_class(cls): cls.words = ['西爾河', 'spring mass'] cls.not_found_word = 'dsafwwe' - # Set query_timeout from 5 seconds to 60 seconds, + # Set query_timeout from 5 seconds to 120 seconds, # so it won't timeout that often. - cls.dict.args.query_timeout = 60 + cls.dict.args.query_timeout = 120 # Setup normal query data cls.dict.args.verbose = False From 48aa5e1ce89343fe82de14a6822990ab5a71bd52 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sat, 11 Sep 2021 12:17:36 +0800 Subject: [PATCH 452/508] [#499][testings] Keep trying to get content from naer API --- zdict/tests/dictionaries/test_naer.py | 83 ++++++++++++++++++++------- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/zdict/tests/dictionaries/test_naer.py b/zdict/tests/dictionaries/test_naer.py index ce334768..b2452004 100644 --- a/zdict/tests/dictionaries/test_naer.py +++ b/zdict/tests/dictionaries/test_naer.py @@ -1,5 +1,7 @@ +import time + from pytest import raises -from unittest.mock import patch +from unittest.mock import Mock from zdict.exceptions import NotFoundError from zdict.zdict import get_args @@ -22,11 +24,37 @@ def setup_class(cls): # Setup normal query data cls.dict.args.verbose = False + cls.records = [] + for word in cls.words: + record = None + while True: + try: + record = cls.dict.query(word) + except Exception: + # prevent API 500 error + time.sleep(5) + continue + else: + cls.records.append(record) + break + cls.records = [cls.dict.query(word) for word in cls.words] # Setup verbose query data cls.dict.args.verbose = True - cls.verbose_records = [cls.dict.query(word) for word in cls.words] + cls.verbose_records = [] + for word in cls.words: + record = None + while True: + try: + record = cls.dict.query(word) + except Exception: + # prevent API 500 error + time.sleep(5) + continue + else: + cls.verbose_records.append(record) + break # Change back to default verbose config cls.dict.args.verbose = False @@ -43,7 +71,9 @@ def test_provider(self): assert self.dict.provider == 'naer' def test_title(self): - assert self.dict.title == '國家教育研究院 - 雙語詞彙、學術名詞暨辭書資訊網' + assert self.dict.title == ( + '國家教育研究院 - 雙語詞彙、學術名詞暨辭書資訊網' + ) def test__get_url(self): url = 'https://terms.naer.edu.tw/search?q=test&field=ti&match=smart' @@ -61,31 +91,44 @@ def test_show_verbose(self): for record in self.verbose_records: self.dict.show(record) - @patch('zdict.dictionaries.naer.Record') - def test_query_normal(self, Record): + def test_query_normal(self): self.dict.args.verbose = False + query_record = None for i, word in enumerate(self.words): - self.dict.query(word) - Record.assert_called_with( - word=word, - content=self.records[i].content, - source='naer', - ) - - @patch('zdict.dictionaries.naer.Record') - def test_query_verbose(self, Record): + while True: + try: + query_record = self.dict.query(word) + except Exception: + # prevent itaigi API 500 error + time.sleep(5) + continue + else: + assert query_record.content == self.records[i].content + break + + def test_query_verbose(self): self.dict.args.verbose = True + query_record = None for i, word in enumerate(self.words): - self.dict.query(word) - Record.assert_called_with( - word=word, - content=self.verbose_records[i].content, - source='naer', - ) + while True: + try: + query_record = self.dict.query(word) + except Exception: + # prevent itaigi API 500 error + time.sleep(5) + continue + else: + assert ( + query_record.content + == + self.verbose_records[i].content + ) + break def test_query_not_found(self): # Trigger NotFoundError intentionally and see if it works. + self.dict._get_raw = Mock(return_value='') with raises(NotFoundError): self.dict.query(self.not_found_word) From 64e88ea6a896671cfad56e2579804dedd9a57a83 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Sep 2021 10:14:34 +0800 Subject: [PATCH 453/508] [CI] Use CircleCI Coveralls Orb To fix error: ``` coveralls.exception.CoverallsException: Could not submit coverage: 405 Client Error: Not Allowed for url: https://coveralls.io/api/v1/jobs ``` ref: - https://docs.coveralls.io/parallel-build-webhook - https://circleci.com/developer/orbs/orb/coveralls/coveralls#usage-coveralls_parallel --- .circleci/config.yml | 57 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46d92857..8e8c8922 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,9 @@ # version: 2.1 +orbs: + coveralls: coveralls/coveralls@1.0.6 + workflows: version: 2 main: @@ -24,6 +27,15 @@ workflows: filters: tags: ignore: /.*/ + - send-coveralls: + requires: + - linux-python-3_9 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 + filters: + tags: + ignore: /.*/ - dockerhub-push: requires: - linux-python-3_9 @@ -62,6 +74,17 @@ workflows: only: /[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ + - send-coveralls: + requires: + - linux-python-3_9 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - dockerhub-push: requires: - linux-python-3_9 @@ -98,6 +121,12 @@ workflows: - linux-python-3_8 - linux-python-3_7 - linux-python-3_6 + - send-coveralls + requires: + - linux-python-3_9 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 # https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ commands: @@ -154,18 +183,15 @@ variables: - store_artifacts: path: test-reports destination: test-reports - - store_artifacts: path: htmlcov destination: htmlcov - early_return_for_forked_pull_requests - - - run: - name: send coverage to coveralls - command: | - . venv/bin/activate - coveralls + + - coveralls/upload: + parallel: true + flag_name: ${CIRCLE_JOB} jobs: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ @@ -173,21 +199,38 @@ jobs: <<: *test-template docker: - image: circleci/python:3.9 + environment: + COVERALLS_PARALLEL: true linux-python-3_8: <<: *test-template docker: - image: circleci/python:3.8 + environment: + COVERALLS_PARALLEL: true linux-python-3_7: <<: *test-template docker: - image: circleci/python:3.7 + environment: + COVERALLS_PARALLEL: true linux-python-3_6: <<: *test-template docker: - image: circleci/python:3.6 + environment: + COVERALLS_PARALLEL: true + + # https://docs.coveralls.io/parallel-build-webhook + # https://circleci.com/developer/orbs/orb/coveralls/coveralls#usage-coveralls_parallel + send-coveralls: + docker: + - image: 'cimg/base:2021.04' + steps: + - coveralls/upload: + parallel_finished: true # https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/ dockerhub-push: From 392c9dbddfd54a7911fdff08184894781fcdc69c Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Sep 2021 10:28:46 +0800 Subject: [PATCH 454/508] [CI] Fix CircleCI config --- .circleci/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e8c8922..02e16097 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,11 +122,6 @@ workflows: - linux-python-3_7 - linux-python-3_6 - send-coveralls - requires: - - linux-python-3_9 - - linux-python-3_8 - - linux-python-3_7 - - linux-python-3_6 # https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ commands: From 0e1f9eec0f758ea7382946bfdb004fa290741565 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Sep 2021 10:44:28 +0800 Subject: [PATCH 455/508] Revert "[CI] Fix CircleCI config" This reverts commit 392c9dbddfd54a7911fdff08184894781fcdc69c. --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02e16097..8e8c8922 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,6 +122,11 @@ workflows: - linux-python-3_7 - linux-python-3_6 - send-coveralls + requires: + - linux-python-3_9 + - linux-python-3_8 + - linux-python-3_7 + - linux-python-3_6 # https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ commands: From 1ecda7689bc9ada90c1d361cde58ad9d3f88b4f6 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Sep 2021 10:44:50 +0800 Subject: [PATCH 456/508] Revert "[CI] Use CircleCI Coveralls Orb" This reverts commit 64e88ea6a896671cfad56e2579804dedd9a57a83. --- .circleci/config.yml | 57 ++++++-------------------------------------- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e8c8922..46d92857 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,9 +4,6 @@ # version: 2.1 -orbs: - coveralls: coveralls/coveralls@1.0.6 - workflows: version: 2 main: @@ -27,15 +24,6 @@ workflows: filters: tags: ignore: /.*/ - - send-coveralls: - requires: - - linux-python-3_9 - - linux-python-3_8 - - linux-python-3_7 - - linux-python-3_6 - filters: - tags: - ignore: /.*/ - dockerhub-push: requires: - linux-python-3_9 @@ -74,17 +62,6 @@ workflows: only: /[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ - - send-coveralls: - requires: - - linux-python-3_9 - - linux-python-3_8 - - linux-python-3_7 - - linux-python-3_6 - filters: - tags: - only: /[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - dockerhub-push: requires: - linux-python-3_9 @@ -121,12 +98,6 @@ workflows: - linux-python-3_8 - linux-python-3_7 - linux-python-3_6 - - send-coveralls - requires: - - linux-python-3_9 - - linux-python-3_8 - - linux-python-3_7 - - linux-python-3_6 # https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ commands: @@ -183,15 +154,18 @@ variables: - store_artifacts: path: test-reports destination: test-reports + - store_artifacts: path: htmlcov destination: htmlcov - early_return_for_forked_pull_requests - - - coveralls/upload: - parallel: true - flag_name: ${CIRCLE_JOB} + + - run: + name: send coverage to coveralls + command: | + . venv/bin/activate + coveralls jobs: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ @@ -199,38 +173,21 @@ jobs: <<: *test-template docker: - image: circleci/python:3.9 - environment: - COVERALLS_PARALLEL: true linux-python-3_8: <<: *test-template docker: - image: circleci/python:3.8 - environment: - COVERALLS_PARALLEL: true linux-python-3_7: <<: *test-template docker: - image: circleci/python:3.7 - environment: - COVERALLS_PARALLEL: true linux-python-3_6: <<: *test-template docker: - image: circleci/python:3.6 - environment: - COVERALLS_PARALLEL: true - - # https://docs.coveralls.io/parallel-build-webhook - # https://circleci.com/developer/orbs/orb/coveralls/coveralls#usage-coveralls_parallel - send-coveralls: - docker: - - image: 'cimg/base:2021.04' - steps: - - coveralls/upload: - parallel_finished: true # https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/ dockerhub-push: From 043066180f97fcaee4a86322d6c2604dbc6ce4d6 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 4 Oct 2021 09:45:28 +0000 Subject: [PATCH 457/508] Update pytest-cov from 2.12.1 to 3.0.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 906ae321..36bbe9a9 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==5.5 flake8==3.9.2 pyjokes==0.6.0 pytest==6.2.5 -pytest-cov==2.12.1 +pytest-cov==3.0.0 pytest-flake8==1.0.7 \ No newline at end of file From 98a2cd31f937a8e46b14a54b3e65abbef77f06f5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 8 Oct 2021 07:50:29 +0000 Subject: [PATCH 458/508] Update coverage from 5.5 to 6.0.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 906ae321..bbedbe07 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==5.5 +coverage==6.0.1 flake8==3.9.2 pyjokes==0.6.0 pytest==6.2.5 From 494a74b86ef700b0f7f788ea8fed76849aa96362 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 12 Oct 2021 09:50:34 +0000 Subject: [PATCH 459/508] Update coverage from 6.0.1 to 6.0.2 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index b9202aec..400fa7a4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.0.1 +coverage==6.0.2 flake8==3.9.2 pyjokes==0.6.0 pytest==6.2.5 From 55afa721e4dd1d9c916a7e338fc6254e9681f67e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 12 Oct 2021 09:50:36 +0000 Subject: [PATCH 460/508] Update flake8 from 3.9.2 to 4.0.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index b9202aec..d1df6d61 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ coverage==6.0.1 -flake8==3.9.2 +flake8==4.0.1 pyjokes==0.6.0 pytest==6.2.5 pytest-cov==3.0.0 From 54cf5aedbd8066e99a5b083099111ef291da5462 Mon Sep 17 00:00:00 2001 From: Apua <829295+apua@users.noreply.github.com> Date: Wed, 13 Oct 2021 01:19:58 +0800 Subject: [PATCH 461/508] Fix missing indent of Urban multi-line def --- zdict/dictionaries/urban.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zdict/dictionaries/urban.py b/zdict/dictionaries/urban.py index b9771050..f5abca2b 100644 --- a/zdict/dictionaries/urban.py +++ b/zdict/dictionaries/urban.py @@ -29,11 +29,8 @@ def show(self, record: Record): # print word self.color.print(data.get('word', ''), 'yellow') - self.color.print( - data.get('definition', ''), - 'org', - indent=2, - ) + for line in data.get('definition', '').splitlines(): + self.color.print(line, 'org', indent=2) for example in data.get('example', '').split('\n'): self.color.print( From 007e00fe0b8c2f6baf60ab8191d6ccd5de616a6e Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 24 Oct 2021 10:41:48 +0800 Subject: [PATCH 462/508] [jisho] Fix showing format --- zdict/dictionaries/jisho.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zdict/dictionaries/jisho.py b/zdict/dictionaries/jisho.py index d060e854..0c1e1837 100644 --- a/zdict/dictionaries/jisho.py +++ b/zdict/dictionaries/jisho.py @@ -25,7 +25,11 @@ def _get_url(self, word) -> str: def show(self, record: Record): content = json.loads(record.content) - for data in content['data']: + for i, data in enumerate(content['data']): + # empty line separation + if i: + print() + # print word reading = data['japanese'][0].get('reading', '') word = data['japanese'][0].get('word', '') @@ -35,7 +39,6 @@ def show(self, record: Record): if word: self.color.print(word, 'yellow') - print() for idx, sense in enumerate(data['senses'], 1): From f3317c024faccdc7312ddabde68f6a4a9f43fd8d Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 24 Oct 2021 12:06:30 +0800 Subject: [PATCH 463/508] fix: jisho testings record.content['data'] is a list and it might have no fixed order like before. So, sorted it before comparing. --- zdict/tests/dictionaries/test_jisho.py | 42 +++++++++++++++++--------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/zdict/tests/dictionaries/test_jisho.py b/zdict/tests/dictionaries/test_jisho.py index 0ecb9c8f..39c9389f 100644 --- a/zdict/tests/dictionaries/test_jisho.py +++ b/zdict/tests/dictionaries/test_jisho.py @@ -1,5 +1,7 @@ +import json +from unittest.mock import Mock + from pytest import raises -from unittest.mock import Mock, patch from zdict.dictionaries.jisho import JishoDict from zdict.exceptions import NotFoundError @@ -43,25 +45,35 @@ def test_show_verbose(self): self.dict.args.verbose = True self.dict.show(self.record) - @patch('zdict.dictionaries.jisho.Record') - def test_query_normal(self, Record): + def test_query_normal(self): self.dict.args.verbose = False - self.dict.query(self.word) - Record.assert_called_with( - word=self.word, - content=self.record.content, - source=self.source, + record = self.dict.query(self.word) + + cls_record_content_dict = json.loads(self.record.content) + cls_record_content_dict['data'].sort( + key=lambda datum: datum.get('slug') ) + record_content_dict = json.loads(record.content) + record_content_dict['data'].sort(key=lambda datum: datum.get('slug')) + + assert record_content_dict == cls_record_content_dict + assert record.word == self.word + assert record.source == self.source - @patch('zdict.dictionaries.jisho.Record') - def test_query_verbose(self, Record): + def test_query_verbose(self): self.dict.args.verbose = True - self.dict.query(self.word) - Record.assert_called_with( - word=self.word, - content=self.record.content, - source=self.source, + record = self.dict.query(self.word) + + cls_record_content_dict = json.loads(self.record.content) + cls_record_content_dict['data'].sort( + key=lambda datum: datum.get('slug') ) + record_content_dict = json.loads(record.content) + record_content_dict['data'].sort(key=lambda datum: datum.get('slug')) + assert record_content_dict == cls_record_content_dict + + assert record.word == self.word + assert record.source == self.source def test_query_not_found(self): self.dict._get_raw = Mock(return_value='{"data": []}') From c9e9bbe7e928fa0b39ba58b100ba355e9eaf3e36 Mon Sep 17 00:00:00 2001 From: Frank Jheng Date: Sun, 24 Oct 2021 12:17:14 +0800 Subject: [PATCH 464/508] release: 4.0.5 491e46e Merge pull request #507 from zdict/fix-jisho-test f3317c0 fix: jisho testings 007e00f [jisho] Fix showing format 36f8237 Merge pull request #506 from apua/patch-1 54cf5ae Fix missing indent of Urban multi-line def 4fa00f6 Merge pull request #505 from zdict/pyup-update-flake8-3.9.2-to-4.0.1 025c3f1 Merge branch 'master' into pyup-update-flake8-3.9.2-to-4.0.1 8fd1070 Merge pull request #504 from zdict/pyup-update-coverage-6.0.1-to-6.0.2 55afa72 Update flake8 from 3.9.2 to 4.0.1 494a74b Update coverage from 6.0.1 to 6.0.2 b87ff26 Merge pull request #503 from zdict/pyup-update-coverage-5.5-to-6.0.1 67012c7 Merge pull request #502 from zdict/pyup-update-pytest-cov-2.12.1-to-3.0.0 98a2cd3 Update coverage from 5.5 to 6.0.1 0430661 Update pytest-cov from 2.12.1 to 3.0.0 1ecda76 Revert "[CI] Use CircleCI Coveralls Orb" 0e1f9ee Revert "[CI] Fix CircleCI config" 392c9db [CI] Fix CircleCI config 64e88ea [CI] Use CircleCI Coveralls Orb 2b4e741 Merge pull request #500 from zdict/issue-499 48aa5e1 [#499][testings] Keep trying to get content from naer API 4ac7533 [#499][testings] set timeout to 120 seconds for naer 6dc3778 Merge pull request #498 from zdict/pyup-update-beautifulsoup4-4.9.3-to-4.10.0 c3108cc Update beautifulsoup4 from 4.9.3 to 4.10.0 --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index cd647678..232e786f 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '4.0.3' +VERSION = '4.0.5' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From fd9aaf755a59f020863a1d5bae0b56f8db3fa5f7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 27 Oct 2021 05:03:28 +0000 Subject: [PATCH 465/508] Update peewee from 3.14.4 to 3.14.6 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7bbf27af..b4b40263 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.10.0 -peewee==3.14.4 +peewee==3.14.6 requests==2.26.0 From f548c357653e5dc71a54f9b070459b848a2e7c81 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Oct 2021 05:22:50 +0000 Subject: [PATCH 466/508] Update peewee from 3.14.6 to 3.14.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b4b40263..4d7cca87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.10.0 -peewee==3.14.6 +peewee==3.14.7 requests==2.26.0 From ef8a6f611d3014641eb77c3e157ff85e943bdec8 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Oct 2021 15:04:10 +0000 Subject: [PATCH 467/508] Update peewee from 3.14.7 to 3.14.8 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4d7cca87..153305fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.10.0 -peewee==3.14.7 +peewee==3.14.8 requests==2.26.0 From 8ae79089d4c5441f4e84b7f2e8dde60dbe5399b1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 12 Nov 2021 07:44:55 +0000 Subject: [PATCH 468/508] Update coverage from 6.0.2 to 6.1.2 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 940c5731..c8f87113 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.0.2 +coverage==6.1.2 flake8==4.0.1 pyjokes==0.6.0 pytest==6.2.5 From 34181ae86a1129d3a01a33cd43a1294e2a00a96b Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sat, 20 Nov 2021 19:52:49 +0800 Subject: [PATCH 469/508] Update README.rst Fix typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index aa9443dc..3e10f679 100644 --- a/README.rst +++ b/README.rst @@ -232,7 +232,7 @@ Testing ^^^^^^^^ During development, you can install our project as *editable*. -If you use `virtualenv`, you may want to create a new enviroment for `zdict`:: +If you use `virtualenv`, you may want to create a new environment for `zdict`:: $ git clone https://github.com/zdict/zdict.git $ cd zdict From a0baf2beec458afce758ddeb1b2fc04c153294ce Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 28 Nov 2021 06:20:05 -0500 Subject: [PATCH 470/508] Update coverage from 6.1.2 to 6.2 (#512) --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index c8f87113..938cb0aa 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.1.2 +coverage==6.2 flake8==4.0.1 pyjokes==0.6.0 pytest==6.2.5 From 0132fdeccb970ec90aea4f30d307a09dc721a8bc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 4 Jan 2022 15:24:32 +0000 Subject: [PATCH 471/508] Update requests from 2.26.0 to 2.27.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 153305fc..b0fb6877 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.10.0 peewee==3.14.8 -requests==2.26.0 +requests==2.27.0 From 6dc7227fcdb213b14e5de305177cf07af2d5cb29 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 5 Feb 2022 16:43:52 +0000 Subject: [PATCH 472/508] Update pytest from 6.2.5 to 7.0.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 938cb0aa..82c0e187 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==6.2 flake8==4.0.1 pyjokes==0.6.0 -pytest==6.2.5 +pytest==7.0.0 pytest-cov==3.0.0 pytest-flake8==1.0.7 \ No newline at end of file From fa5dfb3553d2b8e5d89a6e44ade5c449e7f77784 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 13 Feb 2022 02:54:22 +0000 Subject: [PATCH 473/508] Update pytest from 7.0.0 to 7.0.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 82c0e187..17efc476 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==6.2 flake8==4.0.1 pyjokes==0.6.0 -pytest==7.0.0 +pytest==7.0.1 pytest-cov==3.0.0 pytest-flake8==1.0.7 \ No newline at end of file From 8760e0d102efc462c9ce45738588dcd3a53e7784 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 15 Feb 2022 15:06:48 +0000 Subject: [PATCH 474/508] Update peewee from 3.14.8 to 3.14.9 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b0fb6877..9a61892b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.10.0 -peewee==3.14.8 +peewee==3.14.9 requests==2.27.0 From 7c5b79654e67d69044b4a3edec2986b67d04bd84 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 5 Mar 2022 07:18:53 +0000 Subject: [PATCH 475/508] Update pytest-flake8 from 1.0.7 to 1.1.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 17efc476..9e826f63 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,4 +3,4 @@ flake8==4.0.1 pyjokes==0.6.0 pytest==7.0.1 pytest-cov==3.0.0 -pytest-flake8==1.0.7 \ No newline at end of file +pytest-flake8==1.1.0 \ No newline at end of file From 13cccd9862c92a7cfb6c163c6ac39003e6a6e80e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 7 Mar 2022 19:03:20 +0000 Subject: [PATCH 476/508] Update peewee from 3.14.9 to 3.14.10 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9a61892b..3e6b7845 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.10.0 -peewee==3.14.9 +peewee==3.14.10 requests==2.27.0 From dc5e0dd575ebc2a98003385c91c50698de4d3bdd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 8 Apr 2022 04:27:34 +0000 Subject: [PATCH 477/508] Update beautifulsoup4 from 4.10.0 to 4.11.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3e6b7845..bb2bef0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.10.0 +beautifulsoup4==4.11.0 peewee==3.14.10 requests==2.27.0 From 2470f91610e41cafe95cd890d7926d876afd525b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 9 Apr 2022 02:27:09 +0000 Subject: [PATCH 478/508] Update beautifulsoup4 from 4.11.0 to 4.11.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bb2bef0a..9424be1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -beautifulsoup4==4.11.0 +beautifulsoup4==4.11.1 peewee==3.14.10 requests==2.27.0 From f001cc2396cb8e29d9fcd07bcc8916531e579563 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 24 Apr 2022 21:55:28 +0000 Subject: [PATCH 479/508] Update pytest from 7.0.1 to 7.1.2 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 9e826f63..f218a454 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==6.2 flake8==4.0.1 pyjokes==0.6.0 -pytest==7.0.1 +pytest==7.1.2 pytest-cov==3.0.0 pytest-flake8==1.1.0 \ No newline at end of file From fcb3d46a475135a1f0849df342d9268aab913fcf Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 3 Jun 2022 17:00:43 +0000 Subject: [PATCH 480/508] Update coverage from 6.2 to 6.4.1 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 9e826f63..e0799f07 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.2 +coverage==6.4.1 flake8==4.0.1 pyjokes==0.6.0 pytest==7.0.1 From e0ae9f54455c9299fb8698de97b5069c5d1f303f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 10 Jun 2022 14:15:21 +0000 Subject: [PATCH 481/508] Update requests from 2.27.0 to 2.28.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9424be1d..af418ad9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.11.1 peewee==3.14.10 -requests==2.27.0 +requests==2.28.0 From 91ece2587524543708fd335117b6faf0185dfe5e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 17 Jun 2022 14:10:57 +0000 Subject: [PATCH 482/508] Update peewee from 3.14.10 to 3.15.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9424be1d..dbaf61c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.11.1 -peewee==3.14.10 +peewee==3.15.0 requests==2.27.0 From 19ff5145155ac235dcd426819fba351478ce998f Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:04:46 +0800 Subject: [PATCH 483/508] zdict 4.1.0 The last zdict version which support Python 3.6. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 232e786f..6d69dd14 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '4.0.5' +VERSION = '4.1.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 25fff36869ac88670c6cbe2eb048e3263d1a111d Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 15:11:15 +0800 Subject: [PATCH 484/508] Remove Python 3.6 support Python 3.6 EOL at 2021/12/23 --- .circleci/config.yml | 21 +-------------------- .github/workflows/macos_testings.yml | 2 +- setup.py | 3 +-- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46d92857..40f35d4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,16 +20,11 @@ workflows: filters: tags: ignore: /.*/ - - linux-python-3_6: - filters: - tags: - ignore: /.*/ - dockerhub-push: requires: - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 - - linux-python-3_6 filters: tags: ignore: /.*/ @@ -56,18 +51,11 @@ workflows: only: /[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ - - linux-python-3_6: - filters: - tags: - only: /[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ - dockerhub-push: requires: - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 - - linux-python-3_6 filters: tags: only: /[0-9]+(\.[0-9]+)*/ @@ -78,7 +66,6 @@ workflows: - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 - - linux-python-3_6 filters: tags: only: /[0-9]+(\.[0-9]+)*/ @@ -97,7 +84,6 @@ workflows: - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 - - linux-python-3_6 # https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/ commands: @@ -184,11 +170,6 @@ jobs: docker: - image: circleci/python:3.7 - linux-python-3_6: - <<: *test-template - docker: - - image: circleci/python:3.6 - # https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/ dockerhub-push: environment: @@ -220,7 +201,7 @@ jobs: pypi-deploy: docker: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ - - image: circleci/python:3.6 + - image: cimg/python:3.10 working_directory: ~/repo steps: - checkout diff --git a/.github/workflows/macos_testings.yml b/.github/workflows/macos_testings.yml index aa69fe77..89ffd69b 100644 --- a/.github/workflows/macos_testings.yml +++ b/.github/workflows/macos_testings.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] # Prevent from cancelling rest of jobs in matrix when one of them is failed. fail-fast: false env: diff --git a/setup.py b/setup.py index 59c3fa8a..d347734c 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ def get_test_req(): ), platforms=['Linux', 'Mac'], license="GPL3", - python_requires=">=3.6", + python_requires=">=3.7", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -83,7 +83,6 @@ def get_test_req(): "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From ac44cd6d4095ccca96831726a69cd48235e6b059 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 15:13:47 +0800 Subject: [PATCH 485/508] Add Python 3.10 support --- .circleci/config.yml | 19 +++++++++++++++++++ .github/workflows/macos_testings.yml | 2 +- setup.py | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40f35d4e..eaf409b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,10 @@ workflows: version: 2 main: jobs: + - linux-python-3_10: + filters: + tags: + ignore: /.*/ - linux-python-3_9: filters: tags: @@ -22,6 +26,7 @@ workflows: ignore: /.*/ - dockerhub-push: requires: + - linux-python-3_10 - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 @@ -33,6 +38,12 @@ workflows: release: jobs: + - linux-python-3_10: + filters: + tags: + only: /[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ - linux-python-3_9: filters: tags: @@ -53,6 +64,7 @@ workflows: ignore: /.*/ - dockerhub-push: requires: + - linux-python-3_10 - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 @@ -63,6 +75,7 @@ workflows: ignore: /.*/ - pypi-deploy: requires: + - linux-python-3_10 - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 @@ -81,6 +94,7 @@ workflows: branches: only: master jobs: + - linux-python-3_10 - linux-python-3_9 - linux-python-3_8 - linux-python-3_7 @@ -155,6 +169,11 @@ variables: jobs: # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + linux-python-3_10: + <<: *test-template + docker: + - image: circleci/python:3.10 + linux-python-3_9: <<: *test-template docker: diff --git a/.github/workflows/macos_testings.yml b/.github/workflows/macos_testings.yml index 89ffd69b..06155ae5 100644 --- a/.github/workflows/macos_testings.yml +++ b/.github/workflows/macos_testings.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, 3.10] # Prevent from cancelling rest of jobs in matrix when one of them is failed. fail-fast: false env: diff --git a/setup.py b/setup.py index d347734c..36bb0953 100644 --- a/setup.py +++ b/setup.py @@ -86,6 +86,7 @@ def get_test_req(): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Utilities", ], ) From 5b9525db02f8386711b0b1929e538075066c765b Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 15:17:12 +0800 Subject: [PATCH 486/508] [CircleCI] Use replace circleci/python with cimg/python --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eaf409b6..cd4b6eda 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -168,26 +168,26 @@ variables: coveralls jobs: - # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + # Available CircleCI Python images: https://hub.docker.com/r/cimg/python/tags/ linux-python-3_10: <<: *test-template docker: - - image: circleci/python:3.10 + - image: cimg/python:3.10 linux-python-3_9: <<: *test-template docker: - - image: circleci/python:3.9 + - image: cimg/python:3.9 linux-python-3_8: <<: *test-template docker: - - image: circleci/python:3.8 + - image: cimg/python:3.8 linux-python-3_7: <<: *test-template docker: - - image: circleci/python:3.7 + - image: cimg/python:3.7 # https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/ dockerhub-push: @@ -219,7 +219,7 @@ jobs: # https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ pypi-deploy: docker: - # Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/ + # Available CircleCI Python images: https://hub.docker.com/r/cimg/python/tags/ - image: cimg/python:3.10 working_directory: ~/repo steps: From de71d0bbbff9c9a3a1609d7688c10199f15df286 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 15:22:08 +0800 Subject: [PATCH 487/508] [CI] Try to fix GitHub Action Python version 3.10 should be "3.10" not "3.1" --- .github/workflows/macos_testings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_testings.yml b/.github/workflows/macos_testings.yml index 06155ae5..db6c0150 100644 --- a/.github/workflows/macos_testings.yml +++ b/.github/workflows/macos_testings.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: ["3.7", "3.8", "3.9", "3.10"] # Prevent from cancelling rest of jobs in matrix when one of them is failed. fail-fast: false env: From aaee27f32f23591f3793822f19f562fb5cf4e27c Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 15:23:38 +0800 Subject: [PATCH 488/508] [CI] Try to fix CircleCI --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd4b6eda..6c087a1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -127,7 +127,7 @@ variables: - run: name: install dependencies command: | - python3 -m venv venv + python -m venv venv . venv/bin/activate pip install -U pip pip install -r requirements.txt @@ -232,7 +232,7 @@ jobs: - run: name: install dependencies command: | - python3 -m venv venv + python -m venv venv . venv/bin/activate pip install -U pip pip install twine From 42039d1e943aba9ffea87fe0ddd276e8e65bcc2f Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 15:35:11 +0800 Subject: [PATCH 489/508] [CI] Try to fix CircleCI cimg/python venv cache --- .circleci/config.yml | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c087a1c..48ecf102 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,24 +120,32 @@ variables: steps: - checkout + - run: python --version + - restore_cache: - keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + # ** + # restores saved dependency cache + # if the Branch key template or requirements.txt files + # have not changed since the previous run + # ** + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-test.txt" }} - run: name: install dependencies command: | - python -m venv venv + python3 -m venv venv . venv/bin/activate + pip install -U pip pip install -r requirements.txt pip install -r requirements-test.txt pip install coveralls - save_cache: + # ** special step to save dependency cache ** + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-test.txt" }} paths: - - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + - "venv" - run: name: run tests @@ -225,23 +233,30 @@ jobs: steps: - checkout + - run: python --version + - restore_cache: - keys: - - pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} + # ** + # restores saved dependency cache + # if the Branch key template or requirements.txt files + # have not changed since the previous run + # ** + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-test.txt" }} - run: name: install dependencies command: | - python -m venv venv + python3 -m venv venv . venv/bin/activate + pip install -U pip pip install twine - save_cache: + # ** special step to save dependency cache ** + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-test.txt" }} paths: - - ./venv - key: pip-cache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements-test.txt" }}-{{ checksum "requirements.txt" }} - + - "venv" - run: name: init .pypirc From fea272022bd55572ad94312d27b22b7f2af56960 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:15:35 +0800 Subject: [PATCH 490/508] [CI] CircleCI: remove not found venv --- .circleci/config.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48ecf102..e0ebcfe5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -133,9 +133,6 @@ variables: - run: name: install dependencies command: | - python3 -m venv venv - . venv/bin/activate - pip install -U pip pip install -r requirements.txt pip install -r requirements-test.txt @@ -145,12 +142,11 @@ variables: # ** special step to save dependency cache ** key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-test.txt" }} paths: - - "venv" + - "~/.cache/pip" - run: name: run tests command: | - . venv/bin/activate # The website of NaerDict use TLSv1.0 # The MinProtocol of TLS on CircleCI is v1.2 # If we don't do this, testings for NaerDict will fail on CircleCI @@ -172,7 +168,6 @@ variables: - run: name: send coverage to coveralls command: | - . venv/bin/activate coveralls jobs: @@ -246,9 +241,6 @@ jobs: - run: name: install dependencies command: | - python3 -m venv venv - . venv/bin/activate - pip install -U pip pip install twine @@ -256,7 +248,7 @@ jobs: # ** special step to save dependency cache ** key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-test.txt" }} paths: - - "venv" + - "~/.cache/pip" - run: name: init .pypirc @@ -268,13 +260,11 @@ jobs: - run: name: create packages command: | - . venv/bin/activate pip install wheel python setup.py sdist bdist_wheel - run: name: upload to pypi command: | - . venv/bin/activate twine check dist/* twine upload dist/* From 7b412f156a675a2bceb68971dcbfbff45182abc9 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:20:45 +0800 Subject: [PATCH 491/508] [CI] CircleCI: Try to use large resource_class Which might shorten build time. Default resource_class of docker is "medium". doc: medium : 2 vCPUs, 4 GB RAM medium+: 3 vCPUs, 6 GB RAM large : 4 vCPUs, 8 GB RAM xlarge : 8 vCPUs, 16 GB RAM Free plan can only access to large class, not xlarge. --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e0ebcfe5..513c356e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,21 +176,25 @@ jobs: <<: *test-template docker: - image: cimg/python:3.10 + resource_class: large linux-python-3_9: <<: *test-template docker: - image: cimg/python:3.9 + resource_class: large linux-python-3_8: <<: *test-template docker: - image: cimg/python:3.8 + resource_class: large linux-python-3_7: <<: *test-template docker: - image: cimg/python:3.7 + resource_class: large # https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/ dockerhub-push: @@ -198,6 +202,7 @@ jobs: IMAGE_NAME: zdict/zdict docker: - image: circleci/buildpack-deps:stretch + resource_class: large steps: - checkout - setup_remote_docker @@ -225,6 +230,7 @@ jobs: # Available CircleCI Python images: https://hub.docker.com/r/cimg/python/tags/ - image: cimg/python:3.10 working_directory: ~/repo + resource_class: large steps: - checkout From 7e1de7f0eba1597df6618f9176dba5f03d28f46a Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:29:22 +0800 Subject: [PATCH 492/508] [setup.cfg] Drop Python 3.6 support --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 370ee52b..dc707b66 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,4 +9,4 @@ flake8-ignore = # F841 - local variable name is assigned to but never used [bdist_wheel] -python-tag = py36 +python-tag = py37 From 4d7f8204137b68d6d5845dcbfe92e44049dc83c1 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:30:56 +0800 Subject: [PATCH 493/508] [setup.py] Update author info --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 36bb0953..1fc2e8cc 100644 --- a/setup.py +++ b/setup.py @@ -55,10 +55,10 @@ def get_test_req(): name='zdict', version=version, - author='Shun-Yi Jheng', - author_email='M157q.tw@gmail.com', - maintainer='Shun-Yi Jheng, Iblis Lin, Chang-Yen Chih, Chiu-Hsiang Hsu', - maintainer_email=('M157q.tw@gmail.com,' + author='Frank Zheng', + author_email='github@m157q.tw', + maintainer='Frank Zheng, Iblis Lin, Chang-Yen Chih, Chiu-Hsiang Hsu', + maintainer_email=('github@m157q.tw' 'e196819@hotmail.com,' 'michael66230@gmail.com,' 'wdv4758h@gmail.com'), From 254d6a41896dda953b7302fa813e1c30b616ca7e Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:42:01 +0800 Subject: [PATCH 494/508] zdict - 5.0.0 - No longer support Python 3.6 from this major version. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 6d69dd14..b6ef6ba3 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '4.1.0' +VERSION = '5.0.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 46c518b2baa9c9ec07890d4747950980e2a6d689 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:30:56 +0800 Subject: [PATCH 495/508] [setup.py] Update author info --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 36bb0953..98806091 100644 --- a/setup.py +++ b/setup.py @@ -55,10 +55,10 @@ def get_test_req(): name='zdict', version=version, - author='Shun-Yi Jheng', - author_email='M157q.tw@gmail.com', - maintainer='Shun-Yi Jheng, Iblis Lin, Chang-Yen Chih, Chiu-Hsiang Hsu', - maintainer_email=('M157q.tw@gmail.com,' + author='Frank Zheng', + author_email='github@m157q.tw', + maintainer='Frank Zheng, Iblis Lin, Chang-Yen Chih, Chiu-Hsiang Hsu', + maintainer_email=('github@m157q.tw,' 'e196819@hotmail.com,' 'michael66230@gmail.com,' 'wdv4758h@gmail.com'), From 727d91d4a16115900e7465f985196c161e3ae908 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 17:42:01 +0800 Subject: [PATCH 496/508] zdict - 5.0.0 - No longer support Python 3.6 from this major version. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index 6d69dd14..b6ef6ba3 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '4.1.0' +VERSION = '5.0.0' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From 31a39ee618f29190c078765a29a130329d5720a1 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 18:48:27 +0800 Subject: [PATCH 497/508] zdict - 5.0.1 - Upgrade some dependencies after 5.0.0. --- zdict/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdict/constants.py b/zdict/constants.py index b6ef6ba3..f72484ad 100644 --- a/zdict/constants.py +++ b/zdict/constants.py @@ -1,7 +1,7 @@ import os -VERSION = '5.0.0' +VERSION = '5.0.1' BASE_DIR_NAME = '.zdict' BASE_DIR = os.path.join(os.path.expanduser("~"), BASE_DIR_NAME) From fe615ddff5e526822a77530b6c15f436fdecdeb5 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 19:02:51 +0800 Subject: [PATCH 498/508] [README] Add `--platform=linux/amd64` for docker run examples Since we are using linux/amd64 in our Dockerfile. docker run without `--platform=linux/amd64` will show the warning below if users are using Docker on Non-Linux environments: ``` WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ``` --- README.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 3e10f679..dce922cb 100644 --- a/README.rst +++ b/README.rst @@ -73,20 +73,20 @@ How to run the zdict docker image .. code-block:: sh # Run interactive mode - docker run -it --rm zdict/zdict # latest commit - docker run -it --rm zdict/zdict:release # latest release - docker run -it --rm zdict/zdict:v0.10.0 # use zdict v0.10.0 - docker run -it --rm zdict/zdict:$tag # with specific tag + docker run -it --rm --platform=linux/amd64 zdict/zdict # latest commit + docker run -it --rm --platform=linux/amd64 zdict/zdict:release # latest release + docker run -it --rm --platform=linux/amd64 zdict/zdict:v0.10.0 # use zdict v0.10.0 + docker run -it --rm --platform=linux/amd64 zdict/zdict:$tag # with specific tag # Run normal mode - docker run -it --rm zdict/zdict apple bird # latest commit - docker run -it --rm zdict/zdict:release apple bird # latest release - docker run -it --rm zdict/zdict:v0.10.0 apple bird # use zdict v0.10.0 - docker run -it --rm zdict/zdict:$tag apple bird # with specific tag + docker run -it --rm --platform=linux/amd64 zdict/zdict apple bird # latest commit + docker run -it --rm --platform=linux/amd64 zdict/zdict:release apple bird # latest release + docker run -it --rm --platform=linux/amd64 zdict/zdict:v0.10.0 apple bird # use zdict v0.10.0 + docker run -it --rm --platform=linux/amd64 zdict/zdict:$tag apple bird # with specific tag # You can also add the options while using docker run either interactive mode or normal mode - docker run -it --rm zdict/zdict:v0.10.0 -dt moe # use moe dict in interactive mode - docker run -it --rm zdict/zdict:v0.10.0 -dt moe 哈 # use moe dict in normal mode + docker run -it --rm --platform=linux/amd64 zdict/zdict:v0.10.0 -dt moe # use moe dict in interactive mode + docker run -it --rm --platform=linux/amd64 zdict/zdict:v0.10.0 -dt moe 哈 # use moe dict in normal mode Usage ------------------------------ From c2c7cde5cbbe00f4ba4b5c351faf8df0d54f1c6d Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Sun, 19 Jun 2022 19:09:54 +0800 Subject: [PATCH 499/508] [Makefile] also add --platform=linux/amd64 For docker related commands. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3f6c709b..9b628ab7 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ docker-zdict: # Let users can use `make docker-zdict apple bird` # https://stackoverflow.com/questions/6273608 - @docker run -it --rm zdict/zdict $(filter-out $@,$(MAKECMDGOALS)) + @docker run -it --rm --platform=linux/amd64 zdict/zdict $(filter-out $@,$(MAKECMDGOALS)) docker-run: - @docker run -it --entrypoint=/bin/bash --rm zdict/zdict + @docker run -it --entrypoint=/bin/sh --rm --platform=linux/amd64 zdict/zdict docker-pull: @docker pull zdict/zdict From 3ee1b4eea192a4f839622a9a24248839dcc1d8e7 Mon Sep 17 00:00:00 2001 From: Frank Zheng Date: Mon, 20 Jun 2022 10:26:10 +0800 Subject: [PATCH 500/508] [gitignore] Add .DS_Store for macOS --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 3e9c5786..7966be9a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ build .eggs htmlcov/ test-reports/ + +# macOS +.DS_Store From f0d52b8640de0c6fda54bc708e813d1574ad67ba Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 30 Jun 2022 14:04:28 +0000 Subject: [PATCH 501/508] Update requests from 2.28.0 to 2.28.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 54dd88be..2a65686b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.11.1 peewee==3.15.0 -requests==2.28.0 +requests==2.28.1 From 8dc8e19b72c77b6e1995c824878983e74cfbf7de Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 12 Jul 2022 14:10:43 +0000 Subject: [PATCH 502/508] Update coverage from 6.4.1 to 6.4.2 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 6e5054a2..094b52fb 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.4.1 +coverage==6.4.2 flake8==4.0.1 pyjokes==0.6.0 pytest==7.1.2 From 5bee2a46d004a7cd666cd651bccccabf290adec7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 12 Jul 2022 14:10:45 +0000 Subject: [PATCH 503/508] Update peewee from 3.15.0 to 3.15.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2a65686b..d93d5dd3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.11.1 -peewee==3.15.0 +peewee==3.15.1 requests==2.28.1 From 666c07d2201e88b576bd2150292fc35de5e62953 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 17 Aug 2022 19:46:48 +0000 Subject: [PATCH 504/508] Update coverage from 6.4.2 to 6.4.4 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 094b52fb..f5389086 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.4.2 +coverage==6.4.4 flake8==4.0.1 pyjokes==0.6.0 pytest==7.1.2 From dad508e24110f3b22900359edb9ede4c1f39d19a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 3 Sep 2022 15:46:58 +0000 Subject: [PATCH 505/508] Update pytest from 7.1.2 to 7.1.3 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index f5389086..755d3f47 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage==6.4.4 flake8==4.0.1 pyjokes==0.6.0 -pytest==7.1.2 +pytest==7.1.3 pytest-cov==3.0.0 pytest-flake8==1.1.0 \ No newline at end of file From e5d9094d341c4898b509410e4ed7cb10453748d9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 22 Sep 2022 04:10:08 +0000 Subject: [PATCH 506/508] Update peewee from 3.15.1 to 3.15.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d93d5dd3..03112ef4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.11.1 -peewee==3.15.1 +peewee==3.15.3 requests==2.28.1 From 98ceb13cb8c3151911814fecec40fd43c0b7ffb1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 29 Sep 2022 12:10:31 +0000 Subject: [PATCH 507/508] Update pytest-cov from 3.0.0 to 4.0.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 755d3f47..ffb2ab97 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ coverage==6.4.4 flake8==4.0.1 pyjokes==0.6.0 pytest==7.1.3 -pytest-cov==3.0.0 +pytest-cov==4.0.0 pytest-flake8==1.1.0 \ No newline at end of file From c3b5eec25393b74405be788f8ab360a6a6a271bb Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 30 Sep 2022 00:14:48 +0000 Subject: [PATCH 508/508] Update coverage from 6.4.4 to 6.5.0 --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index ffb2ab97..0f618d6e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -coverage==6.4.4 +coverage==6.5.0 flake8==4.0.1 pyjokes==0.6.0 pytest==7.1.3