Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-jaraco.collections for openSUSE:Factory checked in at 2022-08-31 18:08:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jaraco.collections (Old) and /work/SRC/openSUSE:Factory/.python-jaraco.collections.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-jaraco.collections" Wed Aug 31 18:08:29 2022 rev:6 rq:1000110 version:3.5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jaraco.collections/python-jaraco.collections.changes 2020-12-12 20:31:11.297778417 +0100 +++ /work/SRC/openSUSE:Factory/.python-jaraco.collections.new.2083/python-jaraco.collections.changes 2022-08-31 18:08:32.487304572 +0200 @@ -1,0 +2,19 @@ +Mon Aug 29 11:37:21 UTC 2022 - Ben Greiner <code@bnavigator.de> + +- Update to v3.5.2 + * Packaging refresh. + * Enrolled with Tidelift. +- v3.5.1 + * Fixed DictStack.__len__ and addressed recursion error on PyPy + in __getitem__. +- v3.5.0 + * DictStack now supports the following Mapping behaviors: + - .items() + - casting to a dict + - __contains__ (i.e. "x in stack") + * Require Python 3.7 or later. +- v3.4.0: Add WeightedLookup. +- v3.3.0: Add FreezableDefaultDict. +- v3.2.0: Rely on PEP 420 for namespace package. + +------------------------------------------------------------------- Old: ---- jaraco.collections-3.0.0.tar.gz New: ---- jaraco.collections-3.5.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jaraco.collections.spec ++++++ --- /var/tmp/diff_new_pack.9TVVto/_old 2022-08-31 18:08:35.187311714 +0200 +++ /var/tmp/diff_new_pack.9TVVto/_new 2022-08-31 18:08:35.191311726 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-jaraco.collections # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,25 +19,24 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-jaraco.collections -Version: 3.0.0 +Version: 3.5.2 Release: 0 Summary: Tools to work with collections License: MIT Group: Development/Languages/Python URL: https://github.com/jaraco/jaraco.collections Source0: https://files.pythonhosted.org/packages/source/j/jaraco.collections/jaraco.collections-%{version}.tar.gz -BuildRequires: %{python_module jaraco.base >= 6.1} +BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module jaraco.classes} -BuildRequires: %{python_module jaraco.functools} BuildRequires: %{python_module jaraco.text} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module setuptools_scm} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module setuptools >= 56} +BuildRequires: %{python_module setuptools_scm >= 3.4.1} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-jaraco.base >= 6.1 Requires: python-jaraco.classes -Requires: python-jaraco.functools Requires: python-jaraco.text BuildArch: noarch %python_subpackages @@ -48,32 +47,32 @@ %prep %setup -q -n jaraco.collections-%{version} -sed -i 's/--flake8 --black --cov//' pytest.ini %build -%python_build +%pyproject_wheel %install -%python_install - -%python_expand rm %{buildroot}%{$python_sitelib}/jaraco/__init__.py - -%{?python_compileall} -%{!?python_compileall: # if we haven no python_compileall we are for sure still without multiple python3 flavors. -%py3_compile %{buildroot}%{python3_sitelib}/jaraco/ -%py3_compile -O %{buildroot}%{python3_sitelib}/jaraco/ -} - +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest +# work around for gh#pytest-dev/pytest#3396 until gh#pytest-dev/pytest#10088 lands in a pytest release +touch jaraco/__init__.py +cp -r %{python3_sitelib}/jaraco/* jaraco/ +%{python_expand # workaround for gh#jaraco/jaraco.text#10 without pathlib2 +if [ %{$python_version_nodots} -lt 310 ]; then + $python_donttest="or read_newlines or report_newlines" +fi +} +%pytest --doctest-modules -k "not (dummyprefix ${$python_donttest})" %files %{python_files} %license LICENSE %doc docs/*.rst README.rst CHANGES.rst -%{python_sitelib}/jaraco.collections-%{version}-py*.egg-info +%{python_sitelib}/jaraco.collections-%{version}*-info +%dir %{python_sitelib}/jaraco %{python_sitelib}/jaraco/collections.py* +%pycache_only %dir %{python_sitelib}/jaraco/__pycache__ %pycache_only %{python_sitelib}/jaraco/__pycache__/collections*.py* %changelog ++++++ jaraco.collections-3.0.0.tar.gz -> jaraco.collections-3.5.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.coveragerc new/jaraco.collections-3.5.2/.coveragerc --- old/jaraco.collections-3.0.0/.coveragerc 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/.coveragerc 2022-07-14 07:05:52.000000000 +0200 @@ -1,5 +1,8 @@ [run] -omit = .tox/* +omit = + # leading `*/` for pytest-dev/pytest-cov#456 + */.tox/* + */pep517-build-env-* [report] show_missing = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.editorconfig new/jaraco.collections-3.5.2/.editorconfig --- old/jaraco.collections-3.0.0/.editorconfig 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.collections-3.5.2/.editorconfig 2022-07-14 07:05:52.000000000 +0200 @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +insert_final_newline = true +end_of_line = lf + +[*.py] +indent_style = space +max_line_length = 88 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[*.rst] +indent_style = space diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.flake8 new/jaraco.collections-3.5.2/.flake8 --- old/jaraco.collections-3.0.0/.flake8 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/.flake8 2022-07-14 07:05:52.000000000 +0200 @@ -1,9 +1,9 @@ [flake8] max-line-length = 88 -ignore = - # W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513 - W503 - # W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545 - W504 + +# jaraco/skeleton#34 +max-complexity = 10 + +extend-ignore = # Black creates whitespace before colon E203 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.github/FUNDING.yml new/jaraco.collections-3.5.2/.github/FUNDING.yml --- old/jaraco.collections-3.0.0/.github/FUNDING.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.collections-3.5.2/.github/FUNDING.yml 2022-07-14 07:05:53.000000000 +0200 @@ -0,0 +1 @@ +tidelift: pypi/jaraco.collections diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.github/dependabot.yml new/jaraco.collections-3.5.2/.github/dependabot.yml --- old/jaraco.collections-3.0.0/.github/dependabot.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.collections-3.5.2/.github/dependabot.yml 2022-07-14 07:05:53.000000000 +0200 @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: "all" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.github/workflows/main.yml new/jaraco.collections-3.5.2/.github/workflows/main.yml --- old/jaraco.collections-3.0.0/.github/workflows/main.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.collections-3.5.2/.github/workflows/main.yml 2022-07-14 07:05:53.000000000 +0200 @@ -0,0 +1,65 @@ +name: tests + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + python: + # Build on pre-releases until stable, then stable releases. + # actions/setup-python#213 + - ~3.7.0-0 + - ~3.10.0-0 + - ~3.11.0-0 + platform: + - ubuntu-latest + - macos-latest + - windows-latest + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install tox + run: | + python -m pip install tox + - name: Run tests + run: tox + + check: # This job does nothing and is only used for the branch protection + if: always() + + needs: + - test + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} + + release: + needs: + - check + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install tox + run: | + python -m pip install tox + - name: Release + run: tox -e release + env: + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.pre-commit-config.yaml new/jaraco.collections-3.5.2/.pre-commit-config.yaml --- old/jaraco.collections-3.0.0/.pre-commit-config.yaml 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/.pre-commit-config.yaml 2022-07-14 07:05:53.000000000 +0200 @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 19.3b0 + rev: 22.6.0 hooks: - id: black diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.readthedocs.yml new/jaraco.collections-3.5.2/.readthedocs.yml --- old/jaraco.collections-3.0.0/.readthedocs.yml 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/.readthedocs.yml 2022-07-14 07:05:53.000000000 +0200 @@ -1,5 +1,6 @@ +version: 2 python: - version: 3 - extra_requirements: - - docs - pip_install: true + install: + - path: . + extra_requirements: + - docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/.travis.yml new/jaraco.collections-3.5.2/.travis.yml --- old/jaraco.collections-3.0.0/.travis.yml 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -dist: xenial -language: python - -python: -- 3.6 -- &latest_py3 3.8 - -jobs: - fast_finish: true - include: - - stage: deploy - if: tag IS present - python: *latest_py3 - before_script: skip - script: tox -e release - -cache: pip - -install: -- pip install tox tox-venv - -before_script: - # Disable IPv6. Ref travis-ci/travis-ci#8361 - - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then - sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; - fi -script: tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/CHANGES.rst new/jaraco.collections-3.5.2/CHANGES.rst --- old/jaraco.collections-3.0.0/CHANGES.rst 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/CHANGES.rst 2022-07-14 07:05:53.000000000 +0200 @@ -1,3 +1,47 @@ +v3.5.2 +====== + +Packaging refresh. + +Enrolled with Tidelift. + +v3.5.1 +====== + +Fixed ``DictStack.__len__`` and addressed recursion error on +PyPy in ``__getitem__``. + +v3.5.0 +====== + +``DictStack`` now supports the following Mapping behaviors: + + - ``.items()`` + - casting to a dict + - ``__contains__`` (i.e. "x in stack") + +Require Python 3.7 or later. + +v3.4.0 +====== + +Add ``WeightedLookup``. + +v3.3.0 +====== + +Add ``FreezableDefaultDict``. + +v3.2.0 +====== + +Rely on PEP 420 for namespace package. + +v3.1.0 +====== + +Refreshed packaging. Dropped dependency on six. + v3.0.0 ====== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/LICENSE new/jaraco.collections-3.5.2/LICENSE --- old/jaraco.collections-3.0.0/LICENSE 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/LICENSE 2022-07-14 07:05:53.000000000 +0200 @@ -1,7 +1,19 @@ Copyright Jason R. Coombs -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/PKG-INFO new/jaraco.collections-3.5.2/PKG-INFO --- old/jaraco.collections-3.0.0/PKG-INFO 2019-12-20 05:55:20.170997900 +0100 +++ new/jaraco.collections-3.5.2/PKG-INFO 2022-07-14 07:06:17.886474400 +0200 @@ -1,41 +1,79 @@ Metadata-Version: 2.1 Name: jaraco.collections -Version: 3.0.0 +Version: 3.5.2 Summary: Collection objects similar to those in stdlib by jaraco Home-page: https://github.com/jaraco/jaraco.collections Author: Jason R. Coombs Author-email: jaraco@jaraco.com -License: UNKNOWN -Description: .. image:: https://img.shields.io/pypi/v/jaraco.collections.svg - :target: https://pypi.io/project/jaraco.collections - - .. image:: https://img.shields.io/pypi/pyversions/jaraco.collections.svg - - .. image:: https://img.shields.io/travis/jaraco/jaraco.collections/master.svg - :target: https://travis-ci.org/jaraco/jaraco.collections - - .. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - :alt: Code style: Black - - .. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg - .. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master - - .. image:: https://readthedocs.org/projects/jaracocollections/badge/?version=latest - :target: https://jaracocollections.readthedocs.io/en/latest/?badge=latest - - Models and classes to supplement the stdlib 'collections' module. - - RangeMap - -------- - - A dictionary-like object that maps a range of values to a given value. - -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 -Requires-Python: >=3.6 +Classifier: Programming Language :: Python :: 3 :: Only +Requires-Python: >=3.7 Provides-Extra: testing Provides-Extra: docs +License-File: LICENSE + +.. image:: https://img.shields.io/pypi/v/jaraco.collections.svg + :target: `PyPI link`_ + +.. image:: https://img.shields.io/pypi/pyversions/jaraco.collections.svg + :target: `PyPI link`_ + +.. _PyPI link: https://pypi.org/project/jaraco.collections + +.. image:: https://github.com/jaraco/jaraco.collections/workflows/tests/badge.svg + :target: https://github.com/jaraco/jaraco.collections/actions?query=workflow%3A%22tes... + :alt: tests + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + :alt: Code style: Black + +.. image:: https://readthedocs.org/projects/jaracocollections/badge/?version=latest + :target: https://jaracocollections.readthedocs.io/en/latest/?badge=latest + +.. image:: https://img.shields.io/badge/skeleton-2022-informational + :target: https://blog.jaraco.com/skeleton + +.. image:: https://tidelift.com/badges/package/pypi/jaraco.collections + :target: https://tidelift.com/subscription/pkg/pypi-jaraco.collections?utm_source=pyp... + +Models and classes to supplement the stdlib 'collections' module. + +See the docs, linked above, for descriptions and usage examples. + +Highlights include: + +- RangeMap: A mapping that accepts a range of values for keys. +- Projection: A subset over an existing mapping. +- DictFilter: A different implementation of a projection. +- KeyTransformingDict: Generalized mapping with keys transformed by a function. +- FoldedCaseKeyedDict: A dict whose string keys are case-insensitive. +- BijectiveMap: A map where keys map to values and values back to their keys. +- ItemsAsAttributes: A mapping mix-in exposing items as attributes. +- IdentityOverrideMap: A map whose keys map by default to themselves unless overridden. +- FrozenDict: A hashable, immutable map. +- Enumeration: An object whose keys are enumerated. +- Everything: A container that contains all things. +- Least, Greatest: Objects that are always less than or greater than any other. +- pop_all: Return all items from the mutable sequence and remove them from that sequence. +- DictStack: A stack of dicts, great for sharing scopes. +- WeightedLookup: A specialized RangeMap for selecting an item by weights. + +For Enterprise +============== + +Available as part of the Tidelift Subscription. + +This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. + +`Learn more <https://tidelift.com/subscription/pkg/pypi-jaraco.collections?utm_source=pypi-jaraco.collections&utm_medium=referral&utm_campaign=github>`_. + +Security Contact +================ + +To report a security vulnerability, please use the +`Tidelift security contact <https://tidelift.com/security>`_. +Tidelift will coordinate the fix and disclosure. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/README.rst new/jaraco.collections-3.5.2/README.rst --- old/jaraco.collections-3.0.0/README.rst 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/README.rst 2022-07-14 07:05:53.000000000 +0200 @@ -1,24 +1,62 @@ .. image:: https://img.shields.io/pypi/v/jaraco.collections.svg - :target: https://pypi.io/project/jaraco.collections + :target: `PyPI link`_ .. image:: https://img.shields.io/pypi/pyversions/jaraco.collections.svg + :target: `PyPI link`_ -.. image:: https://img.shields.io/travis/jaraco/jaraco.collections/master.svg - :target: https://travis-ci.org/jaraco/jaraco.collections +.. _PyPI link: https://pypi.org/project/jaraco.collections + +.. image:: https://github.com/jaraco/jaraco.collections/workflows/tests/badge.svg + :target: https://github.com/jaraco/jaraco.collections/actions?query=workflow%3A%22tes... + :alt: tests .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Code style: Black -.. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg -.. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master - .. image:: https://readthedocs.org/projects/jaracocollections/badge/?version=latest :target: https://jaracocollections.readthedocs.io/en/latest/?badge=latest +.. image:: https://img.shields.io/badge/skeleton-2022-informational + :target: https://blog.jaraco.com/skeleton + +.. image:: https://tidelift.com/badges/package/pypi/jaraco.collections + :target: https://tidelift.com/subscription/pkg/pypi-jaraco.collections?utm_source=pyp... + Models and classes to supplement the stdlib 'collections' module. -RangeMap --------- +See the docs, linked above, for descriptions and usage examples. + +Highlights include: -A dictionary-like object that maps a range of values to a given value. +- RangeMap: A mapping that accepts a range of values for keys. +- Projection: A subset over an existing mapping. +- DictFilter: A different implementation of a projection. +- KeyTransformingDict: Generalized mapping with keys transformed by a function. +- FoldedCaseKeyedDict: A dict whose string keys are case-insensitive. +- BijectiveMap: A map where keys map to values and values back to their keys. +- ItemsAsAttributes: A mapping mix-in exposing items as attributes. +- IdentityOverrideMap: A map whose keys map by default to themselves unless overridden. +- FrozenDict: A hashable, immutable map. +- Enumeration: An object whose keys are enumerated. +- Everything: A container that contains all things. +- Least, Greatest: Objects that are always less than or greater than any other. +- pop_all: Return all items from the mutable sequence and remove them from that sequence. +- DictStack: A stack of dicts, great for sharing scopes. +- WeightedLookup: A specialized RangeMap for selecting an item by weights. + +For Enterprise +============== + +Available as part of the Tidelift Subscription. + +This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. + +`Learn more <https://tidelift.com/subscription/pkg/pypi-jaraco.collections?utm_source=pypi-jaraco.collections&utm_medium=referral&utm_campaign=github>`_. + +Security Contact +================ + +To report a security vulnerability, please use the +`Tidelift security contact <https://tidelift.com/security>`_. +Tidelift will coordinate the fix and disclosure. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/appveyor.yml new/jaraco.collections-3.5.2/appveyor.yml --- old/jaraco.collections-3.0.0/appveyor.yml 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/appveyor.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -environment: - - APPVEYOR: true - - matrix: - - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python38-x64" - -install: - # symlink python from a directory with a space - - "mklink /d \"C:\\Program Files\\Python\" %PYTHON%" - - "SET PYTHON=\"C:\\Program Files\\Python\"" - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - -build: off - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -test_script: - - "python -m pip install -U tox tox-venv virtualenv" - - "tox" - -version: '{build}' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/docs/conf.py new/jaraco.collections-3.5.2/docs/conf.py --- old/jaraco.collections-3.0.0/docs/conf.py 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/docs/conf.py 2022-07-14 07:05:53.000000000 +0200 @@ -14,13 +14,25 @@ url='{package_url}/issues/{issue}', ), dict( - pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n', + pattern=r'(?m:^((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n)', with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', ), dict( pattern=r'PEP[- ](?P<pep_number>\d+)', - url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', + url='https://peps.python.org/pep-{pep_number:0>4}/', ), ], ) } + +# Be strict about any broken references: +nitpicky = True + +# Include Python intersphinx mapping to prevent failures +# jaraco/skeleton#51 +extensions += ['sphinx.ext.intersphinx'] +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), +} + +extensions += ['jaraco.tidelift'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/docs/index.rst new/jaraco.collections-3.5.2/docs/index.rst --- old/jaraco.collections-3.0.0/docs/index.rst 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/docs/index.rst 2022-07-14 07:05:53.000000000 +0200 @@ -1,5 +1,5 @@ -Welcome to jaraco.collections documentation! -============================================ +Welcome to |project| documentation! +=================================== .. toctree:: :maxdepth: 1 @@ -7,6 +7,8 @@ history +.. tidelift-referral-banner:: + .. automodule:: jaraco.collections :members: :undoc-members: @@ -19,4 +21,3 @@ * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/jaraco/__init__.py new/jaraco.collections-3.5.2/jaraco/__init__.py --- old/jaraco.collections-3.0.0/jaraco/__init__.py 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/jaraco/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/jaraco/collections.py new/jaraco.collections-3.5.2/jaraco/collections.py --- old/jaraco.collections-3.0.0/jaraco/collections.py 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/jaraco/collections.py 2022-07-14 07:05:53.000000000 +0200 @@ -4,6 +4,7 @@ import itertools import copy import functools +import random from jaraco.classes.properties import NonDataProperty import jaraco.text @@ -515,7 +516,7 @@ return result # raise the original exception, but use the original class # name, not 'super'. - message, = e.args + (message,) = e.args message = message.replace('super', self.__class__.__name__, 1) e.args = (message,) raise @@ -572,12 +573,16 @@ 2 >>> stack['c'] 2 + >>> len(stack) + 3 >>> stack.push(dict(a=3)) >>> stack['a'] 3 >>> set(stack.keys()) == set(['a', 'b', 'c']) True - >>> dict(**stack) == dict(a=3, c=2, b=2) + >>> set(stack.items()) == set([('a', 3), ('b', 2), ('c', 2)]) + True + >>> dict(**stack) == dict(stack) == dict(a=3, c=2, b=2) True >>> d = stack.pop() >>> stack['a'] @@ -586,19 +591,28 @@ >>> stack['a'] 1 >>> stack.get('b', None) + >>> 'c' in stack + True """ - def keys(self): - return list(set(itertools.chain.from_iterable(c.keys() for c in self))) + def __iter__(self): + dicts = list.__iter__(self) + return iter(set(itertools.chain.from_iterable(c.keys() for c in dicts))) def __getitem__(self, key): - for scope in reversed(self): + for scope in reversed(tuple(list.__iter__(self))): if key in scope: return scope[key] raise KeyError(key) push = list.append + def __contains__(self, other): + return collections.abc.Mapping.__contains__(self, other) + + def __len__(self): + return len(list(iter(self))) + class BijectiveMap(dict): """ @@ -860,7 +874,7 @@ return True -class InstrumentedDict(collections.UserDict): +class InstrumentedDict(collections.UserDict): # type: ignore # buggy mypy """ Instrument an existing dictionary with additional functionality, but always reference and mutate @@ -961,3 +975,82 @@ """ result, items[:] = items[:], [] return result + + +# mypy disabled for pytest-dev/pytest#8332 +class FreezableDefaultDict(collections.defaultdict): # type: ignore + """ + Often it is desirable to prevent the mutation of + a default dict after its initial construction, such + as to prevent mutation during iteration. + + >>> dd = FreezableDefaultDict(list) + >>> dd[0].append('1') + >>> dd.freeze() + >>> dd[1] + [] + >>> len(dd) + 1 + """ + + def __missing__(self, key): + return getattr(self, '_frozen', super().__missing__)(key) + + def freeze(self): + self._frozen = lambda key: self.default_factory() + + +class Accumulator: + def __init__(self, initial=0): + self.val = initial + + def __call__(self, val): + self.val += val + return self.val + + +class WeightedLookup(RangeMap): + """ + Given parameters suitable for a dict representing keys + and a weighted proportion, return a RangeMap representing + spans of values proportial to the weights: + + >>> even = WeightedLookup(a=1, b=1) + + [0, 1) -> a + [1, 2) -> b + + >>> lk = WeightedLookup(a=1, b=2) + + [0, 1) -> a + [1, 3) -> b + + >>> lk[.5] + 'a' + >>> lk[1.5] + 'b' + + Adds ``.random()`` to select a random weighted value: + + >>> lk.random() in ['a', 'b'] + True + + >>> choices = [lk.random() for x in range(1000)] + + Statistically speaking, choices should be .5 a:b + >>> ratio = choices.count('a') / choices.count('b') + >>> .4 < ratio < .6 + True + """ + + def __init__(self, *args, **kwargs): + raw = dict(*args, **kwargs) + + # allocate keys by weight + indexes = map(Accumulator(), raw.values()) + super().__init__(zip(indexes, raw.keys()), key_match_comparator=operator.lt) + + def random(self): + lower, upper = self.bounds() + selector = random.random() * upper + return self[selector] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/jaraco.collections.egg-info/PKG-INFO new/jaraco.collections-3.5.2/jaraco.collections.egg-info/PKG-INFO --- old/jaraco.collections-3.0.0/jaraco.collections.egg-info/PKG-INFO 2019-12-20 05:55:19.000000000 +0100 +++ new/jaraco.collections-3.5.2/jaraco.collections.egg-info/PKG-INFO 2022-07-14 07:06:17.000000000 +0200 @@ -1,41 +1,79 @@ Metadata-Version: 2.1 Name: jaraco.collections -Version: 3.0.0 +Version: 3.5.2 Summary: Collection objects similar to those in stdlib by jaraco Home-page: https://github.com/jaraco/jaraco.collections Author: Jason R. Coombs Author-email: jaraco@jaraco.com -License: UNKNOWN -Description: .. image:: https://img.shields.io/pypi/v/jaraco.collections.svg - :target: https://pypi.io/project/jaraco.collections - - .. image:: https://img.shields.io/pypi/pyversions/jaraco.collections.svg - - .. image:: https://img.shields.io/travis/jaraco/jaraco.collections/master.svg - :target: https://travis-ci.org/jaraco/jaraco.collections - - .. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - :alt: Code style: Black - - .. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg - .. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master - - .. image:: https://readthedocs.org/projects/jaracocollections/badge/?version=latest - :target: https://jaracocollections.readthedocs.io/en/latest/?badge=latest - - Models and classes to supplement the stdlib 'collections' module. - - RangeMap - -------- - - A dictionary-like object that maps a range of values to a given value. - -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 -Requires-Python: >=3.6 +Classifier: Programming Language :: Python :: 3 :: Only +Requires-Python: >=3.7 Provides-Extra: testing Provides-Extra: docs +License-File: LICENSE + +.. image:: https://img.shields.io/pypi/v/jaraco.collections.svg + :target: `PyPI link`_ + +.. image:: https://img.shields.io/pypi/pyversions/jaraco.collections.svg + :target: `PyPI link`_ + +.. _PyPI link: https://pypi.org/project/jaraco.collections + +.. image:: https://github.com/jaraco/jaraco.collections/workflows/tests/badge.svg + :target: https://github.com/jaraco/jaraco.collections/actions?query=workflow%3A%22tes... + :alt: tests + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + :alt: Code style: Black + +.. image:: https://readthedocs.org/projects/jaracocollections/badge/?version=latest + :target: https://jaracocollections.readthedocs.io/en/latest/?badge=latest + +.. image:: https://img.shields.io/badge/skeleton-2022-informational + :target: https://blog.jaraco.com/skeleton + +.. image:: https://tidelift.com/badges/package/pypi/jaraco.collections + :target: https://tidelift.com/subscription/pkg/pypi-jaraco.collections?utm_source=pyp... + +Models and classes to supplement the stdlib 'collections' module. + +See the docs, linked above, for descriptions and usage examples. + +Highlights include: + +- RangeMap: A mapping that accepts a range of values for keys. +- Projection: A subset over an existing mapping. +- DictFilter: A different implementation of a projection. +- KeyTransformingDict: Generalized mapping with keys transformed by a function. +- FoldedCaseKeyedDict: A dict whose string keys are case-insensitive. +- BijectiveMap: A map where keys map to values and values back to their keys. +- ItemsAsAttributes: A mapping mix-in exposing items as attributes. +- IdentityOverrideMap: A map whose keys map by default to themselves unless overridden. +- FrozenDict: A hashable, immutable map. +- Enumeration: An object whose keys are enumerated. +- Everything: A container that contains all things. +- Least, Greatest: Objects that are always less than or greater than any other. +- pop_all: Return all items from the mutable sequence and remove them from that sequence. +- DictStack: A stack of dicts, great for sharing scopes. +- WeightedLookup: A specialized RangeMap for selecting an item by weights. + +For Enterprise +============== + +Available as part of the Tidelift Subscription. + +This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. + +`Learn more <https://tidelift.com/subscription/pkg/pypi-jaraco.collections?utm_source=pypi-jaraco.collections&utm_medium=referral&utm_campaign=github>`_. + +Security Contact +================ + +To report a security vulnerability, please use the +`Tidelift security contact <https://tidelift.com/security>`_. +Tidelift will coordinate the fix and disclosure. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/jaraco.collections.egg-info/SOURCES.txt new/jaraco.collections-3.5.2/jaraco.collections.egg-info/SOURCES.txt --- old/jaraco.collections-3.0.0/jaraco.collections.egg-info/SOURCES.txt 2019-12-20 05:55:20.000000000 +0100 +++ new/jaraco.collections-3.5.2/jaraco.collections.egg-info/SOURCES.txt 2022-07-14 07:06:17.000000000 +0200 @@ -1,22 +1,22 @@ .coveragerc +.editorconfig .flake8 .pre-commit-config.yaml .readthedocs.yml -.travis.yml CHANGES.rst LICENSE README.rst -appveyor.yml +mypy.ini pyproject.toml pytest.ini setup.cfg -setup.py -skeleton.md tox.ini +.github/FUNDING.yml +.github/dependabot.yml +.github/workflows/main.yml docs/conf.py docs/history.rst docs/index.rst -jaraco/__init__.py jaraco/collections.py jaraco.collections.egg-info/PKG-INFO jaraco.collections.egg-info/SOURCES.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/jaraco.collections.egg-info/requires.txt new/jaraco.collections-3.5.2/jaraco.collections.egg-info/requires.txt --- old/jaraco.collections-3.0.0/jaraco.collections.egg-info/requires.txt 2019-12-20 05:55:19.000000000 +0100 +++ new/jaraco.collections-3.5.2/jaraco.collections.egg-info/requires.txt 2022-07-14 07:06:17.000000000 +0200 @@ -1,15 +1,19 @@ jaraco.text jaraco.classes -six>=1.7.0 [docs] sphinx -jaraco.packaging>=3.2 +jaraco.packaging>=9 rst.linker>=1.9 +jaraco.tidelift>=1.4 [testing] -pytest!=3.7.3,>=3.5 -pytest-checkdocs>=1.2.3 +pytest>=6 +pytest-checkdocs>=2.4 pytest-flake8 -pytest-black-multipy pytest-cov +pytest-enabler>=1.3 + +[testing:platform_python_implementation != "PyPy"] +pytest-black>=0.3.7 +pytest-mypy>=0.9.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/mypy.ini new/jaraco.collections-3.5.2/mypy.ini --- old/jaraco.collections-3.0.0/mypy.ini 1970-01-01 01:00:00.000000000 +0100 +++ new/jaraco.collections-3.5.2/mypy.ini 2022-07-14 07:05:53.000000000 +0200 @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/pyproject.toml new/jaraco.collections-3.5.2/pyproject.toml --- old/jaraco.collections-3.0.0/pyproject.toml 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/pyproject.toml 2022-07-14 07:05:53.000000000 +0200 @@ -1,6 +1,20 @@ [build-system] -requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] +requires = ["setuptools>=56", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [tool.black] skip-string-normalization = true + +[tool.setuptools_scm] + +[tool.pytest-enabler.black] +addopts = "--black" + +[tool.pytest-enabler.mypy] +addopts = "--mypy" + +[tool.pytest-enabler.flake8] +addopts = "--flake8" + +[tool.pytest-enabler.cov] +addopts = "--cov" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/pytest.ini new/jaraco.collections-3.5.2/pytest.ini --- old/jaraco.collections-3.0.0/pytest.ini 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/pytest.ini 2022-07-14 07:05:53.000000000 +0200 @@ -1,5 +1,18 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules --flake8 --black --cov +# doctests disabled due to pytest-dev/pytest#3396 +# addopts=--doctest-modules doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= + # Suppress deprecation warning in flake8 + ignore:SelectableGroups dict interface is deprecated::flake8 + + # shopkeep/pytest-black#55 + ignore:<class 'pytest_black.BlackItem'> is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to BlackItem is deprecated.:pytest.PytestDeprecationWarning + ignore:BlackItem is an Item subclass and should not be a collector:pytest.PytestWarning + + # tholo/pytest-flake8#83 + ignore:<class 'pytest_flake8.Flake8Item'> is not using a cooperative constructor:pytest.PytestDeprecationWarning + ignore:The \(fspath. py.path.local\) argument to Flake8Item is deprecated.:pytest.PytestDeprecationWarning + ignore:Flake8Item is an Item subclass and should not be a collector:pytest.PytestWarning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/setup.cfg new/jaraco.collections-3.5.2/setup.cfg --- old/jaraco.collections-3.0.0/setup.cfg 2019-12-20 05:55:20.170997900 +0100 +++ new/jaraco.collections-3.5.2/setup.cfg 2022-07-14 07:06:17.886474400 +0200 @@ -1,8 +1,4 @@ -[bdist_wheel] -universal = 1 - [metadata] -license_file = LICENSE name = jaraco.collections author = Jason R. Coombs author_email = jaraco@jaraco.com @@ -14,28 +10,39 @@ Intended Audience :: Developers License :: OSI Approved :: MIT License Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only [options] -packages = find: +packages = find_namespace: include_package_data = true -python_requires = >=3.6 +python_requires = >=3.7 install_requires = jaraco.text jaraco.classes - six>=1.7.0 -setup_requires = setuptools_scm >= 1.15.0 + +[options.packages.find] +exclude = + build* + dist* + docs* + tests* [options.extras_require] testing = - pytest >= 3.5, !=3.7.3 - pytest-checkdocs >= 1.2.3 + pytest >= 6 + pytest-checkdocs >= 2.4 pytest-flake8 - pytest-black-multipy + pytest-black >= 0.3.7; \ + python_implementation != "PyPy" pytest-cov + pytest-mypy >= 0.9.1; \ + python_implementation != "PyPy" + pytest-enabler >= 1.3 docs = sphinx - jaraco.packaging >= 3.2 + jaraco.packaging >= 9 rst.linker >= 1.9 + jaraco.tidelift >= 1.4 [options.entry_points] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/setup.py new/jaraco.collections-3.5.2/setup.py --- old/jaraco.collections-3.0.0/setup.py 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import setuptools - -if __name__ == "__main__": - setuptools.setup(use_scm_version=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/skeleton.md new/jaraco.collections-3.5.2/skeleton.md --- old/jaraco.collections-3.0.0/skeleton.md 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/skeleton.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,137 +0,0 @@ -# Overview - -This project is merged with [skeleton](https://github.com/jaraco/skeleton). What is skeleton? It's the scaffolding of a Python project jaraco [introduced in his blog](https://blog.jaraco.com/a-project-skeleton-for-python-projects/). It seeks to provide a means to re-use techniques and inherit advances when managing projects for distribution. - -## An SCM Managed Approach - -While maintaining dozens of projects in PyPI, jaraco derives best practices for project distribution and publishes them in the [skeleton repo](https://github.com/jaraco/skeleton), a git repo capturing the evolution and culmination of these best practices. - -It's intended to be used by a new or existing project to adopt these practices and honed and proven techniques. Adopters are encouraged to use the project directly and maintain a small deviation from the technique, make their own fork for more substantial changes unique to their environment or preferences, or simply adopt the skeleton once and abandon it thereafter. - -The primary advantage to using an SCM for maintaining these techniques is that those tools help facilitate the merge between the template and its adopting projects. - -Another advantage to using an SCM-managed approach is that tools like GitHub recognize that a change in the skeleton is the _same change_ across all projects that merge with that skeleton. Without the ancestry, with a traditional copy/paste approach, a [commit like this](https://github.com/jaraco/skeleton/commit/12eed1326e1bc26ce256e7b3f8cd8d3a5b...) would produce notifications in the upstream project issue for each and every application, but because it's centralized, GitHub provides just the one notification when the change is added to the skeleton. - -# Usage - -## new projects - -To use skeleton for a new project, simply pull the skeleton into a new project: - -``` -$ git init my-new-project -$ cd my-new-project -$ git pull gh://jaraco/skeleton -``` - -Now customize the project to suit your individual project needs. - -## existing projects - -If you have an existing project, you can still incorporate the skeleton by merging it into the codebase. - -``` -$ git merge skeleton --allow-unrelated-histories -``` - -The `--allow-unrelated-histories` is necessary because the history from the skeleton was previously unrelated to the existing codebase. Resolve any merge conflicts and commit to the master, and now the project is based on the shared skeleton. - -## Updating - -Whenever a change is needed or desired for the general technique for packaging, it can be made in the skeleton project and then merged into each of the derived projects as needed, recommended before each release. As a result, features and best practices for packaging are centrally maintained and readily trickle into a whole suite of packages. This technique lowers the amount of tedious work necessary to create or maintain a project, and coupled with other techniques like continuous integration and deployment, lowers the cost of creating and maintaining refined Python projects to just a few, familiar git operations. - -Thereafter, the target project can make whatever customizations it deems relevant to the scaffolding. The project may even at some point decide that the divergence is too great to merit renewed merging with the original skeleton. This approach applies maximal guidance while creating minimal constraints. - -# Features - -The features/techniques employed by the skeleton include: - -- PEP 517/518 based build relying on setuptools as the build tool -- setuptools declarative configuration using setup.cfg -- tox for running tests -- A README.rst as reStructuredText with some popular badges, but with readthedocs and appveyor badges commented out -- A CHANGES.rst file intended for publishing release notes about the project -- Use of [black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier) - -## Packaging Conventions - -A pyproject.toml is included to enable PEP 517 and PEP 518 compatibility and declares the requirements necessary to build the project on setuptools (a minimum version compatible with setup.cfg declarative config). - -The setup.cfg file implements the following features: - -- Assumes universal wheel for release -- Advertises the project's LICENSE file (MIT by default) -- Reads the README.rst file into the long description -- Some common Trove classifiers -- Includes all packages discovered in the repo -- Data files in the package are also included (not just Python files) -- Declares the required Python versions -- Declares install requirements (empty by default) -- Declares setup requirements for legacy environments -- Supplies two 'extras': - - testing: requirements for running tests - - docs: requirements for building docs - - these extras split the declaration into "upstream" (requirements as declared by the skeleton) and "local" (those specific to the local project); these markers help avoid merge conflicts -- Placeholder for defining entry points - -Additionally, the setup.py file declares `use_scm_version` which relies on [setuptools_scm](https://pypi.org/project/setuptools_scm) to do two things: - -- derive the project version from SCM tags -- ensure that all files committed to the repo are automatically included in releases - -## Running Tests - -The skeleton assumes the developer has [tox](https://pypi.org/project/tox) installed. The developer is expected to run `tox` to run tests on the current Python version using [pytest](https://pypi.org/project/pytest). - -Other environments (invoked with `tox -e {name}`) supplied include: - - - a `docs` environment to build the documentation - - a `release` environment to publish the package to PyPI - -A pytest.ini is included to define common options around running tests. In particular: - -- rely on default test discovery in the current directory -- avoid recursing into common directories not containing tests -- run doctests on modules and invoke flake8 tests -- in doctests, allow unicode literals and regular literals to match, allowing for doctests to run on Python 2 and 3. Also enable ELLIPSES, a default that would be undone by supplying the prior option. -- filters out known warnings caused by libraries/functionality included by the skeleton - -Relies a .flake8 file to correct some default behaviors: - -- disable mutually incompatible rules W503 and W504 -- support for black format - -## Continuous Integration - -The project is pre-configured to run tests in [Travis-CI](https://travis-ci.org) (.travis.yml). Any new project must be enabled either through their web site or with the `travis enable` command. - -Features include: -- test against Python 2 and 3 -- run on Ubuntu Xenial -- correct for broken IPv6 - -Also provided is a minimal template for running under Appveyor (Windows). - -### Continuous Deployments - -In addition to running tests, an additional deploy stage is configured to automatically release tagged commits to PyPI using [API tokens](https://pypi.org/help/#apitoken). The release process expects an authorized token to be configured with Travis as the TWINE_PASSWORD environment variable. After the Travis project is created, configure the token through the web UI or with a command like the following (bash syntax): - -``` -TWINE_PASSWORD={token} travis env copy TWINE_PASSWORD -``` - -## Building Documentation - -Documentation is automatically built by [Read the Docs](https://readthedocs.org) when the project is registered with it, by way of the .readthedocs.yml file. To test the docs build manually, a tox env may be invoked as `tox -e docs`. Both techniques rely on the dependencies declared in `setup.cfg/options.extras_require.docs`. - -In addition to building the sphinx docs scaffolded in `docs/`, the docs build a `history.html` file that first injects release dates and hyperlinks into the CHANGES.rst before incorporating it as history in the docs. - -## Cutting releases - -By default, tagged commits are released through the continuous integration deploy stage. - -Releases may also be cut manually by invoking the tox environment `release` with the PyPI token set as the TWINE_PASSWORD: - -``` -TWINE_PASSWORD={token} tox -e release -``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/tests/test_collections.py new/jaraco.collections-3.5.2/tests/test_collections.py --- old/jaraco.collections-3.0.0/tests/test_collections.py 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/tests/test_collections.py 2022-07-14 07:05:53.000000000 +0200 @@ -1,5 +1,3 @@ -import six - from jaraco import collections @@ -11,7 +9,7 @@ @staticmethod def transform_key(key): - return six.text_type(key) + return str(key) def test_always_lower_keys_dict(): @@ -23,7 +21,7 @@ d['Lasting'] = 'fleeting' d[3] = 'three' d[{'a': 1}] = 'a is one' - assert all(isinstance(key, six.text_type) for key in d) + assert all(isinstance(key, str) for key in d) assert "{'a': 1}" in d assert 3 in d assert d[3] == d['3'] == 'three' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jaraco.collections-3.0.0/tox.ini new/jaraco.collections-3.5.2/tox.ini --- old/jaraco.collections-3.0.0/tox.ini 2019-12-20 05:54:59.000000000 +0100 +++ new/jaraco.collections-3.5.2/tox.ini 2022-07-14 07:05:53.000000000 +0200 @@ -3,16 +3,11 @@ minversion = 3.2 # https://github.com/jaraco/skeleton/issues/6 tox_pip_extensions_ext_venv_update = true -# Ensure that a late version of pip is used even on tox-venv. -requires = - tox-pip-version>=0.0.6 - tox-venv +toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] deps = - setuptools>=31.0.1 -pip_version = pip commands = pytest {posargs} usedevelop = True @@ -24,19 +19,21 @@ testing changedir = docs commands = - python -m sphinx . {toxinidir}/build/html + python -m sphinx -W --keep-going . {toxinidir}/build/html [testenv:release] skip_install = True deps = - pep517>=0.5 - twine[keyring]>=1.13 - path + build + twine>=3 + jaraco.develop>=7.1 passenv = TWINE_PASSWORD + GITHUB_TOKEN setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = - python -c "import path; path.Path('dist').rmtree_p()" - python -m pep517.build . + python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)" + python -m build python -m twine upload dist/* + python -m jaraco.develop.create-github-release