From c4fc6b082630bb97999ac00cdbb44f002569209f Mon Sep 17 00:00:00 2001 From: Wenshuai Hou Date: Fri, 7 Apr 2023 15:07:57 -0400 Subject: [PATCH 1/3] fix doc, add a blank line to show code snippet correctly --- toolz/functoolz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/toolz/functoolz.py b/toolz/functoolz.py index 2c75d3a4..7709f15b 100644 --- a/toolz/functoolz.py +++ b/toolz/functoolz.py @@ -757,6 +757,7 @@ class excepts(object): -1 Multiple exceptions and default except clause. + >>> excepting = excepts((IndexError, KeyError), lambda a: a[0]) >>> excepting([]) >>> excepting([1]) From 47d62a2a4d528670a27789f9b4b9e5ae875a0fdb Mon Sep 17 00:00:00 2001 From: Laurent Lyaudet Date: Mon, 10 Jul 2023 23:57:00 +0200 Subject: [PATCH 2/3] LL : typo "Syndey" -> "Sydney" --- doc/source/streaming-analytics.rst | 2 +- toolz/itertoolz.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/streaming-analytics.rst b/doc/source/streaming-analytics.rst index 4315e244..c5aecd60 100644 --- a/doc/source/streaming-analytics.rst +++ b/doc/source/streaming-analytics.rst @@ -271,7 +271,7 @@ residences. >>> cities = [('Alice', 'NYC'), ... ('Alice', 'Chicago'), - ... ('Dan', 'Syndey'), + ... ('Dan', 'Sydney'), ... ('Edith', 'Paris'), ... ('Edith', 'Berlin'), ... ('Zhao', 'Shanghai')] diff --git a/toolz/itertoolz.py b/toolz/itertoolz.py index 5049e5eb..634f4869 100644 --- a/toolz/itertoolz.py +++ b/toolz/itertoolz.py @@ -828,7 +828,7 @@ def join(leftkey, leftseq, rightkey, rightseq, >>> cities = [('Alice', 'NYC'), ... ('Alice', 'Chicago'), - ... ('Dan', 'Syndey'), + ... ('Dan', 'Sydney'), ... ('Edith', 'Paris'), ... ('Edith', 'Berlin'), ... ('Zhao', 'Shanghai')] From d70d11033a003b7d64ad4f61a43beb985de8bfb7 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 23 Jan 2024 19:58:04 -0600 Subject: [PATCH 3/3] Minimal maintenance to support Python 3.12 (and drop 3.5 and 3.6) --- .github/workflows/publish_pypi.yml | 6 +++--- .github/workflows/test.yml | 32 ++++++++++-------------------- README.rst | 8 ++++---- setup.py | 5 ++--- toolz/_signatures.py | 9 ++++----- tox.ini | 5 +++-- 6 files changed, 26 insertions(+), 39 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 1b9079bc..720c2486 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -13,11 +13,11 @@ jobs: shell: bash -l {0} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.8" - name: Install build dependencies @@ -25,7 +25,7 @@ jobs: - name: Build wheel run: python setup.py sdist bdist_wheel - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.8 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e88abd2c..8f4ba764 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,22 +13,21 @@ jobs: matrix: os: ["ubuntu-latest"] python-version: - - "3.5" - - "3.6" - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - - "pypy-3.6" + - "3.12" - "pypy-3.7" - "pypy-3.8" - "pypy-3.9" + - "pypy-3.10" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -42,23 +41,12 @@ jobs: pytest bench/ pep8 --ignore="E731,W503,E402" --exclude=conf.py,tests,examples,bench -r --show-source . - name: Coverage - env: - GITHUB_TOKEN: ${{ secrets.github_token }} - COVERALLS_FLAG_NAME: ${{ matrix.python-version}} - COVERALLS_PARALLEL: true if: (! contains(matrix.python-version, 'pypy')) run: | + coverage xml coverage report --show-missing --fail-under=100 - pip install coveralls - coverage report --show-missing - coveralls --service=github - - finish: - needs: test - runs-on: ubuntu-latest - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.github_token }} - parallel-finished: true + - name: codecov + if: (! contains(matrix.python-version, 'pypy')) + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.rst b/README.rst index e62ac791..a0000ab3 100644 --- a/README.rst +++ b/README.rst @@ -73,7 +73,7 @@ This builds a standard wordcount function from pieces within ``toolz``: Dependencies ------------ -``toolz`` supports Python 3.5+ with a common codebase. +``toolz`` supports Python 3.7+ with a common codebase. It is pure Python and requires no dependencies beyond the standard library. @@ -124,9 +124,9 @@ Community See our `mailing list `__. We're friendly. -.. |Build Status| image:: https://github.com/pytoolz/toolz/workflows/Test/badge.svg +.. |Build Status| image:: https://github.com/pytoolz/toolz/actions/workflows/test.yml/badge.svg?branch=master :target: https://github.com/pytoolz/toolz/actions -.. |Coverage Status| image:: https://coveralls.io/repos/pytoolz/toolz/badge.svg?branch=master - :target: https://coveralls.io/r/pytoolz/toolz +.. |Coverage Status| image:: https://codecov.io/gh/pytoolz/toolz/graph/badge.svg?token=4ZFc9dwKqY + :target: https://codecov.io/gh/pytoolz/toolz .. |Version Status| image:: https://badge.fury.io/py/toolz.svg :target: https://badge.fury.io/py/toolz diff --git a/setup.py b/setup.py index 5146e158..487303c0 100755 --- a/setup.py +++ b/setup.py @@ -22,18 +22,17 @@ long_description=(open('README.rst').read() if exists('README.rst') else ''), zip_safe=False, - python_requires=">=3.5", + python_requires=">=3.7", classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "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", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy"]) diff --git a/toolz/_signatures.py b/toolz/_signatures.py index ff536327..27229ef4 100644 --- a/toolz/_signatures.py +++ b/toolz/_signatures.py @@ -309,8 +309,12 @@ lambda *iterables: None], izip_longest=[ (0, lambda *iterables: None, ('fillvalue',))], + pairwise=[ + lambda iterable: None], permutations=[ (0, lambda iterable, r=0: None)], + product=[ + (0, lambda *iterables: None, ('repeat',))], repeat=[ (0, lambda object, times=0: None)], starmap=[ @@ -324,11 +328,6 @@ (0, lambda *iterables: None, ('fillvalue',))], ) -module_info[itertools].update( - product=[ - (0, lambda *iterables: None, ('repeat',))], -) - module_info[operator] = dict( __abs__=[ diff --git a/tox.ini b/tox.ini index 33bb87f0..983c85f8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,11 @@ [tox] envlist = - py35 - py36 py37 py38 py39 + py310 + py311 + py312 pypy3 skip_missing_interpreters = true