Giter Club home page Giter Club logo

frozenlist's Introduction

frozenlist

GitHub status for master branch codecov.io status for master branch frozenlist @ PyPI Read The Docs build status badge Matrix Room — #aio-libs:matrix.org Matrix Space — #aio-libs-space:matrix.org

Introduction

frozenlist.FrozenList is a list-like structure which implements collections.abc.MutableSequence. The list is mutable until FrozenList.freeze is called, after which list modifications raise RuntimeError:

>>> from frozenlist import FrozenList
>>> fl = FrozenList([17, 42])
>>> fl.append('spam')
>>> fl.append('Vikings')
>>> fl
<FrozenList(frozen=False, [17, 42, 'spam', 'Vikings'])>
>>> fl.freeze()
>>> fl
<FrozenList(frozen=True, [17, 42, 'spam', 'Vikings'])>
>>> fl.frozen
True
>>> fl.append("Monty")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "frozenlist/_frozenlist.pyx", line 97, in frozenlist._frozenlist.FrozenList.append
    self._check_frozen()
  File "frozenlist/_frozenlist.pyx", line 19, in frozenlist._frozenlist.FrozenList._check_frozen
    raise RuntimeError("Cannot modify frozen list.")
RuntimeError: Cannot modify frozen list.

FrozenList is also hashable, but only when frozen. Otherwise it also throws a RuntimeError:

>>> fl = FrozenList([17, 42, 'spam'])
>>> hash(fl)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "frozenlist/_frozenlist.pyx", line 111, in frozenlist._frozenlist.FrozenList.__hash__
    raise RuntimeError("Cannot hash unfrozen list.")
RuntimeError: Cannot hash unfrozen list.
>>> fl.freeze()
>>> hash(fl)
3713081631934410656
>>> dictionary = {fl: 'Vikings'} # frozen fl can be a dict key
>>> dictionary
{<FrozenList(frozen=True, [1, 2])>: 'Vikings'}

Installation

$ pip install frozenlist

The library requires Python 3.8 or newer.

Documentation

https://frozenlist.aio-libs.org

Communication channels

We have a Matrix Space #aio-libs-space:matrix.org which is also accessible via Gitter.

Requirements

  • Python >= 3.8

License

frozenlist is offered under the Apache 2 license.

Source code

The project is hosted on GitHub

Please file an issue in the bug tracker if you have found a bug or have some suggestions to improve the library.

frozenlist's People

Contributors

asvetlov avatar cclauss avatar dependabot-preview[bot] avatar dependabot[bot] avatar dreamsorcerer avatar jamim avatar lgtm-com[bot] avatar mjpieters avatar musicinmybrain avatar pre-commit-ci[bot] avatar sirosen avatar webknjaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frozenlist's Issues

Ability to unfreeze collection after `.freeze()` method is called

Long story short

Hi,

In some cases, I need to unfreeze my collection, make some mutation, and freeze it again. With the current API of the collection, there is no way to do that without collection recreation.

I can submit a PR with changes I want to see in the library, just let me know if my proposal is acceptable.

Expected behaviour

l = FrozenList()
l.append(1)
l.freeze()

l.unfreeze()
l.append(2)

Actual behaviour

l = FrozenList()
l.append(1)
l.freeze()

l = FrozenList()
l.append(1)
l.append(2)

Steps to reproduce

Described in the examples above.

Your environment

1.3.0: sphinx warnings `reference target not found`

On building my packages I'm using sphinx-build command with -n switch which shows warmings about missing references. These are not critical issues.
Here is the output with warnings:

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
loading intersphinx inventory from http://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://docs.aiohttp.org/en/stable/objects.inv...
intersphinx inventory has moved: http://docs.python.org/3/objects.inv -> https://docs.python.org/3/objects.inv
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-frozenlist.3 { } /home/tkloczko/rpmbuild/BUILD/frozenlist-1.3.0/docs/index.rst:7: WARNING: py:meth reference target not found: FrozenList.freeze
/home/tkloczko/rpmbuild/BUILD/frozenlist-1.3.0/docs/index.rst:7: WARNING: py:class reference target not found: FrozenList
done
build succeeded, 2 warnings.

You can peak on fixes that kind of issues in other projects
latchset/jwcrypto#289
click-contrib/sphinx-click@abc31069
latchset/jwcrypto#289
RDFLib/rdflib-sqlalchemy#95

Building frozenlist fails on Python 3.11 beta

Long story short

As part of the sunpy CI we've tried building with Python 3.11. frozenlist is one of our dependencies, and the build fails.

Expected behaviour

frozenlist builds fine.

Actual behaviour

frozenlist build fails, with:

2022-07-11T20:46:52.2781505Z   × Building wheel for frozenlist (pyproject.toml) did not run successfully.
2022-07-11T20:46:52.2781615Zexit code: 1
2022-07-11T20:46:52.2781742Z   ╰─> [43 lines of output]
2022-07-11T20:46:52.2781820Z       **********************
2022-07-11T20:46:52.2781908Z       * Accellerated build *
2022-07-11T20:46:52.2781980Z       **********************
2022-07-11T20:46:52.2782063Z       running bdist_wheel
2022-07-11T20:46:52.2782124Z       running build
2022-07-11T20:46:52.2782203Z       running build_py
2022-07-11T20:46:52.2782280Z       creating build
2022-07-11T20:46:52.2782460Z       creating build/lib.linux-x86_64-cpython-311
2022-07-11T20:46:52.2782660Z       creating build/lib.linux-x86_64-cpython-311/frozenlist
2022-07-11T20:46:52.2782910Z       copying frozenlist/__init__.py -> build/lib.linux-x86_64-cpython-311/frozenlist
2022-07-11T20:46:52.2782990Z       running egg_info
2022-07-11T20:46:52.2783143Z       writing frozenlist.egg-info/PKG-INFO
2022-07-11T20:46:52.2783377Z       writing dependency_links to frozenlist.egg-info/dependency_links.txt
2022-07-11T20:46:52.2783591Z       writing top-level names to frozenlist.egg-info/top_level.txt
2022-07-11T20:46:52.2783801Z       reading manifest file 'frozenlist.egg-info/SOURCES.txt'
2022-07-11T20:46:52.2783968Z       reading manifest template 'MANIFEST.in'
2022-07-11T20:46:52.2784229Z       warning: no previously-included files matching '*.pyc' found anywhere in distribution
2022-07-11T20:46:52.2784490Z       warning: no previously-included files matching '*.pyd' found anywhere in distribution
2022-07-11T20:46:52.2784747Z       warning: no previously-included files matching '*.so' found anywhere in distribution
2022-07-11T20:46:52.2785043Z       warning: no previously-included files matching '*.lib' found anywhere in distribution
2022-07-11T20:46:52.2785298Z       warning: no previously-included files matching '*.dll' found anywhere in distribution
2022-07-11T20:46:52.2785592Z       warning: no previously-included files matching '*.a' found anywhere in distribution
2022-07-11T20:46:52.2785856Z       warning: no previously-included files matching '*.obj' found anywhere in distribution
2022-07-11T20:46:52.2786094Z       warning: no previously-included files found matching 'frozenlist/*.html'
2022-07-11T20:46:52.2786314Z       no previously-included directories found matching 'docs/_build'
2022-07-11T20:46:52.2786456Z       adding license file 'LICENSE'
2022-07-11T20:46:52.2786661Z       writing manifest file 'frozenlist.egg-info/SOURCES.txt'
2022-07-11T20:46:52.2786893Z       copying frozenlist/__init__.pyi -> build/lib.linux-x86_64-cpython-311/frozenlist
2022-07-11T20:46:52.2787149Z       copying frozenlist/_frozenlist.pyx -> build/lib.linux-x86_64-cpython-311/frozenlist
2022-07-11T20:46:52.2787392Z       copying frozenlist/py.typed -> build/lib.linux-x86_64-cpython-311/frozenlist
2022-07-11T20:46:52.2787476Z       running build_ext
2022-07-11T20:46:52.2787653Z       building 'frozenlist._frozenlist' extension
2022-07-11T20:46:52.2787831Z       creating build/temp.linux-x86_64-cpython-311
2022-07-11T20:46:52.2788028Z       creating build/temp.linux-x86_64-cpython-311/frozenlist
2022-07-11T20:46:52.2788649Z       gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/runner/work/sunpy/sunpy/.tox/py311/include -I/opt/hostedtoolcache/Python/3.11.0-beta.3/x64/include/python3.11 -c frozenlist/_frozenlist.c -o build/temp.linux-x86_64-cpython-311/frozenlist/_frozenlist.o
2022-07-11T20:46:52.2788868Z       frozenlist/_frozenlist.c: In function__Pyx_AddTraceback’:
2022-07-11T20:46:52.2789184Z       frozenlist/_frozenlist.c:432:62: error: dereferencing pointer to incomplete typePyFrameObject’ {akastruct _frame’}
2022-07-11T20:46:52.2789447Z         432 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
2022-07-11T20:46:52.2789552Z             |                                                              ^~
2022-07-11T20:46:52.2789826Z       frozenlist/_frozenlist.c:7127:5: note: in expansion of macro__Pyx_PyFrame_SetLineNumber2022-07-11T20:46:52.2789960Z        7127 |     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
2022-07-11T20:46:52.2790051Z             |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-07-11T20:46:52.2790243Z       error: command '/usr/bin/gcc' failed with exit code 1
2022-07-11T20:46:52.2790327Z       [end of output]
2022-07-11T20:46:52.2790378Z   
2022-07-11T20:46:52.2790545Z   note: This error originates from a subprocess, and is likely not a problem with pip.
2022-07-11T20:46:52.2790659Z   ERROR: Failed building wheel for frozenlist

Steps to reproduce

I haven't tried to reproduce this in isolation, but the sunpy CI build is here: https://github.com/sunpy/sunpy/runs/7290065780

Your environment

frozenlist 1.3.0, Python 3.11.0-beta3

Request for pure python wheel

Long story short

frozenlist already supports pure Python mode (with no frozenlist._frozenlist extension), but the wheel is not available on PyPI. This blocks cross-platform usages like micropip.

If possible, we can build and upload a frozenlist-1.4.0-py3-none-any.whl to PyPI.

Expected behaviour

There's a pure Python wheel for downloading on PyPI.

PEP517 backend is non-deterministic

Long story short

We noticed in repro test that this package does not result in deterministic output. The problem is creation of temporary directory here https://github.com/aio-libs/frozenlist/blob/8c15ec9/packaging/pep517_backend/_backend.py#L199. It leaks into debuginfo (we spotted this through analysing _frozenlist.cpython-312-aarch64-linux-gnu.so.debug)

Expected behaviour

Debuginfo is deterministic

Actual behaviour

Debuginfo is not deterministic

Steps to reproduce

Build twice, extract debuginfo, run diffoscope on data.

Your environment

freedesktop-sdk.

Audit the PyPI API token in the CI/CD

@asvetlov I noticed that this project is not managed by the bot account in the CI like others. Normally, I'd create a project-scoped token under https://pypi.org/user/aio-libs-bot/ for use in CI.

Could you confirm that:

  • the token used is scoped to just one project on PyPI (frozenlist)
  • the token belongs to a user without "Owner" privileges
  • you don't want to switch it over to be aligned with the rest of packages

1.4.1: documentation build fails

Long story short

Looks like with 1.4.1 documentation build fails

Expected behaviour

Documentation should build correctly.

Actual behaviour

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v7.1.2
Initializing Spelling Checker 8.0.0
making output directory... done
loading intersphinx inventory from http://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://docs.aiohttp.org/en/stable/objects.inv...
intersphinx inventory has moved: http://docs.python.org/3/objects.inv -> https://docs.python.org/3/objects.inv
building [mo]: targets for 0 po files that are out of date
writing output...
building [man]: all manpages
updating environment:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/events.py", line 96, in emit
    results.append(listener.handler(self.app, *args))
  File "/usr/lib/python3.8/site-packages/sphinxcontrib/towncrier/ext.py", line 363, in get_outdated_docs
    towncrier_fragment_paths = _lookup_towncrier_fragments(
  File "/usr/lib/python3.8/site-packages/sphinxcontrib/towncrier/ext.py", line 132, in _lookup_towncrier_fragments
    fragment_base_directory = project_path / towncrier_config['directory']
TypeError: 'Config' object is not subscriptable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 290, in build_main
    app.build(args.force_all, args.filenames)
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 351, in build
    self.builder.build_update()
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 287, in build_update
    self.build(['__all__'], to_build)
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 310, in build
    updated_docnames = set(self.read())
  File "/usr/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 381, in read
    for docs in self.events.emit('env-get-outdated', self.env, added, changed, removed):
  File "/usr/lib/python3.8/site-packages/sphinx/events.py", line 107, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <bound method TowncrierDraftEntriesEnvironmentCollector.get_outdated_docs of <sphinxcontrib.towncrier.ext.TowncrierDraftEntriesEnvironmentCollector object at 0x7f053a59bb50>> for event 'env-get-outdated' threw an exception (exception: 'Config' object is not subscriptable)

Extension error (sphinxcontrib.towncrier.ext):
Handler <bound method TowncrierDraftEntriesEnvironmentCollector.get_outdated_docs of <sphinxcontrib.towncrier.ext.TowncrierDraftEntriesEnvironmentCollector object at 0x7f053a59bb50>> for event 'env-get-outdated' threw an exception (exception: 'Config' object is not subscriptable)

Steps to reproduce

just run sphinx-build -n -T -b man docs

Your environment

List of installed modules in build env:
Package                       Version
----------------------------- -------
alabaster                     0.7.13
Babel                         2.14.0
build                         1.0.3
charset-normalizer            3.3.2
click                         8.1.7
cppclean                      0.13
Cython                        3.0.6
distro                        1.8.0
dnf                           4.18.1
docutils                      0.20.1
exceptiongroup                1.1.3
expandvars                    0.12.0
gpg                           1.23.2
idna                          3.6
imagesize                     1.4.1
importlib-metadata            7.0.0
importlib-resources           6.1.1
incremental                   22.10.0
iniconfig                     2.0.0
installer                     0.7.0
Jinja2                        3.1.2
libdnf                        0.72.0
MarkupSafe                    2.1.3
packaging                     23.2
pluggy                        1.3.0
Pygments                      2.17.2
pyproject_hooks               1.0.0
pytest                        7.4.3
python-dateutil               2.8.2
pytz                          2023.3
requests                      2.31.0
setuptools                    69.0.2
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        7.1.2
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.5
sphinxcontrib-htmlhelp        2.0.4
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.9
sphinxcontrib-towncrier       0.3.1a3
tomli                         2.0.1
towncrier                     23.11.0
urllib3                       1.26.18
wheel                         0.42.0
zipp                          3.17.0

Binary distributions such as wheels include Cython and C sources

Long story short

Binary distributions such as wheels include Cython and C sources (_frozenlist.pyx and _frozenlist.c).

Expected behaviour

These should not be included in the binary distributions since they do not provide any value, and the C source is quite large.

Actual behaviour

Both _frozenlist.pyx and _frozenlist.c are included in binary distributions.

Steps to reproduce

$ python3 -m venv _e
$ . _e/bin/activate
(_e) $ pip install frozenlist
(_e) $ ls -l _e/lib64/python*/site-packages/frozenlist/
total 816
-rw-rw-r--. 1 ben ben 311481 Dec  6 18:56 _frozenlist.c
-rwxrwxr-x. 1 ben ben 499872 Dec  6 18:56 _frozenlist.cpython-310-aarch64-linux-gnu.so
-rw-rw-r--. 1 ben ben   2983 Dec  6 18:56 _frozenlist.pyx
-rw-rw-r--. 1 ben ben   2391 Dec  6 18:56 __init__.py
-rw-rw-r--. 1 ben ben   1486 Dec  6 18:56 __init__.pyi
drwxrwxr-x. 1 ben ben     48 Dec  6 18:56 __pycache__
-rw-rw-r--. 1 ben ben      6 Dec  6 18:56 py.typed

Your environment

This is totally independent of platform.

Suggested fix

Either add to setup(…) in setup.py:

    exclude_package_data={"": ["*.pyx", "*.c"]},

or, since this is currently the only package data, set

    include_package_data=False,

Neither will affect the source distribution.

[Security] Workflow ci.yml is using vulnerable action py-actions/py-dependency-install

The workflow ci.yml is referencing action py-actions/py-dependency-install using references v2. However this reference is missing the commit 5df6847b1bc7e7eff410a6d05aab1708d592de20 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

RTD access + housekeeping

@mjpieters I see you're the only one listed as a maintainer on RTD. I wanted to wire up the frozenlist.aio-libs.org subdomain (it's already configured on the DNS side) and re-toggle PR builds (this setting seems to be stuck, the checkbox needs to be turned off and on again).
Maybe you could add other people there to deal with the bus factor? Or just perform these activities yourself, please.

Where is frozenlist/_frozenlist.c

Long story short

gcc: fatal error: frozenlist/_frozenlist.c: No such file or directory

Expected behaviour

Build success

Actual behaviour

I have loaded the repository in zip format, unzipped and tried to build with
python3 setup.py build
It fails because frozenlist/_frozenlist.c is not found.

Your environment

Mageia 8

[code coverage confusion] `__class_getitem__` in classes below 3.9 is not covered

Looking at the coverage report posted on Codecov (and what's visible locally), it says that https://app.codecov.io/github/aio-libs/frozenlist/commit/d92751c796094f6d4afecad91b65ec98a3bb9201/blob/frozenlist/__init__.py#L26 and https://app.codecov.io/github/aio-libs/frozenlist/commit/d92751c796094f6d4afecad91b65ec98a3bb9201/blob/frozenlist/_frozenlist.pyx#L13 aren't covered.
These lines are effectively the only ones in the main frozenlist package that are marked as not covered.

Any ideas why that is? cc @mjpieters @Dreamsorcerer @bdraco

I was hoping that maybe MyPy would cover it, but it doesn't either. I'm quite puzzled. FWIW, Codecov now displays MyPy coverage, which reveals some partial typing that needs to be looked at too.

Readme should say why this is useful

It'll be nice if the readme could answer the question "Why would one want a mutable sequence that can be frozen", i.e. why is this module useful?

[Security] Workflow ci.yml is using vulnerable action py-actions/py-dependency-install

The workflow ci.yml is referencing action py-actions/py-dependency-install using references v2. However this reference is missing the commit 5df6847b1bc7e7eff410a6d05aab1708d592de20 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

CPython 3.11 wheels are not available on PyPI

Long story short

While it appears based on a couple other issues that frozenlist has been updated to work with 3.11 in version 1.3.1, no 3.11 wheels were uploaded to PyPI. https://pypi.org/project/frozenlist/1.3.1/#files I understand that at the time of that release the 3.11 interfaces may not have been finalized so there may have been good reason not to publish them at that time.

Expected behaviour

Wheels are available for CPython 3.11 on PyPI.

Actual behaviour

Wheels are not available and must be built locally, even if this is done automatically.

Steps to reproduce

Look at https://pypi.org/project/frozenlist/1.3.1/#files and search for cp311 and note no search hits.

Your environment

frozenlist is a transitive dependency that is not pinned for us and we operate on all platforms, Intel and ARM, and CPython 3.7 through 3.11.

Building forzenlist failed with pip , but not with pip3

Overall :
I just encountered with a strange error when building with frozenlist.

Story :
When i build frozenlist with pip (version : 20.2.3 ), it fails with the output :

 ERROR: Command errored out with exit status 1:
   command: /Users/karlyu/astraly-contracts/env/bin/python3 /Users/karlyu/astraly-contracts/env/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/th/h_gk355d1kqf0tjp346k4p9m0000gn/T/pip-build-env-a_9637ax/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://pypi.douban.com/simple --trusted-host pypi.douban.com -- 'setuptools >= 46.4.0' 'wheel >= 0.37.0'
       cwd: None
  Complete output (7 lines):
  Looking in indexes: http://pypi.douban.com/simple
  Collecting setuptools>=46.4.0
    Downloading http://pypi.doubanio.com/packages/a4/53/bfc6409447ca024558b8b19d055de94c813c3e32c0296c48a0873a161cf5/setuptools-63.2.0-py3-none-any.whl (1.2 MB)
  ERROR: Could not find a version that satisfies the requirement wheel>=0.37.0 (from versions: none)
  ERROR: No matching distribution found for wheel>=0.37.0
  WARNING: You are using pip version 20.2.3; however, version 22.1.2 is available.
  You should consider upgrading via the '/Users/karlyu/astraly-contracts/env/bin/python3 -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/karlyu/astraly-contracts/env/bin/python3 /Users/karlyu/astraly-contracts/env/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/th/h_gk355d1kqf0tjp346k4p9m0000gn/T/pip-build-env-a_9637ax/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i http://pypi.douban.com/simple --trusted-host pypi.douban.com -- 'setuptools >= 46.4.0' 'wheel >= 0.37.0' Check the logs for full command output.

But it turns out to be successful when i've tried pip3 (with the same version) :

  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: frozenlist
  Building wheel for frozenlist (PEP 517) ... done
  Created wheel for frozenlist: filename=frozenlist-1.3.0-cp38-cp38-macosx_10_14_x86_64.whl size=61803 sha256=bc9224a5c6a0f27930a948fe202d09d54d85eb0e667dd27c9ee12b50ee6856ed
  Stored in directory: /Users/karlyu/Library/Caches/pip/wheels/7b/c6/b2/3844b55dde19374ac3e9a4fe6e8e0600f126a5bec7f349864a
Successfully built frozenlist

Python 3.13.0b1: TestFrozenList.test_iface fails with AssertionError: `False = hasattr(<class 'frozenlist._frozenlist.FrozenList'>, '__static_attributes__')`

Long story short

TestFrozenList.test_iface fails when run with Python 3.13.0b1 in Fedora Linux.

Expected behaviour

Tests pass.

Actual behaviour

=================================== FAILURES ===================================
__________________________ TestFrozenList.test_iface ___________________________

self = <test_frozenlist.TestFrozenList object at 0x7f6291a679d0>

    def test_iface(self) -> None:
        for name in set(dir(MutableSequence)) - self.SKIP_METHODS:
            if name.startswith("_") and not name.endswith("_"):
                continue
>           assert hasattr(self.FrozenList, name)
E           AssertionError: assert False
E            +  where False = hasattr(<class 'frozenlist._frozenlist.FrozenList'>, '__static_attributes__')
E            +    where <class 'frozenlist._frozenlist.FrozenList'> = <test_frozenlist.TestFrozenList object at 0x7f6291a679d0>.FrozenList

name       = '__static_attributes__'
self       = <test_frozenlist.TestFrozenList object at 0x7f6291a679d0>

tests/test_frozenlist.py:23: AssertionError
=========================== short test summary info ============================
FAILED tests/test_frozenlist.py::TestFrozenList::test_iface - AssertionError:...
========================= 1 failed, 87 passed in 0.12s =========================

Your environment

Fedora Linux 41, see e.g. build logs

Fail to install 1.1.0 (is not a supported wheel on this platform)

Long story short

After update from 1.0.0 -> 1.1.0 installing via pip lead to fail.

Expected behaviour

Successfull installation :)

Actual behaviour

pip install lead raise an error

Command ['/builds/infrastructure/libpy-pdms/.venv/bin/pip', 'install', '--no-deps', '-U', '/root/.cache/pypoetry/artifacts/fc/dd/83/e94eebb02df039ac08210c5b8deba35f1e8cd61eab9b949c2e3edf6202/frozenlist-1.1.0-cp38-cp38-manylinux2014_x86_64.whl'] errored with the following return code 1, and output: 
580   ERROR: frozenlist-1.1.0-cp38-cp38-manylinux2014_x86_64.whl is not a supported wheel on this platform.
581   WARNING: You are using pip version 19.2.3, however version 20.2.3 is available.
582   You should consider upgrading via the 'pip install --upgrade pip' command.

Steps to reproduce

run pip install frozenlist==1.1.0

Your environment

os: Ubuntu 18.10
python: 3.8.2
pip: 19.2.3

Install Error on Python 3.11

Long story short

With Python 3.11 coming up, I'm testing various projects, and encountered an issue with frozenlist during this testing. During the install, the following error occurs:

gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/zevaryx/.cache/pypoetry/virtualenvs/jarvis-core-FBeBr3II-py3.11/include -I/usr/local/include/python3.11 -c frozenlist/_frozenlist.c -o build/temp.linux-x86_64-3.11/frozenlist/_frozenlist.o
frozenlist/_frozenlist.c: In function ‘__Pyx_AddTraceback’:
frozenlist/_frozenlist.c:432:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
  432 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
      |                                                              ^~
frozenlist/_frozenlist.c:7127:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
 7127 |     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

I believe this is due to Python 3.11 C API changes with PyFrameObject

Expected behaviour

frozenlist to properly install

Actual behaviour

GCC error with the aforementioned error

Steps to reproduce

Create a Python 3.11 environment and run pip install frozenlist

Your environment

frozenlist == 1.3.0
OS: Arch Linux
Python 3.11.0a6, compiled with GCC 11.2.0
GCC 11.2.0

[Security] Workflow ci.yml is using vulnerable action py-actions/py-dependency-install

The workflow ci.yml is referencing action py-actions/py-dependency-install using references v2. However this reference is missing the commit 5df6847b1bc7e7eff410a6d05aab1708d592de20 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

Dependabot couldn't fetch all your path-based dependencies

Dependabot couldn't fetch one or more of your project's path-based Python dependencies. The affected dependencies were requirements/setup.py.

To use path-based dependencies with Dependabot the paths must be relative and resolve to a directory in this project's source code.

You can mention @dependabot in the comments below to contact the Dependabot team.

Pure Python wheel not included in release

Long story short

The pure Python wheel (frozenlist-1.4.0-py3-none-any.whl) is not present in the release even though python -Im build --config-setting=pure-python=true is present in the workflow. This is needed for Pyodide, where installing through micropip would not result in an error.

Testing environment: https://jupyter.org/try-jupyter/lab/

import micropip
await micropip.install("frozenlist", keep_going=True)
import frozenlist
print(frozenlist.__version__)

Expected behaviour

1.4.0

Actual behaviour

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[5], line 1
----> 1 await micropip.install("frozenlist", keep_going=True)
      2 import frozenlist
      3 print(frozenlist.__version__)

File /lib/python3.11/site-packages/micropip/_commands/install.py:146, in install(requirements, keep_going, deps, credentials, pre, index_urls, verbose)
    144 if transaction.failed:
    145     failed_requirements = ", ".join([f"'{req}'" for req in transaction.failed])
--> 146     raise ValueError(
    147         f"Can't find a pure Python 3 wheel for: {failed_requirements}\n"
    148         f"See: {FAQ_URLS['cant_find_wheel']}\n"
    149     )
    151 package_names = [pkg.name for pkg in transaction.pyodide_packages] + [
    152     pkg.name for pkg in transaction.wheels
    153 ]
    155 if package_names:

ValueError: Can't find a pure Python 3 wheel for: 'frozenlist'
See: https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package

Steps to reproduce

import micropip
await micropip.install("frozenlist", keep_going=True)
import frozenlist
print(frozenlist.__version__)

Your environment

https://jupyter.org/try-jupyter/lab/

1.3.0: pep517 build fails

Looks like pep517 based build using source tree fails

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting dependencies for wheel...
**********************
* Accellerated build *
**********************
running egg_info
creating frozenlist.egg-info
writing frozenlist.egg-info/PKG-INFO
writing dependency_links to frozenlist.egg-info/dependency_links.txt
writing top-level names to frozenlist.egg-info/top_level.txt
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
listing git files failed - pretending there aren't any
reading manifest file 'frozenlist.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'frozenlist/*.c'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.lib' found anywhere in distribution
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.a' found anywhere in distribution
warning: no previously-included files matching '*.obj' found anywhere in distribution
warning: no previously-included files found matching 'frozenlist/*.html'
no previously-included directories found matching 'docs/_build'
adding license file 'LICENSE'
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
* Building wheel...
**********************
* Accellerated build *
**********************
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/frozenlist
copying frozenlist/__init__.py -> build/lib.linux-x86_64-cpython-38/frozenlist
running egg_info
writing frozenlist.egg-info/PKG-INFO
writing dependency_links to frozenlist.egg-info/dependency_links.txt
writing top-level names to frozenlist.egg-info/top_level.txt
listing git files failed - pretending there aren't any
reading manifest file 'frozenlist.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'frozenlist/*.c'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.lib' found anywhere in distribution
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.a' found anywhere in distribution
warning: no previously-included files matching '*.obj' found anywhere in distribution
warning: no previously-included files found matching 'frozenlist/*.html'
no previously-included directories found matching 'docs/_build'
adding license file 'LICENSE'
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
copying frozenlist/__init__.pyi -> build/lib.linux-x86_64-cpython-38/frozenlist
copying frozenlist/_frozenlist.pyx -> build/lib.linux-x86_64-cpython-38/frozenlist
copying frozenlist/py.typed -> build/lib.linux-x86_64-cpython-38/frozenlist
running build_ext
building 'frozenlist._frozenlist' extension
creating build/temp.linux-x86_64-cpython-38
creating build/temp.linux-x86_64-cpython-38/frozenlist
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -I/usr/include/python3.8 -c frozenlist/_frozenlist.c -o build/temp.linux-x86_64-cpython-38/frozenlist/_frozenlist.o
cc1: fatal error: frozenlist/_frozenlist.c: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1

I can point on similar issue and solution against other module
fastavro/fastavro#600
fastavro/fastavro#602

PyPI access

@mjpieters please add me ( andrew.svetlov ) to frozenlist and aiosignals projects on PyPI.

This blocks me from publishing a new version with Python 3.8-3.9 support.

Thanks.

[CI/task/bug] GHA check job misconfiguration

As it is configured now, the test-summary job will always pass in the branch protection rules because it'll either be green (success) or gray (skip — this happens when the tests fail) which is ultimately interpreted as “not failing”.

The fix is easy — use if: always(). And it's better to use https://github.com/re-actors/alls-green, since all the detection logic is generalized well there.

Compiling frozenlist error: 'frozenlist/_frozenlist.c': No such file or directory

I tried to compile the frozenlist python package and it gave me this error.
c1: fatal error C1083: Cannot open source file: 'frozenlist/_frozenlist.c': No such file or directory
I don't see a file named _frozenlist.c in the frozenlist folder.

I got this error when using the command py setup.py build
I am using Windows 10 with Microsoft C++ Build Tools

installing via poetry throws error, can't assess keyring.

Long story short

Trying to import frozenlist via poetry on headless system results in errors.

REF:
https://gitlab.com/imbev/matrix-rss-bridge/-/issues/3

Expected behaviour

poetry not throwing an error when installing on a system without X installed.

Actual behaviour

poetry throws an error that it can't access the keying.

Steps to reproduce

on a headless system, logged in as root:

# cd project_name
# poetry add frozenlist
# poetry install

Your environment

# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
# uname -a
Linux eeepc-debian 6.1.0-18-686 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) i686 GNU/Linux
# python3 --version
Python 3.11.2
# poetry --version
Poetry (version 1.3.2)

Can't install frozenlist on Python 3.12

Expected behaviour

Successful installation.

Actual behaviour

$ pip install frozenlist
...
Failed to build frozenlist
ERROR: Could not build wheels for frozenlist, which is required to install pyproject.toml-based projects
Details
$ pip install frozenlist
Collecting frozenlist
  Downloading frozenlist-1.3.3.tar.gz (66 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: frozenlist
  Building wheel for frozenlist (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for frozenlist (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [217 lines of output]
      *********************
      * Accelerated build *
      *********************
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-13.0-x86_64-cpython-312
      creating build/lib.macosx-13.0-x86_64-cpython-312/frozenlist
      copying frozenlist/__init__.py -> build/lib.macosx-13.0-x86_64-cpython-312/frozenlist
      running egg_info
      writing frozenlist.egg-info/PKG-INFO
      writing dependency_links to frozenlist.egg-info/dependency_links.txt
      writing top-level names to frozenlist.egg-info/top_level.txt
      reading manifest file 'frozenlist.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.pyd' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      warning: no previously-included files matching '*.lib' found anywhere in distribution
      warning: no previously-included files matching '*.dll' found anywhere in distribution
      warning: no previously-included files matching '*.a' found anywhere in distribution
      warning: no previously-included files matching '*.obj' found anywhere in distribution
      warning: no previously-included files found matching 'frozenlist/*.html'
      no previously-included directories found matching 'docs/_build'
      adding license file 'LICENSE'
      writing manifest file 'frozenlist.egg-info/SOURCES.txt'
      copying frozenlist/__init__.pyi -> build/lib.macosx-13.0-x86_64-cpython-312/frozenlist
      copying frozenlist/_frozenlist.pyx -> build/lib.macosx-13.0-x86_64-cpython-312/frozenlist
      copying frozenlist/py.typed -> build/lib.macosx-13.0-x86_64-cpython-312/frozenlist
      running build_ext
      building 'frozenlist._frozenlist' extension
      creating build/temp.macosx-13.0-x86_64-cpython-312
      creating build/temp.macosx-13.0-x86_64-cpython-312/frozenlist
      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/zlib/include -I/private/tmp/foo/.venv/include -I/Users/albert/.pyenv/versions/3.12-dev/include/python3.12 -c frozenlist/_frozenlist.c -o build/temp.macosx-13.0-x86_64-cpython-312/frozenlist/_frozenlist.o
      frozenlist/_frozenlist.c:4136:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_FrozenList); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
          ^
      frozenlist/_frozenlist.c:1300:43: note: expanded from macro '__Pyx_GetModuleGlobalName'
          (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
                                                ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:4182:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_FrozenList); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
          ^
      frozenlist/_frozenlist.c:1300:43: note: expanded from macro '__Pyx_GetModuleGlobalName'
          (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
                                                ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:5463:3: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
        ^
      frozenlist/_frozenlist.c:1300:43: note: expanded from macro '__Pyx_GetModuleGlobalName'
          (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
                                                ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:5481:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
          ^
      frozenlist/_frozenlist.c:1300:43: note: expanded from macro '__Pyx_GetModuleGlobalName'
          (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
                                                ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:5535:3: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MutableSequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
        ^
      frozenlist/_frozenlist.c:1300:43: note: expanded from macro '__Pyx_GetModuleGlobalName'
          (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
                                                ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:5967:36: error: no member named 'curexc_traceback' in 'struct _ts'
              PyObject* tmp_tb = tstate->curexc_traceback;
                                 ~~~~~~  ^
      frozenlist/_frozenlist.c:5970:21: error: no member named 'curexc_traceback' in 'struct _ts'
                  tstate->curexc_traceback = tb;
                  ~~~~~~  ^
      frozenlist/_frozenlist.c:6338:53: error: no member named 'ob_digit' in 'struct _longobject'
              const digit* digits = ((PyLongObject*)op1)->ob_digit;
                                    ~~~~~~~~~~~~~~~~~~~~  ^
      frozenlist/_frozenlist.c:6623:27: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
                                ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:6635:36: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
                                         ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:6639:56: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
                                                             ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:6656:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
          __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
          ^
      frozenlist/_frozenlist.c:1274:21: note: expanded from macro '__PYX_UPDATE_DICT_CACHE'
          (version_var) = __PYX_GET_DICT_VERSION(dict);\
                          ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:7047:9: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
              __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
              ^
      frozenlist/_frozenlist.c:1279:16: note: expanded from macro '__PYX_PY_DICT_LOOKUP_IF_MODIFIED'
          if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
                     ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:7047:9: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations]
              __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
              ^
      frozenlist/_frozenlist.c:1283:30: note: expanded from macro '__PYX_PY_DICT_LOOKUP_IF_MODIFIED'
              __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
                                   ^
      frozenlist/_frozenlist.c:1272:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
      #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
                                                                      ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here
          Py_DEPRECATED(3.12) uint64_t ma_version_tag;
          ^
      /Users/albert/.pyenv/versions/3.12-dev/include/python3.12/pyport.h:318:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      frozenlist/_frozenlist.c:7348:55: error: no member named 'ob_digit' in 'struct _longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      frozenlist/_frozenlist.c:7403:55: error: no member named 'ob_digit' in 'struct _longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      frozenlist/_frozenlist.c:7582:55: error: no member named 'ob_digit' in 'struct _longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      frozenlist/_frozenlist.c:7637:55: error: no member named 'ob_digit' in 'struct _longobject'
                  const digit* digits = ((PyLongObject*)x)->ob_digit;
                                        ~~~~~~~~~~~~~~~~~~  ^
      frozenlist/_frozenlist.c:8088:47: error: no member named 'ob_digit' in 'struct _longobject'
          const digit* digits = ((PyLongObject*)b)->ob_digit;
                                ~~~~~~~~~~~~~~~~~~  ^
      11 warnings and 8 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for frozenlist
Failed to build frozenlist
ERROR: Could not build wheels for frozenlist, which is required to install pyproject.toml-based projects

Steps to reproduce

pip install frozenlist

Your environment

$ sw_vers
ProductName:		macOS
ProductVersion:		13.0.1
BuildVersion:		22A400

$ python -VV
Python 3.12.0a5+ (heads/main:22b8d77, Feb 23 2023, 11:25:13) [Clang 14.0.0 (clang-1400.0.29.202)]

subscriptable typing

Long story short

Subscripting the FrozenList type currently breaks.
I'm guessing a user would expect the FrozenList works the same as standard List as far as typing is concerned...

Example script:

from dataclasses import dataclass
from frozenlist import FrozenList

@dataclass
class MyClass:

    lst: FrozenList[int]


dc = MyClass(lst=FrozenList([1,2,3]))
print(dc)

Expected behaviour

I would expect this to work as with List:

from dataclasses import dataclass
from typing import List

@dataclass
class MyClass:

    lst: List[int]


dc = MyClass(lst=list([1,2,3]))
print(dc)
MyClass(lst=[1, 2, 3])

Actual behaviour

Traceback (most recent call last):
  File "fltest.py", line 5, in <module>
    class MyClass:
  File "fltest.py", line 7, in MyClass
    lst: FrozenList[int]
TypeError: 'type' object is not subscriptable

Your environment

$ python --version
Python 3.8.5
$ pip list | grep frozenlist
frozenlist                    1.1.1     

build frozenlist failed on openwrt mipsel libctf.so.0: qsort_r: symbol not found

Long story short

build frozenlist-1.1.1 or frozenlist-1.3.3 failed
root@NewifiD1:~/frozenlist-1.1.1# python setup.py install


  • Accellerated build *

/usr/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
running install
/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
running bdist_egg
running egg_info
writing frozenlist.egg-info/PKG-INFO
writing dependency_links to frozenlist.egg-info/dependency_links.txt
writing top-level names to frozenlist.egg-info/top_level.txt
reading manifest file 'frozenlist.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.pyd' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution
warning: no previously-included files matching '
.lib' found anywhere in distribution
warning: no previously-included files matching '.dll' found anywhere in distribution
warning: no previously-included files matching '
.a' found anywhere in distribution
warning: no previously-included files matching '.obj' found anywhere in distribution
warning: no previously-included files found matching 'frozenlist/
.html'
no previously-included directories found matching 'docs/_build'
adding license file 'LICENSE.txt'
writing manifest file 'frozenlist.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-mips/egg
running install_lib
running build_py
creating build
creating build/lib.linux-mips-3.10
creating build/lib.linux-mips-3.10/frozenlist
copying frozenlist/init.py -> build/lib.linux-mips-3.10/frozenlist
copying frozenlist/init.pyi -> build/lib.linux-mips-3.10/frozenlist
copying frozenlist/_frozenlist.c -> build/lib.linux-mips-3.10/frozenlist
copying frozenlist/_frozenlist.pyx -> build/lib.linux-mips-3.10/frozenlist
copying frozenlist/py.typed -> build/lib.linux-mips-3.10/frozenlist
running build_ext
building 'frozenlist._frozenlist' extension
creating build/temp.linux-mips-3.10
creating build/temp.linux-mips-3.10/frozenlist
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7=Python-3.10.7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7=Python-3.10.7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7=Python-3.10.7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/include -fPIC -I/usr/include/python3.10 -c frozenlist/_frozenlist.c -o build/temp.linux-mips-3.10/frozenlist/_frozenlist.o
gcc -shared -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/lib -znow -zrelro -L/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7 -L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc_musl/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc_gcc-12.2.0_musl/lib -znow -zrelro -L/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc_musl/Python-3.10.7 -L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc_musl/lib build/temp.linux-mips-3.10/frozenlist/_frozenlist.o -L/usr/lib -o build/lib.linux-mips-3.10/frozenlist/_frozenlist.cpython-310.so
Error relocating /usr/lib/libctf.so.0: qsort_r: symbol not found
collect2: error: ld returned 127 exit status
error: command '/usr/bin/gcc' failed with exit code 1
root@NewifiD1:~/frozenlist-1.1.1# /usr/lib/libctf.so.0: qsort_r: symbol not found

Expected behaviour

build success

Actual behaviour

Error relocating /usr/lib/libctf.so.0: qsort_r: symbol not found
collect2: error: ld returned 127 exit status
error: command '/usr/bin/gcc' failed with exit code 1

Steps to reproduce

Your environment

openwrt mipsel
libctf - 2.38-1
gcc - 8.4.0-1
root@NewifiD1:~/frozenlist-1.1.1# uname -a
Linux NewifiD1 5.4.188 #0 SMP Sun Apr 3 16:01:44 2022 mips GNU/Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.