Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-97930: Apply changes from importlib_resources 5.10. #100598

Merged
merged 4 commits into from
Jan 1, 2023

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Dec 29, 2022

Previous sync with 5.9 was #97929.

Changes are described here:

#203: Lifted restriction on modules passed to files. Now modules need not be a package and if a non-package module is passed, resources will be resolved adjacent to those modules, even for modules not found in any package. For example, files(import_module('mod.py')) will resolve resources found at the root. The parameter to files was renamed from ‘package’ to ‘anchor’, with a compatibility shim for those passing by keyword.

#259: files no longer requires the anchor to be specified and can infer the anchor from the caller’s scope (defaults to the caller’s module).

These changes have been released for several months with no reported concerns.

@jaraco jaraco force-pushed the feature/importlib-resources-5.10 branch 2 times, most recently from 362c36c to a2524ba Compare December 29, 2022 16:33
@jaraco jaraco changed the title Apply changes from importlib_resources 5.10. gh-97930: Apply changes from importlib_resources 5.10. Dec 29, 2022
@bedevere-bot bedevere-bot mentioned this pull request Dec 29, 2022
3 tasks
@jaraco jaraco force-pushed the feature/importlib-resources-5.10 branch from 95e3e1d to 0b49678 Compare December 29, 2022 17:08
…eing preferred and Package object being deprecated.
@jaraco jaraco force-pushed the feature/importlib-resources-5.10 branch from 0b49678 to 81c3c5e Compare December 29, 2022 17:14
@jaraco jaraco merged commit 447d061 into python:main Jan 1, 2023
@jaraco jaraco deleted the feature/importlib-resources-5.10 branch January 1, 2023 16:07
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM Raspbian 3.x has failed when building commit 447d061.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/424/builds/3216) and take a look at the build logs.
  4. Check if the failure is related to this commit (447d061) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/424/builds/3216

Summary of the results of the build (if available):

== Tests result: ENV CHANGED ==

411 tests OK.

10 slowest tests:

  • test_largefile: 6 min 32 sec
  • test_venv: 4 min 50 sec
  • test_asyncio: 3 min 51 sec
  • test_multiprocessing_spawn: 3 min 21 sec
  • test_concurrent_futures: 3 min 9 sec
  • test_multiprocessing_forkserver: 3 min 2 sec
  • test_zipfile: 2 min 44 sec
  • test_shutil: 2 min 20 sec
  • test_tokenize: 2 min 1 sec
  • test_gdb: 1 min 45 sec

1 test altered the execution environment:
test_multiprocessing_forkserver

21 tests skipped:
test_check_c_globals test_devpoll test_idle test_ioctl test_kqueue
test_launcher test_msilib test_peg_generator test_perf_profiler
test_startfile test_tcl test_tix test_tkinter test_ttk
test_ttk_textonly test_turtle test_winconsoleio test_winreg
test_winsound test_wmi test_zipfile64

Total duration: 29 min 29 sec

Click to see traceback logs
remote: Enumerating objects: 42, done.        
remote: Counting objects:   2% (1/42)        
remote: Counting objects:   4% (2/42)        
remote: Counting objects:   7% (3/42)        
remote: Counting objects:   9% (4/42)        
remote: Counting objects:  11% (5/42)        
remote: Counting objects:  14% (6/42)        
remote: Counting objects:  16% (7/42)        
remote: Counting objects:  19% (8/42)        
remote: Counting objects:  21% (9/42)        
remote: Counting objects:  23% (10/42)        
remote: Counting objects:  26% (11/42)        
remote: Counting objects:  28% (12/42)        
remote: Counting objects:  30% (13/42)        
remote: Counting objects:  33% (14/42)        
remote: Counting objects:  35% (15/42)        
remote: Counting objects:  38% (16/42)        
remote: Counting objects:  40% (17/42)        
remote: Counting objects:  42% (18/42)        
remote: Counting objects:  45% (19/42)        
remote: Counting objects:  47% (20/42)        
remote: Counting objects:  50% (21/42)        
remote: Counting objects:  52% (22/42)        
remote: Counting objects:  54% (23/42)        
remote: Counting objects:  57% (24/42)        
remote: Counting objects:  59% (25/42)        
remote: Counting objects:  61% (26/42)        
remote: Counting objects:  64% (27/42)        
remote: Counting objects:  66% (28/42)        
remote: Counting objects:  69% (29/42)        
remote: Counting objects:  71% (30/42)        
remote: Counting objects:  73% (31/42)        
remote: Counting objects:  76% (32/42)        
remote: Counting objects:  78% (33/42)        
remote: Counting objects:  80% (34/42)        
remote: Counting objects:  83% (35/42)        
remote: Counting objects:  85% (36/42)        
remote: Counting objects:  88% (37/42)        
remote: Counting objects:  90% (38/42)        
remote: Counting objects:  92% (39/42)        
remote: Counting objects:  95% (40/42)        
remote: Counting objects:  97% (41/42)        
remote: Counting objects: 100% (42/42)        
remote: Counting objects: 100% (42/42), done.        
remote: Compressing objects:   5% (1/20)        
remote: Compressing objects:  10% (2/20)        
remote: Compressing objects:  15% (3/20)        
remote: Compressing objects:  20% (4/20)        
remote: Compressing objects:  25% (5/20)        
remote: Compressing objects:  30% (6/20)        
remote: Compressing objects:  35% (7/20)        
remote: Compressing objects:  40% (8/20)        
remote: Compressing objects:  45% (9/20)        
remote: Compressing objects:  50% (10/20)        
remote: Compressing objects:  55% (11/20)        
remote: Compressing objects:  60% (12/20)        
remote: Compressing objects:  65% (13/20)        
remote: Compressing objects:  70% (14/20)        
remote: Compressing objects:  75% (15/20)        
remote: Compressing objects:  80% (16/20)        
remote: Compressing objects:  85% (17/20)        
remote: Compressing objects:  90% (18/20)        
remote: Compressing objects:  95% (19/20)        
remote: Compressing objects: 100% (20/20)        
remote: Compressing objects: 100% (20/20), done.        
remote: Total 23 (delta 18), reused 7 (delta 3), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to '447d061bc7b978afedd3b0148715d2153ac726c5'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 447d061bc7 gh-97930: Apply changes from importlib_resources 5.10. (GH-100598)
Switched to and reset branch 'main'

Objects/obmalloc.c:776:1: warning: ‘always_inline’ function might not be inlinable [-Wattributes]
  776 | arena_map_get(pymem_block *p, int create)
      | ^~~~~~~~~~~~~

make: *** [Makefile:1895: buildbottest] Error 3

@jaraco
Copy link
Member Author

jaraco commented Jan 1, 2023

The buildbot failure appears unrelated to this change and highly isolated, so I'm going to assume it's a spurious failure.

Gatsik added a commit to Gatsik/client that referenced this pull request Aug 4, 2024
this version was in the recent 0.21.0 release and worked fine

the irc library is broken (for us) since jaraco/irc@c95c063
the reason is that it uses importlib.resources.files() to import codes
and this function is buggy -- it doesn't work with freezed code
(see also python/cpython#121735. wimglenn/resources-example#6)
and (what a coincidence!) broken implementation of files() function was written
by the same person -- see python/cpython#100598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants