Brett Cannon
8d11013169
Implement InspectLoader for FrozenImporter.
2009-03-15 02:20:16 +00:00
Brett Cannon
a113ac58be
Implement InspectLoader for BuiltinImporter.
2009-03-15 01:41:33 +00:00
Brett Cannon
f87e04d339
Finish properly hiding importlib implementation code.
2009-03-12 22:47:53 +00:00
Brett Cannon
c59cd68847
Add a NOTE for importlib to fill in the docstrings for the ABCs.
2009-03-11 05:14:27 +00:00
Brett Cannon
2cf03a8204
Implement importlib.util.set_loader: a decorator to automatically set
...
__loader__ on modules.
2009-03-10 05:17:37 +00:00
Brett Cannon
d43b30b046
Implement get_source for importlib.abc.PyLoader using source_path and get_data.
2009-03-10 03:29:23 +00:00
Brett Cannon
e2085bedf1
Clean up importlib NOTES so it only contains short term goals.
2009-03-09 07:54:33 +00:00
Brett Cannon
2a922ed6ad
Introduce importlib.abc. The module contains various ABCs related to imports
...
(mostly stuff specified by PEP 302). There are two ABCs, PyLoader and
PyPycLoader, which help with implementing source and source/bytecode loaders by
implementing load_module in terms of other methods. This removes a lot of
gritty details loaders typically have to worry about.
2009-03-09 03:35:50 +00:00
Brett Cannon
57b46f5b0e
Expose importlib.util.set___package__.
2009-03-02 14:38:26 +00:00
Brett Cannon
91cf882b36
Refactor source and bytecode file loaders in importlib so that there
...
are source-only and source/bytecode loaders.
2009-02-21 05:41:15 +00:00
Brett Cannon
0515619dbc
Tweak the source/bytecode loader from importlib to use more of the PEP 302
...
protocol API.
2009-02-21 03:53:06 +00:00
Brett Cannon
4afab6b30b
Separate out finder for source and source/bytecode.
2009-02-21 03:31:35 +00:00
Brett Cannon
a2fcb1d964
Add some notes about importlib and some API exposure cleanup.
2009-02-21 03:12:17 +00:00
Brett Cannon
22db67ed26
Minor NOTES changes for importlib.
2009-02-21 02:51:12 +00:00
Brett Cannon
33dbf46544
Outline a possible way to separate out source loading from bytecode loading.
2009-02-17 07:15:17 +00:00
Brett Cannon
d2e7b33815
Implement the more specific PEP 302 semantics for loaders and what happens upon
...
load failure in relation to reloads. Also expose
importlib.util.module_for_loader to handle all of the details of this along
with making sure all current loaders behave nicely.
2009-02-17 02:45:03 +00:00
Brett Cannon
debb98d91f
Document importlib.machinery.PathFinder.
2009-02-16 04:18:01 +00:00
Brett Cannon
4b4a4a5922
Add a NOTE about the new specific semantics for failed loads.
2009-02-15 05:46:50 +00:00
Brett Cannon
c1761b7cd5
Add a NOTE that alternative VMs should be supported by importlib in a nicer
...
fashion by factoring out bytecode support.
2009-02-09 21:51:29 +00:00
Brett Cannon
b2071f8684
Update NOTES for importlib now that a replacement for functools.wraps is
...
available.
2009-02-07 02:14:07 +00:00
Brett Cannon
51d8bfc837
Create a simple substitute for functools.wraps to use in importlib._bootstrap.
2009-02-07 02:13:28 +00:00
Brett Cannon
534b2cd176
Factor out helper code from importlib.test.extension.test_path_hook.
2009-02-07 02:06:43 +00:00
Brett Cannon
36d1f3eb41
Add a note for importlib about backporting some of functools.wraps functionality.
2009-02-07 01:57:14 +00:00
Brett Cannon
06c9d96b70
Move importlib completely over to using rpartition and accepting the empty
...
string for top-level modules.
2009-02-07 01:52:25 +00:00
Brett Cannon
2c318a1390
Rewrite the code implementing __import__ for importlib. Now it is much simpler
...
and relies much more on meta path finders to abstract out various parts of
import.
As part of this the semantics for import_module tightened up and now follow
__import__ much more closely (biggest thing is that the 'package' argument must
now already be imported, else a SystemError is raised).
2009-02-07 01:15:27 +00:00
Brett Cannon
7f9876c0da
Initial, untested stab at writing a common denominator function for __import__
...
and import_module.
2009-02-06 02:47:33 +00:00
Brett Cannon
6411aa5dd4
Finish implementing tests for importlib.machinery.PathFinder by testing that
...
implicit hooks are handled properly.
2009-02-06 00:07:49 +00:00
Brett Cannon
64a3a65c26
Update NOTES for importlib about PathFinder.
2009-02-05 02:53:47 +00:00
Brett Cannon
438cecd3de
Add some notes for importlib to package up what is in Python 2.7 as well as modules that can probably get replaced by importlib at some point.
2009-02-02 20:32:29 +00:00
Brett Cannon
02a6888d91
Note to move __package__ stuff over to rpartition to make Nick happy. Also make
...
sure that accepting the empty string for top-level modules is okay.
2009-02-02 05:58:30 +00:00
Brett Cannon
20b56e1a1c
Update importlib notes.
2009-02-01 05:55:23 +00:00
Brett Cannon
ba96f0f89a
Ditch read_source() and read_bytecode() and replace with *_path() and
...
get_data().
2009-02-01 05:43:31 +00:00
Brett Cannon
51c502689c
Expose source_path and bytecode_path on _PyFileLoader.
2009-02-01 05:33:17 +00:00
Brett Cannon
6c3aaf3276
Remove an outdated todo item from importlib.
2009-02-01 05:04:06 +00:00
Brett Cannon
d720b36248
Move import semantic util code to importlib.test.import_.util.
2009-02-01 04:28:04 +00:00
Brett Cannon
bcb26c53c0
Rename importlib.test.support to importlib.test.util.
2009-02-01 04:00:05 +00:00
Brett Cannon
4ee2cdaf65
Split out support code that is specific to source tests out of
...
importlib.test.support to importlib.test.source.util.
2009-02-01 03:08:31 +00:00
Brett Cannon
30b047dc35
Move source loader tests (including reload tests) over to
...
importlib.test.abc.LoaderTests.
2009-02-01 02:05:11 +00:00
Brett Cannon
223a19d8b1
Fix importlib.machinery.FrozenImporter.load_module() to set __package__
...
properly. Discovered by also moving the loader tests over to
importlib.test.abc.LoaderTests.
2009-02-01 01:34:13 +00:00
Brett Cannon
e70485e7c1
Move extension module loader tests over to importlib.test.abc.LoaderTests.
2009-02-01 00:49:41 +00:00
Brett Cannon
d98a6a014d
Move built-in loader tests to importlib.test.abc.LoaderTests.
2009-02-01 00:37:13 +00:00
Brett Cannon
a74ccea968
Initial take on importlib.test.loader_tests.
2009-01-27 02:39:33 +00:00
Brett Cannon
dd827c403f
Update importlib NOTES.
2009-01-27 01:46:04 +00:00
Brett Cannon
d0005ff41f
Update NOTES for importlib.
2009-01-26 01:54:40 +00:00
Brett Cannon
78246b6b45
Document both importlib.machinery.BuiltinImporter and FrozenImporter.
2009-01-25 04:56:30 +00:00
Brett Cannon
5abdc93eb8
Add importlib.machinery with its first tenants, BuitinImporter and
...
FrozenImporter. Docs forthcoming.
I plan on all finders and loaders (and most likely hooks) to live
in imoprtlib.machinery. Utility stuff will end up in importlib.util.
Higher-level API stuff will stay on imoprtlib directly (e.g. import_module).
2009-01-22 22:43:07 +00:00
Brett Cannon
afccd63ac9
Document the (very small) public API for importlib. As time goes on and some
...
key refactorings occur more of the API will be exposed and documented.
2009-01-20 02:21:27 +00:00
Brett Cannon
24b6a2cf38
NOTES for importlib should mention the ultimate end-goal for the package.
2009-01-18 00:36:55 +00:00
Brett Cannon
23cbd8a656
Add initial implementation of importlib. See the NOTES files for what is
...
planned for the package.
There are no docs yet, but they are coming once the API for the first new
function, importlib.import_module() is finalized.
2009-01-18 00:24:28 +00:00