diff options
| author | robot-piglet <[email protected]> | 2025-08-03 17:48:54 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-08-03 17:59:24 +0300 |
| commit | 3d2d7685dbfaeaa4f585c77ac2dea19b21fd4788 (patch) | |
| tree | 8542d7260f2a03dc45ae0833fefa5b2dd36c44c3 /contrib/python/frozenlist | |
| parent | fbc744caa544b0163ae53946312c14bab31a6f84 (diff) | |
Intermediate changes
commit_hash:581ca42ccdb6f5f25ad7962e0ffc8eaadc278125
Diffstat (limited to 'contrib/python/frozenlist')
| -rw-r--r-- | contrib/python/frozenlist/.dist-info/METADATA | 98 | ||||
| -rw-r--r-- | contrib/python/frozenlist/README.rst | 11 | ||||
| -rw-r--r-- | contrib/python/frozenlist/frozenlist/__init__.py | 16 | ||||
| -rw-r--r-- | contrib/python/frozenlist/frozenlist/_frozenlist.pyx | 31 | ||||
| -rw-r--r-- | contrib/python/frozenlist/ya.make | 2 |
5 files changed, 105 insertions, 53 deletions
diff --git a/contrib/python/frozenlist/.dist-info/METADATA b/contrib/python/frozenlist/.dist-info/METADATA index 5b96937af16..1bfacffc096 100644 --- a/contrib/python/frozenlist/.dist-info/METADATA +++ b/contrib/python/frozenlist/.dist-info/METADATA @@ -1,11 +1,11 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: frozenlist -Version: 1.5.0 +Version: 1.6.0 Summary: A list-like structure which implements collections.abc.MutableSequence Home-page: https://github.com/aio-libs/frozenlist Maintainer: aiohttp team <[email protected]> Maintainer-email: [email protected] -License: Apache 2 +License: Apache-2.0 Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org Project-URL: CI: Github Actions, https://github.com/aio-libs/frozenlist/actions @@ -17,14 +17,12 @@ Project-URL: GitHub: issues, https://github.com/aio-libs/frozenlist/issues Project-URL: GitHub: repo, https://github.com/aio-libs/frozenlist Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Cython Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 @@ -32,9 +30,10 @@ Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: >=3.8 +Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENSE +Dynamic: license-file frozenlist ========== @@ -43,8 +42,8 @@ frozenlist :target: https://github.com/aio-libs/frozenlist/actions :alt: GitHub status for master branch -.. image:: https://codecov.io/gh/aio-libs/frozenlist/branch/master/graph/badge.svg - :target: https://codecov.io/gh/aio-libs/frozenlist +.. image:: https://codecov.io/gh/aio-libs/frozenlist/branch/master/graph/badge.svg?flag=pytest + :target: https://codecov.io/gh/aio-libs/frozenlist?flags[]=pytest :alt: codecov.io status for master branch .. image:: https://img.shields.io/pypi/v/frozenlist.svg?logo=Python&logoColor=white @@ -117,8 +116,6 @@ Installation $ pip install frozenlist -The library requires Python 3.8 or newer. - Documentation ------------- @@ -132,11 +129,6 @@ We have a *Matrix Space* `#aio-libs-space:matrix.org <https://matrix.to/#/%23aio-libs-space:matrix.org>`_ which is also accessible via Gitter. -Requirements ------------- - -- Python >= 3.8 - License ------- @@ -169,6 +161,82 @@ Changelog .. towncrier release notes start +v1.6.0 +====== + +*(2025-04-17)* + + +Bug fixes +--------- + +- Stopped implicitly allowing the use of Cython pre-release versions when + building the distribution package -- by `@ajsanchezsanz <https://github.com/sponsors/ajsanchezsanz>`__ and + `@markgreene74 <https://github.com/sponsors/markgreene74>`__. + + *Related commits on GitHub:* + `41591f2 <https://github.com/aio-libs/frozenlist/commit/41591f2>`__. + + +Features +-------- + +- Implemented support for the free-threaded build of CPython 3.13 -- by `@lysnikolaou <https://github.com/sponsors/lysnikolaou>`__. + + *Related issues and pull requests on GitHub:* + `#618 <https://github.com/aio-libs/frozenlist/issues/618>`__. + +- Started building armv7l wheels -- by `@bdraco <https://github.com/sponsors/bdraco>`__. + + *Related issues and pull requests on GitHub:* + `#642 <https://github.com/aio-libs/frozenlist/issues/642>`__. + + +Packaging updates and notes for downstreams +------------------------------------------- + +- Stopped implicitly allowing the use of Cython pre-release versions when + building the distribution package -- by `@ajsanchezsanz <https://github.com/sponsors/ajsanchezsanz>`__ and + `@markgreene74 <https://github.com/sponsors/markgreene74>`__. + + *Related commits on GitHub:* + `41591f2 <https://github.com/aio-libs/frozenlist/commit/41591f2>`__. + +- Started building wheels for the free-threaded build of CPython 3.13 -- by `@lysnikolaou <https://github.com/sponsors/lysnikolaou>`__. + + *Related issues and pull requests on GitHub:* + `#618 <https://github.com/aio-libs/frozenlist/issues/618>`__. + +- The packaging metadata switched to including an SPDX license identifier introduced in `PEP 639 <https://peps.python.org/pep-639>`__ -- by `@cdce8p <https://github.com/sponsors/cdce8p>`__. + + *Related issues and pull requests on GitHub:* + `#639 <https://github.com/aio-libs/frozenlist/issues/639>`__. + + +Contributor-facing changes +-------------------------- + +- GitHub Actions CI/CD is now configured to manage caching pip-ecosystem + dependencies using `re-actors/cache-python-deps`_ -- an action by + `@webknjaz <https://github.com/sponsors/webknjaz>`__ that takes into account ABI stability and the exact + version of Python runtime. + + .. _`re-actors/cache-python-deps`: + https://github.com/marketplace/actions/cache-python-deps + + *Related issues and pull requests on GitHub:* + `#633 <https://github.com/aio-libs/frozenlist/issues/633>`__. + +- Organized dependencies into test and lint dependencies so that no + unnecessary ones are installed during CI runs -- by `@lysnikolaou <https://github.com/sponsors/lysnikolaou>`__. + + *Related issues and pull requests on GitHub:* + `#636 <https://github.com/aio-libs/frozenlist/issues/636>`__. + + +---- + + 1.5.0 (2024-10-22) ================== diff --git a/contrib/python/frozenlist/README.rst b/contrib/python/frozenlist/README.rst index e325c854732..14eb368bd8b 100644 --- a/contrib/python/frozenlist/README.rst +++ b/contrib/python/frozenlist/README.rst @@ -5,8 +5,8 @@ frozenlist :target: https://github.com/aio-libs/frozenlist/actions :alt: GitHub status for master branch -.. image:: https://codecov.io/gh/aio-libs/frozenlist/branch/master/graph/badge.svg - :target: https://codecov.io/gh/aio-libs/frozenlist +.. image:: https://codecov.io/gh/aio-libs/frozenlist/branch/master/graph/badge.svg?flag=pytest + :target: https://codecov.io/gh/aio-libs/frozenlist?flags[]=pytest :alt: codecov.io status for master branch .. image:: https://img.shields.io/pypi/v/frozenlist.svg?logo=Python&logoColor=white @@ -79,8 +79,6 @@ Installation $ pip install frozenlist -The library requires Python 3.8 or newer. - Documentation ------------- @@ -94,11 +92,6 @@ We have a *Matrix Space* `#aio-libs-space:matrix.org <https://matrix.to/#/%23aio-libs-space:matrix.org>`_ which is also accessible via Gitter. -Requirements ------------- - -- Python >= 3.8 - License ------- diff --git a/contrib/python/frozenlist/frozenlist/__init__.py b/contrib/python/frozenlist/frozenlist/__init__.py index 4022db505cf..97ed28fd5e6 100644 --- a/contrib/python/frozenlist/frozenlist/__init__.py +++ b/contrib/python/frozenlist/frozenlist/__init__.py @@ -1,11 +1,9 @@ import os -import sys import types from collections.abc import MutableSequence from functools import total_ordering -from typing import Any, Type -__version__ = "1.5.0" +__version__ = "1.6.0" __all__ = ("FrozenList", "PyFrozenList") # type: Tuple[str, ...] @@ -16,17 +14,7 @@ NO_EXTENSIONS = bool(os.environ.get("FROZENLIST_NO_EXTENSIONS")) # type: bool @total_ordering class FrozenList(MutableSequence): __slots__ = ("_frozen", "_items") - - if sys.version_info >= (3, 9): - __class_getitem__ = classmethod(types.GenericAlias) - else: - - @classmethod - def __class_getitem__( - cls: Type["FrozenList"], - cls_item: Any, - ) -> Type["FrozenList"]: - return cls + __class_getitem__ = classmethod(types.GenericAlias) def __init__(self, items=None): self._frozen = False diff --git a/contrib/python/frozenlist/frozenlist/_frozenlist.pyx b/contrib/python/frozenlist/frozenlist/_frozenlist.pyx index 45d11de1326..39561b75635 100644 --- a/contrib/python/frozenlist/frozenlist/_frozenlist.pyx +++ b/contrib/python/frozenlist/frozenlist/_frozenlist.pyx @@ -1,37 +1,40 @@ -import sys +# cython: freethreading_compatible = True +# distutils: language = c++ + +from cpython.bool import PyBool_FromLong +from libcpp.atomic cimport atomic + import types from collections.abc import MutableSequence cdef class FrozenList: + __class_getitem__ = classmethod(types.GenericAlias) - if sys.version_info >= (3, 9): - __class_getitem__ = classmethod(types.GenericAlias) - else: - @classmethod - def __class_getitem__(cls, cls_item): - return cls - - cdef readonly bint frozen + cdef atomic[bint] _frozen cdef list _items def __init__(self, items=None): - self.frozen = False + self._frozen.store(False) if items is not None: items = list(items) else: items = [] self._items = items + @property + def frozen(self): + return PyBool_FromLong(self._frozen.load()) + cdef object _check_frozen(self): - if self.frozen: + if self._frozen.load(): raise RuntimeError("Cannot modify frozen list.") cdef inline object _fast_len(self): return len(self._items) def freeze(self): - self.frozen = True + self._frozen.store(True) def __getitem__(self, index): return self._items[index] @@ -110,11 +113,11 @@ cdef class FrozenList: return self._items.count(item) def __repr__(self): - return '<FrozenList(frozen={}, {!r})>'.format(self.frozen, + return '<FrozenList(frozen={}, {!r})>'.format(self._frozen.load(), self._items) def __hash__(self): - if self.frozen: + if self._frozen.load(): return hash(tuple(self._items)) else: raise RuntimeError("Cannot hash unfrozen list.") diff --git a/contrib/python/frozenlist/ya.make b/contrib/python/frozenlist/ya.make index b065ef3ee44..adc7b384a5f 100644 --- a/contrib/python/frozenlist/ya.make +++ b/contrib/python/frozenlist/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(1.5.0) +VERSION(1.6.0) LICENSE(Apache-2.0) |
