[Distutils] PEP 420 on python2
Nick Coghlan
ncoghlan at gmail.com
Sat Jul 15 01:39:00 EDT 2017
On 15 July 2017 at 14:07, Asmodehn Shade <asmodehn at gmail.com> wrote:
> Hi,
>
> I had a look at libimport2, but I found out it was a bit buggy and I couldnt
> extend it as I had hoped.
That's unfortunately entirely plausible, as the downside of importlib
co-evolving with the import implementation in the interpreter is that
some of its internal assumptions don't necessarily hold when it gets
backported to earlier versions :(
> The custom importer I m working on basically extends PathFinder, FileFinder
> and SourceFileLoader, and I wanted to have the same implementation for py2
> and py3, so I ended up reimplementing the parts of importlib I needed in
> order to be able to extend from them, from py2 or py3, without any version
> specific code.
Ah, very cool!
> Now I m trying to find the best way to test it to make sure py2 +
> filefinder2 behaves like py3 as much as possible, so any insight would be
> helpful :-)
If you aren't already, it may be worthwhile running some of your test
cases under "python -v" and seeing if the output is stable enough
across different Python versions that filtering stderr for lines
starting with "import pkg_under_test" gets you a suitable test case
that isn't overly fragile.
Aside from that, the main suggestion I can think of would be to look
for relevant test cases in the Python 3 import and importlib test
suites and see if you can adapt them for filefinder2.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Distutils-SIG
mailing list