From f5210a6f2465297e32224b25fa4e4a8c30357000 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:07:44 +0200 Subject: [PATCH 1/5] Add support for Python 3.13 --- .github/workflows/integration.yml | 12 ++++++------ .github/workflows/release.yml | 6 +++--- README.rst | 2 +- tox.ini | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1014fd6..f4d8b31 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,11 +20,11 @@ jobs: check: [rufflint, ruffformatcheck, doc8, docs, rstcheck, build-check] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.x' - name: Install tox run: | pip install --upgrade pip @@ -40,12 +40,12 @@ jobs: max-parallel: 6 matrix: os: [ubuntu-latest] - python-version: [3.8, 3.9, '3.10', 3.11, 3.12] + python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} allow-prereleases: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e91f896..407ad27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,12 +13,12 @@ jobs: id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.x' - name: Install build run: pip install build diff --git a/README.rst b/README.rst index ba74b8c..3105edb 100644 --- a/README.rst +++ b/README.rst @@ -112,7 +112,7 @@ Features - Feature-rich (e.g. get the five largest keys in a sorted dict: d.keys()[-5:]) - Pragmatic design (e.g. SortedSet is a Python set with a SortedList index) - Developed on Python 3.10 -- Tested with CPython 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and PyPy3 +- Tested with CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and PyPy3 - Tested on Linux, Mac OSX, and Windows .. image:: https://github.com/grantjenks/python-sortedcontainers/workflows/integration/badge.svg diff --git a/tox.ini b/tox.ini index 35f51b2..b779751 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=rufflint,ruffformatcheck,doc8,docs,rstcheck,build-check,py{38,39,310,311,312,py3} +envlist=rufflint,ruffformatcheck,doc8,docs,rstcheck,build-check,py{38,39,310,311,312,313,py3} skip_missing_interpreters=True [testenv] From 836a0e13569ba2d28a5132853076bed024f5c7cd Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:09:06 +0200 Subject: [PATCH 2/5] Fix lint --- docs/conf.py | 3 +-- src/sortedcontainers/sorteddict.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 54598bf..f486b24 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -176,8 +176,7 @@ 'SortedContainers Documentation', author, 'SortedContainers', - 'Python sorted collections library:' - ' sorted list, sorted dict, and sorted set.', + 'Python sorted collections library: sorted list, sorted dict, and sorted set.', 'Miscellaneous', ), ] diff --git a/src/sortedcontainers/sorteddict.py b/src/sortedcontainers/sorteddict.py index 273c9ce..0be576e 100644 --- a/src/sortedcontainers/sorteddict.py +++ b/src/sortedcontainers/sorteddict.py @@ -191,7 +191,7 @@ def iloc(self): return self._iloc except AttributeError: warnings.warn( - 'sorted_dict.iloc is deprecated.' ' Use SortedDict.keys() instead.', + 'sorted_dict.iloc is deprecated. Use SortedDict.keys() instead.', DeprecationWarning, stacklevel=2, ) From b1068be60cc367c39dd6091b375a2b456f76fc9e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 18 Oct 2025 21:58:01 +0300 Subject: [PATCH 3/5] Add support for Python 3.14 --- .github/workflows/integration.yml | 10 +++++----- .github/workflows/release.yml | 4 ++-- README.rst | 4 ++-- tox.ini | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f4d8b31..7a85fd0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,9 +20,9 @@ jobs: check: [rufflint, ruffformatcheck, doc8, docs, rstcheck, build-check] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.x' - name: Install tox @@ -40,12 +40,12 @@ jobs: max-parallel: 6 matrix: os: [ubuntu-latest] - python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13] + python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13, 3.14] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} allow-prereleases: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 407ad27..56e8072 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,10 @@ jobs: id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.x' diff --git a/README.rst b/README.rst index 3105edb..415e116 100644 --- a/README.rst +++ b/README.rst @@ -112,8 +112,8 @@ Features - Feature-rich (e.g. get the five largest keys in a sorted dict: d.keys()[-5:]) - Pragmatic design (e.g. SortedSet is a Python set with a SortedList index) - Developed on Python 3.10 -- Tested with CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and PyPy3 -- Tested on Linux, Mac OSX, and Windows +- Tested with CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 and PyPy3 +- Tested on Linux, macOS, and Windows .. image:: https://github.com/grantjenks/python-sortedcontainers/workflows/integration/badge.svg :target: http://www.grantjenks.com/docs/sortedcontainers/ diff --git a/tox.ini b/tox.ini index b779751..21c2d74 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=rufflint,ruffformatcheck,doc8,docs,rstcheck,build-check,py{38,39,310,311,312,313,py3} +envlist=rufflint,ruffformatcheck,doc8,docs,rstcheck,build-check,py{38,39,310,311,312,313,314,py3} skip_missing_interpreters=True [testenv] From 410fb66413ec89f6270272394044fcfe728913ae Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:01:26 +0300 Subject: [PATCH 4/5] Fix lint --- src/sortedcontainers/sortedlist.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sortedcontainers/sortedlist.py b/src/sortedcontainers/sortedlist.py index aecf787..b86afce 100644 --- a/src/sortedcontainers/sortedlist.py +++ b/src/sortedcontainers/sortedlist.py @@ -668,7 +668,7 @@ def _build_index(self): head = iter(row0) tail = iter(head) - row1 = list(starmap(add, zip(head, tail))) + row1 = list(starmap(add, zip(head, tail, strict=False))) if len(row0) & 1: row1.append(row0[-1]) @@ -685,7 +685,7 @@ def _build_index(self): while len(tree[-1]) > 1: head = iter(tree[-1]) tail = iter(head) - row = list(starmap(add, zip(head, tail))) + row = list(starmap(add, zip(head, tail, strict=False))) tree.append(row) reduce(iadd, reversed(tree), self._index) @@ -1466,7 +1466,7 @@ def comparer(self, other): if seq_op is ne: return True - for alpha, beta in zip(self, other): + for alpha, beta in zip(self, other, strict=False): if alpha != beta: return seq_op(alpha, beta) @@ -2467,9 +2467,9 @@ def _check(self): # Check _keys matches _key mapped to _lists. - for val_sublist, key_sublist in zip(self._lists, self._keys): + for val_sublist, key_sublist in zip(self._lists, self._keys, strict=False): assert len(val_sublist) == len(key_sublist) - for val, key in zip(val_sublist, key_sublist): + for val, key in zip(val_sublist, key_sublist, strict=False): assert self._key(val) == key # Check _maxes index is the last value of each sublist. From d8fe3ab3deb31fa6f40fc08216edde5dfabf5683 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:06:34 +0300 Subject: [PATCH 5/5] Drop support for EOL Python 3.2-3.9 to fix 'zip() takes no keyword arguments' --- .github/workflows/integration.yml | 2 +- README.rst | 2 +- pyproject.toml | 2 +- tox.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7a85fd0..017692e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -40,7 +40,7 @@ jobs: max-parallel: 6 matrix: os: [ubuntu-latest] - python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13, 3.14] + python-version: ['3.10', 3.11, 3.12, 3.13, 3.14] steps: - uses: actions/checkout@v5 diff --git a/README.rst b/README.rst index 415e116..25e134f 100644 --- a/README.rst +++ b/README.rst @@ -112,7 +112,7 @@ Features - Feature-rich (e.g. get the five largest keys in a sorted dict: d.keys()[-5:]) - Pragmatic design (e.g. SortedSet is a Python set with a SortedList index) - Developed on Python 3.10 -- Tested with CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 and PyPy3 +- Tested with CPython 3.10, 3.11, 3.12, 3.13, 3.14 and PyPy3 - Tested on Linux, macOS, and Windows .. image:: https://github.com/grantjenks/python-sortedcontainers/workflows/integration/badge.svg diff --git a/pyproject.toml b/pyproject.toml index e135023..579594a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ {"name" = "Grant Jenks", "email" = "contact@grantjenks.com"}, ] readme = "README.rst" -requires-python = ">=3.2" +requires-python = ">=3.10" license = {"text" = "Apache 2.0"} classifiers = [ "Development Status :: 5 - Production/Stable", diff --git a/tox.ini b/tox.ini index 21c2d74..fc012be 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=rufflint,ruffformatcheck,doc8,docs,rstcheck,build-check,py{38,39,310,311,312,313,314,py3} +envlist=rufflint,ruffformatcheck,doc8,docs,rstcheck,build-check,py{310,311,312,313,314,py3} skip_missing_interpreters=True [testenv]