[Distutils] PEP 420 on python2

Asmodehn Shade asmodehn at gmail.com
Sat Jul 15 00:07:12 EDT 2017


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.

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.

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 :-)

Thanks !

On Jul 14, 2017 9:19 PM, "Nick Coghlan" <ncoghlan at gmail.com> wrote:

> On 14 July 2017 at 12:12, Asmodehn Shade <asmodehn at gmail.com> wrote:
> > Hi everyone,
> >
> > I m very new around here, I just wanted to let you know that while
> writing a
> > custom importer for py2 and py3, I ended up backporting some python3
> > libimport code to python2.
> >
> > The code is over there : https://github.com/asmodehn/filefinder2
> > This way I now support importing packages without __init__.py in python2.
> > It was simpler for my usecase than using pkg_resources or pkgutil.
>
> Nice!
>
> While it's more intrusive (since it essentially replaces the entire
> Python 2 import system with the Python 3 one), you may also find
> https://pypi.python.org/pypi/importlib2 of interest.
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170715/966eb985/attachment-0001.html>


More information about the Distutils-SIG mailing list