Mailing List Archive

1 2 3  View All
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Anthony Sottile <asottile@umich.edu> added the comment:

the toil is still present, the existing, good apis are deprecated and the new, bad apis are slow -- and the odd subclasses are still present

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Anthony Sottile <asottile@umich.edu> added the comment:

I have also shown that the performance is indeed not better in the nominal case, as demonstrated in the first case

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:

importlib_metadata 4.4 restores compatibility for the reported concerns. I'll merge those into CPython later.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Anthony Sottile <asottile@umich.edu> added the comment:

it does not, it restores apis but in a way which requires a huge performance hit to avoid deprecation warnings

it also still has the 2-500x performance regression I've stated above

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Change by Jason R. Coombs <jaraco@jaraco.com>:


----------
pull_requests: +25062
pull_request: https://github.com/python/cpython/pull/26467

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Change by Jason R. Coombs <jaraco@jaraco.com>:


----------
pull_requests: +25063
pull_request: https://github.com/python/cpython/pull/26468

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:


New changeset 410b70d39d9d77384f8b8597560f6731530149ca by Jason R. Coombs in branch 'main':
bpo-44246: Entry points performance improvements. (GH-26467)
https://github.com/python/cpython/commit/410b70d39d9d77384f8b8597560f6731530149ca


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>:


----------
pull_requests: +25064
pull_request: https://github.com/python/cpython/pull/26469

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment:


New changeset d1480ad2f5d5f02ecbe4b4091e8c428ddfa39ff6 by Miss Islington (bot) in branch '3.10':
bpo-44246: Entry points performance improvements. (GH-26467)
https://github.com/python/cpython/commit/d1480ad2f5d5f02ecbe4b4091e8c428ddfa39ff6


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:


New changeset c34ed08d975fb7daa7b329f7c631647782290393 by Jason R. Coombs in branch 'main':
bpo-44246: Restore compatibility in entry_points (GH-26468)
https://github.com/python/cpython/commit/c34ed08d975fb7daa7b329f7c631647782290393


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:


New changeset c34ed08d975fb7daa7b329f7c631647782290393 by Jason R. Coombs in branch 'main':
bpo-44246: Restore compatibility in entry_points (GH-26468)
https://github.com/python/cpython/commit/c34ed08d975fb7daa7b329f7c631647782290393


----------
message_count: 27.0 -> 28.0
pull_requests: +25066
pull_request: https://github.com/python/cpython/pull/26471

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:

The compatibility concerns are addressed with PR 26468 and some of the performance concerns may be mitigated with PR 26467. As I mentioned before, if there are continuing performance concerns, please raise them separately (preferably with python/importlib_metadata, and please include use-cases that exemplify not just the effect, but the impact.

----------
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Change by Jason R. Coombs <jaraco@jaraco.com>:


----------
pull_requests: +25067
pull_request: https://github.com/python/cpython/pull/26472

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:


New changeset 78d9a9b1904f0e1d9db1e941c19782f4f5a881d4 by Jason R. Coombs in branch 'main':
bpo-44246: Remove note about access by index now that a compatibility shim is offered. (GH-26472)
https://github.com/python/cpython/commit/78d9a9b1904f0e1d9db1e941c19782f4f5a881d4


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>:


----------
pull_requests: +25068
pull_request: https://github.com/python/cpython/pull/26473

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment:


New changeset 7207203e1d71e4bf65e5b4991f60e7dc1e35e813 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-44246: Restore compatibility in entry_points (GH-26468) (GH-26471)
https://github.com/python/cpython/commit/7207203e1d71e4bf65e5b4991f60e7dc1e35e813


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:


New changeset d0991e2db3bb932e2411ee9dca54fd69ff2611c4 by Miss Islington (bot) in branch '3.10':
bpo-44246: Remove note about access by index now that a compatibility shim is offered. (GH-26472) (#26473)
https://github.com/python/cpython/commit/d0991e2db3bb932e2411ee9dca54fd69ff2611c4


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Ken Jin <kenjin4096@gmail.com> added the comment:

The new test `test_entry_points_by_index` (added in c34ed08d975fb7daa7b329f7c631647782290393 ) seems to fail on some windows buildbots:

https://dev.azure.com/Python/cpython/_build/results?buildId=81807&view=logs&j=c8a71634-e5ec-54a0-3958-760f4148b765&t=599737bc-ad72-560d-1530-0f89b05729e4

A copy of the error output for everyone's convenience:
======================================================================
ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests)
Prior versions of Distribution.entry_points would return a
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\a\1\b\layout-appx-amd64\lib\test\test_importlib\test_metadata_api.py", line 145, in test_entry_points_by_index
expected = next(iter(caught))
StopIteration

----------------------------------------------------------------------

BTW, the same buildbot is currently failing on main with a different error which masks that error above. I'll do more digging if no one takes this up by next week. Currently I'm not able to reproduce that locally on my windows machine. Thanks all!

----------
nosy: +kj

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:

The line where the failure occurs is the point where it's checking that the warning was issued. The fact that a StopIteration is raised indicates that no warnings were caught. I can think of a couple of scenarios where that could happen:

- That warning is somehow disabled.
- The `Distribution` object returned by `distribution('distinfo-pkg')` is somehow an older implementation (perhaps an older importlib_metadata is present).

Given that the DeprecationWarnings aren't missed on other tests, the latter seems to be a more likely candidate.

I notice that the regular tests are passing. It's only in the 'appx' environment where the test fails. I'm not familiar with appx, but it seems likely that something from the appx environment creation is a factor in the divergent behavior.

Steve, can you advise on how appx environments are created and how one could replicate a test failure that only occurs in that environment?

----------
nosy: +steve.dower

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Steve Dower <steve.dower@python.org> added the comment:

The appx layout is also the only one in CI that actually uses an installed layout - all the rest run tests from the source tree. So it could be related to that.

If it's a warning, it could also be that the warning is being triggered somewhere else first. Since tests run in a random order, you'll want to look for how reliable the failure is.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:

Thanks Steve for the feedback.

> If it's a warning, it could also be that the warning is being triggered somewhere else first. Since tests run in a random order, you'll want to look for how reliable the failure is.

It is a warning, but it seems unlikely that any other code is calling it, given that the supporting codepath was not present until the same PR.

> The appx layout is also the only one in CI that actually uses an installed layout - all the rest run tests from the source tree. So it could be related to that.

If someone could help by producing a docker image that can build the appx layout and run the tests, that would help me as I don't have a lot of proficiency with installing build tools on Windows through the CLI... and the experience I do have has been fraught with challenges.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Anthony Sottile <asottile@umich.edu> added the comment:

here's the performance regressions, they affect any callers of `distributions()` and are even worse on callers of the new apis.

a call to distributions() is about 3x slower than in 3.9

here is the setup I am using:

virtualenv venv39 -ppython3.9
venv39/bin/pip install flake8 pytest twine pre-commit
virtualenv venv310 -ppython3.10
venv310/bin/pip install flake8 pytest twine pre-commit

to test just the `distributions()` call I'm using the following:

```console
$ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points()'
20 loops, best of 20: 12.5 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points()'
20 loops, best of 20: 36.7 msec per loop
```

this is a less-extreme example, many applications have more dependencies installed -- but even in this case this is adding ~24ms startup to any application using `entry_points()` -- and it gets worse

the return value of `entry_points()` alone isn't all that useful, next an application needs to retrieve its entry points. let's start for the somewhat normal case of retrieving a single category of entry points:

```console
$ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points()["flake8.extension"]'
20 loops, best of 20: 12.7 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points(name="flake8.extension")'
20 loops, best of 20: 37.1 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points().select(group="flake8.extension")'
20 loops, best of 20: 37.1 msec per loop
```

again, 3x slower and very real time to the end user (~24-25ms)

now let's show an example usage that something like flake8 uses where multiple groups are requested (this is common for apps and plugin systems which provide multiple distinct functionalities)

```console
$ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'eps = entry_points(); eps["flake8.extension"]; eps["flake8.report"]'

20 loops, best of 20: 12.6 msec per loop
$ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'eps = entry_points(); eps.select(group="flake8.extension"); eps.select(group="flake8.report")'
20 loops, best of 20: 38.2 msec per loop
```

also slower, but an additional ms per call to `.select(...)`


and it only gets worse with more and more packages installed

here's the versions I'm using to ensure they are up to date:

```console
$ venv39/bin/python --version --version
Python 3.9.5 (default, May 19 2021, 11:32:47)
[GCC 9.3.0]
$ venv310/bin/python --version --version
Python 3.10.0b2 (default, Jun 2 2021, 00:22:18) [GCC 9.3.0]
```

----------
resolution: fixed ->
status: closed -> open

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:

As mentioned in msg394775, I'd like to decouple the performance concerns from the original incompatibility. I recognize that performance regressions are in their own way a form of incompatibility, but there have been a lot of changes to entry points with respect to performance, both prior to beta 1 and in beta 2, including changes that intentionally traded performance for correctness (https://github.com/python/importlib_metadata/pull/281).

To that end, I've filed https://github.com/python/importlib_metadata/issues/324 to track the concerns.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Anthony Sottile <asottile@umich.edu> added the comment:

they are directly coupled which is why I commented here

the api redesign forces O(N) lookups and O(N) constructions which directly impact performance causing the regression

----------
resolution: fixed ->
status: closed -> open

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points [ In reply to ]
Jason R. Coombs <jaraco@jaraco.com> added the comment:

In [this Dockerfile](https://github.com/jaraco/jaraco.windows/blob/feature/vs-2/Dockerfile), I've attempted to install Visual Studio, but without success. Docker fails to build on [line 6](https://github.com/jaraco/jaraco.windows/blob/4de80c897cb92362bd1084a9851f3f08b6ed697e/Dockerfile#L6). The install fails with this error:

```
ERROR: Running ["C:\Users\ContainerAdministrator\AppData\Local\Temp\chocolatey\visualstudio2019buildtools\16.10.0.0\vs_BuildTools.exe" --quiet --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools --norestart --wait] was not successful. Exit code was '-2147024770'. See log for possible error messages.
```

Any tips on creating a Windows environment with build support would be appreciated.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue44246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

1 2 3  View All