From 95b5497ee74e6c766c57db8d0105523ebde5e0e5 Mon Sep 17 00:00:00 2001 From: Anton Ovinnikov Date: Wed, 27 Jan 2021 16:41:22 +0200 Subject: [PATCH 01/12] - Drop stale Python versions, test only on new ones --- .travis.yml | 12 +++++------- README.md | 2 +- querylist/__init__.py | 2 +- requirements26.txt | 4 ---- 4 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 requirements26.txt diff --git a/.travis.yml b/.travis.yml index eb17489..0af911d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,13 @@ language: python sudo: false python: - - "2.6" - - "2.7" - - "3.3" - - "3.4" - - "3.5" + - "3.6" + - "3.7" + - "3.8" + - "3.9" - "pypy" install: - - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r requirements26.txt; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]]; then pip install -r requirements.txt; fi + - pip install -r requirements.txt script: - nosetests after_success: diff --git a/README.md b/README.md index 92d4da8..89a4fe1 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Querylist can be installed like any other python package: > pip install querylist -Querylist is tested against Python 2.6, 2.7, 3.3, 3.4, and pypy. +Querylist is tested against Python 3.6+ and pypy. ## Usage diff --git a/querylist/__init__.py b/querylist/__init__.py index 93a1ddf..a483ee8 100644 --- a/querylist/__init__.py +++ b/querylist/__init__.py @@ -2,7 +2,7 @@ from querylist.list import QueryList from querylist.dict import BetterDict -__version__ = '0.4.0' +__version__ = '0.5.0' __author__ = 'Thomas Welfley' __all__ = ['QueryList', 'BetterDict'] diff --git a/requirements26.txt b/requirements26.txt deleted file mode 100644 index 1ef3a79..0000000 --- a/requirements26.txt +++ /dev/null @@ -1,4 +0,0 @@ -# These requirements are specifically needed for python 2.6 -unittest2==1.1.0 - --r requirements.txt From 5604b0f77f17213e851a0619308676ab77f40414 Mon Sep 17 00:00:00 2001 From: Anton Ovinnikov Date: Wed, 27 Jan 2021 17:04:03 +0200 Subject: [PATCH 02/12] maybe do not bump if no code changes? also, trigger trvis build --- querylist/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/querylist/__init__.py b/querylist/__init__.py index a483ee8..93a1ddf 100644 --- a/querylist/__init__.py +++ b/querylist/__init__.py @@ -2,7 +2,7 @@ from querylist.list import QueryList from querylist.dict import BetterDict -__version__ = '0.5.0' +__version__ = '0.4.0' __author__ = 'Thomas Welfley' __all__ = ['QueryList', 'BetterDict'] From b973100a816215d86b0410fce79c268751b44de8 Mon Sep 17 00:00:00 2001 From: Anton Ovinnikov Date: Wed, 27 Jan 2021 17:07:25 +0200 Subject: [PATCH 03/12] remove code related to python 2.6 --- querylist/__init__.py | 2 +- setup.py | 8 -------- tests/base.py | 5 +---- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/querylist/__init__.py b/querylist/__init__.py index 93a1ddf..a483ee8 100644 --- a/querylist/__init__.py +++ b/querylist/__init__.py @@ -2,7 +2,7 @@ from querylist.list import QueryList from querylist.dict import BetterDict -__version__ = '0.4.0' +__version__ = '0.5.0' __author__ = 'Thomas Welfley' __all__ = ['QueryList', 'BetterDict'] diff --git a/setup.py b/setup.py index ae41d43..d13b841 100644 --- a/setup.py +++ b/setup.py @@ -10,14 +10,6 @@ 'spec>=1.2.2,<1.3', ] -if sys.version_info < (2, 7): - # spec causes python setup.py test to fail. This import fixes that for - # some reason. - import multiprocessing # noqa - - # If we're still on python 2.6, we need unittest2 - tests_require.append('unittest2<1.2') - setup( name='querylist', version=querylist.__version__, diff --git a/tests/base.py b/tests/base.py index 6b3b2af..6b33dbb 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1,4 +1 @@ -try: - from unittest2 import TestCase # noqa -except ImportError: - from unittest import TestCase # noqa +from unittest import TestCase # noqa From 1bcd6603ddc53a4f188f84e6c3b274def9818245 Mon Sep 17 00:00:00 2001 From: Thomas Welfley Date: Wed, 27 Jan 2021 23:09:19 -0800 Subject: [PATCH 04/12] Update development dependencies to latest versions --- requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index e607734..6ac1f40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ # Testing requirements. -coveralls==1.1 -flake8==2.3.0 +coveralls==3.0.0 +flake8==3.8.4 frosted==1.4.1 nose==1.3.7 -pep257==0.4.1 -spec==1.2.2 -testtube==1.0.0 +pep257==0.7.0 +spec==1.4.1 +testtube==1.1.0 # Documentation requirements. -Pygments==1.5 -Jinja2==2.6 -docutils==0.9.1 -Sphinx==1.1.3 +Pygments==2.7.4 +Jinja2==2.11.2 +docutils==0.16 +Sphinx==3.4.3 From 1ea9e3946915432f2641892681a767f62b21a144 Mon Sep 17 00:00:00 2001 From: Thomas Welfley Date: Wed, 27 Jan 2021 23:09:41 -0800 Subject: [PATCH 05/12] Remove unused file --- TODO.md | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 TODO.md diff --git a/TODO.md b/TODO.md deleted file mode 100644 index efe69d9..0000000 --- a/TODO.md +++ /dev/null @@ -1,18 +0,0 @@ -# Performance - -* Performance can be improved dramatically by adopting a lazy evaluation -approach. Instead of evaluating filtering/exclusion methods when they are -called, those constraints can be passed on to output QueryLists and simply -accumulated. -* Instead of wrapping all elements with the wrapper on instantiation, that -can wait until the data is accessed. - -# Complex queries (or) - -There is currently no way to do logical OR combinations of field lookups. We -should investigate an approach similar to Django's Q object. - -# Improved aggregation - -Currently, QueryLists only support counting. Standard aggregation functions -would be easy to implement. From 4e8ab4d688f7e86bd138d00483758fe0e652a8a4 Mon Sep 17 00:00:00 2001 From: Thomas Welfley Date: Wed, 27 Jan 2021 23:25:46 -0800 Subject: [PATCH 06/12] setup.py: Simplify test requirements This removes selective requirement installation for python <3 as it is no longer needed. --- setup.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/setup.py b/setup.py index ae41d43..ccb01a0 100644 --- a/setup.py +++ b/setup.py @@ -4,20 +4,6 @@ import querylist - -tests_require = [ - 'nose>=1.3.6,<1.4', - 'spec>=1.2.2,<1.3', -] - -if sys.version_info < (2, 7): - # spec causes python setup.py test to fail. This import fixes that for - # some reason. - import multiprocessing # noqa - - # If we're still on python 2.6, we need unittest2 - tests_require.append('unittest2<1.2') - setup( name='querylist', version=querylist.__version__, @@ -30,7 +16,7 @@ 'also provides BetterDict, a dot lookup/assignment capable ' 'wrapper for dicts that is 100% backwards compatible.', packages=find_packages(), - tests_require=tests_require, + tests_require=['nose>=1.3.7,<1.4', 'spec>=1.4.1,<1.5'], classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', From 69befb68aec49c2666a6a07256e6f3db33344819 Mon Sep 17 00:00:00 2001 From: Thomas Welfley Date: Wed, 27 Jan 2021 23:33:51 -0800 Subject: [PATCH 07/12] setup.py: update trove classifiers --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index ccb01a0..7cffc6b 100644 --- a/setup.py +++ b/setup.py @@ -18,9 +18,16 @@ packages=find_packages(), tests_require=['nose>=1.3.7,<1.4', 'spec>=1.4.1,<1.5'], classifiers=[ + 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Libraries', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: Implementation :: PyPy' ], test_suite='nose.collector', ) From 5e199500b20ce9b7b731e73a116e538cb219d029 Mon Sep 17 00:00:00 2001 From: Thomas Welfley Date: Wed, 27 Jan 2021 23:47:04 -0800 Subject: [PATCH 08/12] setup.py: add a long description Set the package's long description to the contents of the readme. --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7cffc6b..45509d9 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,12 @@ -import sys +from pathlib import Path from setuptools import setup, find_packages import querylist +with open(Path(__file__).absolute().parent / 'README.md', encoding='utf-8') as f: + long_description = f.read() + setup( name='querylist', version=querylist.__version__, @@ -15,6 +18,8 @@ 'ORM-esque filtering, excluding, and getting for lists. It ' 'also provides BetterDict, a dot lookup/assignment capable ' 'wrapper for dicts that is 100% backwards compatible.', + long_description=long_description, + long_description_content_type='text/markdown', packages=find_packages(), tests_require=['nose>=1.3.7,<1.4', 'spec>=1.4.1,<1.5'], classifiers=[ From 6b0712c0b0a9f0e67a467a1b2857bdc218ef7b93 Mon Sep 17 00:00:00 2001 From: Thomas Welfley Date: Wed, 27 Jan 2021 23:47:12 -0800 Subject: [PATCH 09/12] setup.py: set license to MIT --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 45509d9..502db4a 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ 'wrapper for dicts that is 100% backwards compatible.', long_description=long_description, long_description_content_type='text/markdown', + license='MIT', packages=find_packages(), tests_require=['nose>=1.3.7,<1.4', 'spec>=1.4.1,<1.5'], classifiers=[ From 34f00fe64bab9c4539d1f22cc45acde023ff152a Mon Sep 17 00:00:00 2001 From: Anton Ovinnikov Date: Thu, 28 Jan 2021 16:34:22 +0200 Subject: [PATCH 10/12] cheating to pass the tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0af911d..c6d9268 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - "3.7" - "3.8" - "3.9" - - "pypy" + - "pypy3" install: - pip install -r requirements.txt script: From 21bcee75dc667cfe537b1696fc0a38c6fb823af3 Mon Sep 17 00:00:00 2001 From: Anton Ovinnikov Date: Fri, 29 Jan 2021 14:59:46 +0200 Subject: [PATCH 11/12] Import unittest directly and other small fixes --- docs/source/installation.rst | 2 +- setup.py | 3 ++- tests/base.py | 1 - tests/betterdict_dict_tests.py | 4 ++-- tests/betterdict_tests.py | 3 +-- tests/betterdictlookup_tests.py | 4 ++-- tests/comparator_tests.py | 4 ++-- tests/fieldlookup_tests.py | 4 ++-- tests/querylist_list_tests.py | 4 ++-- tests/querylist_tests.py | 4 ++-- 10 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 tests/base.py diff --git a/docs/source/installation.rst b/docs/source/installation.rst index fee989e..014b254 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -10,4 +10,4 @@ the querylist module. >>> from querylist import BetterDict, QueryList -Querylist is tested against Python 2.6, 2.7, 3.3, 3.4, and pypy. +Querylist is tested against Python 3.6+ and pypy. diff --git a/setup.py b/setup.py index 502db4a..234a5e1 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,8 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: Implementation :: PyPy' + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', ], test_suite='nose.collector', ) diff --git a/tests/base.py b/tests/base.py deleted file mode 100644 index 6b33dbb..0000000 --- a/tests/base.py +++ /dev/null @@ -1 +0,0 @@ -from unittest import TestCase # noqa diff --git a/tests/betterdict_dict_tests.py b/tests/betterdict_dict_tests.py index 7cea8d3..d96e1f8 100644 --- a/tests/betterdict_dict_tests.py +++ b/tests/betterdict_dict_tests.py @@ -1,6 +1,6 @@ -from querylist import BetterDict +from unittest import TestCase -from tests.base import TestCase +from querylist import BetterDict class BetterDictActsAsDict(TestCase): diff --git a/tests/betterdict_tests.py b/tests/betterdict_tests.py index 40d57c2..80189a2 100644 --- a/tests/betterdict_tests.py +++ b/tests/betterdict_tests.py @@ -1,9 +1,8 @@ from copy import deepcopy +from unittest import TestCase from querylist import BetterDict -from tests.base import TestCase - SRC_DICT = { 'foo': 1, 'bar': { diff --git a/tests/betterdictlookup_tests.py b/tests/betterdictlookup_tests.py index 9afc27b..51346d1 100644 --- a/tests/betterdictlookup_tests.py +++ b/tests/betterdictlookup_tests.py @@ -1,6 +1,6 @@ -from querylist.dict import BetterDictLookUp +from unittest import TestCase -from tests.base import TestCase +from querylist.dict import BetterDictLookUp class BetterDictLookUpInstancesCan(TestCase): diff --git a/tests/comparator_tests.py b/tests/comparator_tests.py index ee37f23..c45b406 100644 --- a/tests/comparator_tests.py +++ b/tests/comparator_tests.py @@ -1,6 +1,6 @@ -from querylist.fieldlookup import FieldLookup +from unittest import TestCase -from tests.base import TestCase +from querylist.fieldlookup import FieldLookup fl = FieldLookup diff --git a/tests/fieldlookup_tests.py b/tests/fieldlookup_tests.py index 987df73..32fdf5d 100644 --- a/tests/fieldlookup_tests.py +++ b/tests/fieldlookup_tests.py @@ -1,8 +1,8 @@ +from unittest import TestCase + from querylist import BetterDict from querylist.fieldlookup import FieldLookup, field_lookup -from tests.base import TestCase - class FieldLookupTests(TestCase): def setUp(self): diff --git a/tests/querylist_list_tests.py b/tests/querylist_list_tests.py index f565433..f9c1837 100644 --- a/tests/querylist_list_tests.py +++ b/tests/querylist_list_tests.py @@ -1,6 +1,6 @@ -from querylist import BetterDict, QueryList +from unittest import TestCase -from tests.base import TestCase +from querylist import BetterDict, QueryList class QueryListAddition(TestCase): diff --git a/tests/querylist_tests.py b/tests/querylist_tests.py index bb7f317..a438946 100644 --- a/tests/querylist_tests.py +++ b/tests/querylist_tests.py @@ -1,6 +1,6 @@ -from querylist import QueryList, BetterDict +from unittest import TestCase -from tests.base import TestCase +from querylist import BetterDict, QueryList from tests.fixtures import SITE_LIST From 8abe26ff043a7446884bf68078a2b3c2abe8a7c7 Mon Sep 17 00:00:00 2001 From: Anton Ovinnikov Date: Fri, 29 Jan 2021 15:25:40 +0200 Subject: [PATCH 12/12] update changelog.rst --- docs/source/changelog.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index ffa5101..bc1190f 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,6 +1,12 @@ Changelog ========= +**0.5.0** + +* Dropped support for Python 2 +* Dropped support for all Python 3 versions below Python 3.6. +* Dropped support for PyPy based on Python 2.7. + **0.4.0** * Fixed an issue building wheels caused by an empty string as a requirement in