summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. ↵Miss Islington (bot)2021-06-271-9/+1
| | | | | | | | | | (GH-26807) (GH-26929) Sync with importlib_metadata 4.6. (cherry picked from commit efe7d08d178a7c09bcca994f2068b019c8633d83) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* [3.10] bpo-44246: Restore compatibility in entry_points (GH-26468) (GH-26471)Miss Islington (bot)2021-05-311-1/+102
| | | | | | | | | | | | | * [bpo-44246](): Entry points performance improvements. From importlib_metadata 4.3.1. * [bpo-44246](): Sync with importlib_metadata 4.4 (cherry picked from commit c34ed08d975fb7daa7b329f7c631647782290393) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Automerge-Triggered-By: GH:jaraco
* bpo-44246: Entry points performance improvements. (GH-26467)Miss Islington (bot)2021-05-311-1/+23
| | | | | | From importlib_metadata 4.3.1. (cherry picked from commit 410b70d39d9d77384f8b8597560f6731530149ca) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* [3.10] bpo-44241: Incorporate changes from importlib_metadata 4.1. ↵Miss Islington (bot)2021-05-273-8/+28
| | | | | | | | | | (GH-26382) (GH-26395) (cherry picked from commit 06ac3a4742228b0230981720060248a7425b2486) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Automerge-Triggered-By: GH:jaraco
* bpo-38693: Prefer f-strings in importlib.resources (importlib_resources ↵Miss Islington (bot)2021-05-263-9/+6
| | | | | | | | | | 5.0.6). (GH-26387) (#26389) Automerge-Triggered-By: GH:jaraco (cherry picked from commit f6fbdb90ee450ad693f7a7809035d0dc968f98b7) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-38693: importlib.metadata f-strings (GH-26383)Miss Islington (bot)2021-05-261-5/+4
| | | | | | Automerge-Triggered-By: GH:jaraco (cherry picked from commit e6c815d2e34be5fdf6dbe773f0781691746d2289) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-44210: make importlib.metadata._meta.PackageMetadata public (GH-26299)Miss Islington (bot)2021-05-231-0/+2
| | | | | | | | Signed-off-by: Filipe Laíns <lains@riseup.net> Automerge-Triggered-By: GH:jaraco (cherry picked from commit df7eeacd83f531dd67cec7bc483dec6dce17ddbd) Co-authored-by: Filipe Laíns <lains@riseup.net>
* [3.10] bpo-43643: Sync with python/importlib_resources@c17a610aad. ↵Miss Islington (bot)2021-05-212-1/+3
| | | | | | | | | | | | (GH-26284) (GH-26286) * [bpo-43643](): Sync with python/importlib_resources@c17a610aad. * Sync with python/importlib_resources@89fd5e961a. (cherry picked from commit 875b3d84b3072b2d3c352ad9f0ff52c441fbd12e) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Automerge-Triggered-By: GH:jaraco
* bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565)Jason R. Coombs2021-05-027-23/+200
| | | | | | | | | * bpo-43926: Cleaner metadata with PEP 566 JSON support. * Add blurb * Add versionchanged and versionadded declarations for changes to metadata. * Use descriptor for PEP 566
* bpo-43754: Eliminate bindings for partial pattern matches (GH-25229)Brandt Bucher2021-05-021-1/+2
|
* bpo-42739: Don't use sentinels to mark end of line table. (GH-25657)Mark Shannon2021-04-291-1/+2
| | | | | * Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust. * Update PyCodeAddressRange to match PEP 626.
* bpo-43780: Sync with importlib_metadata 3.10 (GH-25297)Jason R. Coombs2021-04-243-75/+258
| | | | | | | * bpo-43780: Sync with importlib_metadata 3.10. * Add blurb * Apply changes from importlib_metadata 3.10.1.
* bpo-38605: Revert making 'from __future__ import annotations' the default ↵Pablo Galindo2021-04-211-1/+2
| | | | | | (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
* Correct micro release number and add a couple of asserts. (GH-25224)Mark Shannon2021-04-071-1/+1
|
* bpo-43105: Importlib now resolves relative paths when creating module spec ↵Steve Dower2021-04-071-19/+62
| | | | objects from file locations (GH-25121)
* bump the bytecode magic number (GH-25225)Dennis Sweeney2021-04-061-1/+1
|
* bpo-42135: Deprecate implementations of find_module() and find_loader() ↵Brett Cannon2021-04-064-7/+37
| | | | (GH-25169)
* bpo-43683: Handle generator entry in bytecode (GH-25138)Mark Shannon2021-04-061-0/+1
| | | | | | * Handle check for sending None to starting generator and coroutine into bytecode. * Document new bytecode and make it fail gracefully if mis-compiled.
* bpo-27129: Update magic numbers and bootstrapping for GH-25069 (GH-25172)Dennis Sweeney2021-04-041-1/+1
| | | | | | | * Update magic numbers and bootstrapping for GH-25069 * add blurb Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-43720: Update import-related stdlib deprecation messages to say they ↵Brett Cannon2021-04-031-3/+6
| | | | will be removed in Python 3.12 (GH-25167)
* bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)Brett Cannon2021-04-021-1/+4
|
* bpo-27129: Use instruction offsets, not byte offsets, in bytecode and ↵Mark Shannon2021-04-011-0/+1
| | | | | | | internally. (GH-25069) * Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps. * Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber
* bpo-42134: Raise ImportWarning when calling find_module() in the import ↵Brett Cannon2021-03-302-2/+6
| | | | system (GH-25044)
* bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)Brett Cannon2021-03-263-2/+9
|
* bpo-42137: have ModuleType.__repr__ prefer __spec__ over module_repr() ↵Brett Cannon2021-03-241-14/+6
| | | | | (GH-24953) This is to work towards the removal of the use of module_repr() in Python 3.12 (documented as deprecated since 3.4).
* bpo-43428: Improve documentation for importlib.metadata changes. (GH-24858)Jason R. Coombs2021-03-151-2/+18
| | | | | | | * bpo-43428: Sync with importlib_metadata 3.7.3 (16ac3a95) * Add 'versionadded' for importlib.metadata.packages_distributions * Add section in what's new for Python 3.10 highlighting most salient changes and relevant backport.
* bpo-43428: Sync with importlib_metadata 3.7. (GH-24782)Jason R. Coombs2021-03-132-25/+220
| | | | | | | * bpo-43428: Sync with importlib_metadata 3.7.2 (67234b6) * Add blurb * Reformat blurb to create separate paragraphs for each change included.
* bpo-42129: Add support for resources in namespaces (GH-24670)Jason R. Coombs2021-03-046-88/+270
| | | | | * Unify behavior in ResourceReaderDefaultsTests and align with the behavior found in importlib_resources. * Equip NamespaceLoader with a NamespaceReader. * Apply changes from importlib_resources 5.0.4
* bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917)Brandt Bucher2021-02-261-1/+2
| | | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Talin <viridia@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-42382: In importlib.metadata, `EntryPoint` objects now expose `dist` ↵Jason R. Coombs2020-12-311-66/+119
| | | | | | | | | | | | | | (#23758) * bpo-42382: In importlib.metadata, `EntryPoint` objects now expose a `.dist` object referencing the `Distribution` when constructed from a `Distribution`. Also, sync importlib_metadata 3.3: - Add support for package discovery under package normalization rules. - The object returned by `metadata()` now has a formally-defined protocol called `PackageMetadata` with declared support for the `.get_all()` method. * Add blurb * Remove latent footnote.
* bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly ↵Mark Shannon2020-12-171-1/+2
| | | | | | | | | after raising or reraising an exception (GH-23803) * Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626. * Update importlib * Add NEWS.
* bpo-26131: Deprecate usage of load_module() (GH-23469)Brett Cannon2020-12-043-8/+23
| | | Raise an ImportWarning when the import system falls back on load_module(). As for implementations of load_module(), raise a DeprecationWarning.
* bpo-42202: Store func annotations as a tuple (GH-23316)Yurii Karabas2020-11-251-1/+2
| | | | | | | | | | | | | Reduce memory footprint and improve performance of loading modules having many func annotations. >>> sys.getsizeof({"a":"int","b":"int","return":"int"}) 232 >>> sys.getsizeof(("a","int","b","int","return","int")) 88 The tuple is converted into dict on the fly when `func.__annotations__` is accessed first. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-42403: Use @staticmethod in importlib (GH-23395)Victor Stinner2020-11-202-16/+16
| | | | | | | | | | | | | Use @staticmethod on methods using @classmethod but don't use their cls parameter on the following classes: * BuiltinImporter * FrozenImporter * WindowsRegistryFinder * PathFinder Leave methods using @_requires_builtin or @_requires_frozen unchanged, since this decorator requires the wrapped method to have an extra parameter (cls or self).
* bpo-42403: Simplify importlib external bootstrap (GH-23397)Victor Stinner2020-11-193-65/+55
| | | | | | | Simplify the importlib external bootstrap code: importlib._bootstrap_external now uses regular imports to import builtin modules. When it is imported, the builtin __import__() function is already fully working and so can be used to import builtin modules like sys.
* bpo-42403: Fix pyflakes warnings in importlib (GH-23396)Victor Stinner2020-11-193-4/+0
| | | Remove unused imports and unused local variables.
* Bump magic number. (GH-23245)Mark Shannon2020-11-121-1/+2
|
* bpo-41490: ``path`` and ``contents`` to aggressively close handles (#22915)Jason R. Coombs2020-10-253-16/+32
| | | | | | | | | * bpo-41490: ``path`` method to aggressively close handles * Add blurb * In ZipReader.contents, eagerly evaluate the contents to release references to the zipfile. * Instead use _ensure_sequence to ensure any iterable from a reader is eagerly converted to a list if it's not already a sequence.
* bpo-42089: Sync with current cpython branch of importlib_metadata (GH-22775)Barry Warsaw2020-10-191-0/+9
| | | | | ~~The only differences are in the test files.~~ Automerge-Triggered-By: @jaraco
* bpo-38605: bump the magic number for 'annotations' future (#22630)Batuhan Taskaya2020-10-101-1/+2
|
* bpo-40924: Ensure importlib.resources.path returns an extant path (GH-20857)Jason R. Coombs2020-06-291-1/+12
|
* bpo-41006: importlib.util no longer imports typing (GH-20938)Victor Stinner2020-06-173-49/+53
| | | | Create importlib._abc submodule to avoid importing typing when importlib.util is imported. Move Loader ABC into importlib._abc.
* bpo-39791 native hooks for importlib.resources.files (GH-20576)Jason R. Coombs2020-06-085-115/+110
| | | | | | | | | | | | | | | | | | | | | | | | | * Provide native .files support on SourceFileLoader. * Add native importlib.resources.files() support to zipimporter. Remove fallback support. * make regen-all * 📜🤖 Added by blurb_it. * Move 'files' into the ResourceReader so it can carry the relevant module name context. * Create 'importlib.readers' module and add FileReader to it. * Add zip reader and rely on it for a TraversableResources object on zipimporter. * Remove TraversableAdapter, no longer needed. * Update blurb. * Replace backslashes with forward slashes. * Incorporate changes from importlib_metadata 2.0, finalizing the interface for extension via get_resource_reader. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)Jason R. Coombs2020-06-051-5/+25
| | | | | | | * Refresh importlib.metadata from importlib_metadata 1.6.1. * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-19468: delete unnecessary instance check in importlib.reload() (GH-19424)Furkan Önder2020-06-051-4/+4
| | | Automerge-Triggered-By: @brettcannon
* bpo-39791: Add files() to importlib.resources (GH-19722)Jason R. Coombs2020-05-083-102/+217
| | | | | | | | | * bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5). * 📜🤖 Added by blurb_it. * Add some documentation about the new objects added. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40443: Remove unused imports in stdlib (GH-19815)Victor Stinner2020-05-011-2/+1
|
* bpo-40050: Fix importlib._bootstrap_external (GH-19135)Victor Stinner2020-03-241-21/+13
| | | | | | Remove two unused imports: _thread and _weakref. Avoid creating a new winreg builtin module if it's already available in sys.modules. The winreg module is now stored as "winreg" rather than "_winreg".
* bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627)idomic2020-03-091-2/+2
| | | | | The importlib module now ignores the PYTHONCASEOK environment variable when the -E or -I command line options are being used.
* bpo-38091: Import deadlock detection causes deadlock (GH-17518)Armin Rigo2020-03-031-0/+9
| | | Automerge-Triggered-By: @brettcannon