bsd.python.mk: python3 plist shim

Marcus von Appen mva at FreeBSD.org
Wed Jan 23 18:28:32 UTC 2013


Hi,

On, Wed Jan 23, 2013, Ruslan Makhmatkhanov wrote:

> Marcus von Appen wrote on 23.01.2013 20:50:
> > Hi,
> >
> > On, Wed Jan 23, 2013, Ruslan Makhmatkhanov wrote:
> >
> >>
> >> Hello,
> >>
> >> I'm planning to apply this patch to Mk/bsd.python.mk soon. It's an
> >> nivit's solution from devel/py-virtualenv for changes, introduced in PEP
> >> 3147 [1]. It will not affect default packages build, because packages
> >> are not yet building for python3 on cluster, but it will affect python
> >> ports, built with python3, that already has fix like that applied
> >> locally. I tested it with dozen of ports and everything seems fine.
> >> Local fixes will be removed right after this change. Please tell me if
> >> there is any objections or suggestions on this. Thanks.
> >
> > [...]
> >
> > I still do not get what the patch should exactly do and I am too lazy to
> > refresh my awk skills and try it out myself. If that patch is just about
> > the [INSERT cpython-correct-XX].pyc stuff, there is no need for it in my
> > opinion.
> > Can you please provide details on what the patch does?
> >
> > Cheers
> > Marcus
>
> Yes, it does just that by adding __pycache__ directories with compiled
> and optimized bytecode into pkg-plist. This allows us to make packages
> for python 3.2+ successfully.
>
> I can't explain more than that, because I treat that as some magic
> sequence for fixing py3 packages and that already applied locally in
> many ports, so it's time to just stop duplicating this pattern over the
> tree.
[...]

Okay, understood. If we have a pkg-plist with a file entry

/path/foo.pyc

it changes the file path in .TMPPLIST to

/path/__pycache__/foo<magicno>.pyc

without the need for us to fix up hundreds of plist files, correct?

Is that automated patch safe for pkg usage? As far as I remember, pkg
picks up .TMPPLIST rather than pkg-plist or anything else, so I assume
it to be safe and working without any problem, but we should follow up
on that with the pkg@ team, if you did not verify that already.

Also, we have to bear in mind existing python3.2+ ports within the ports
tree, for which the pkg-plist files might need a cleanup regarding the
already existing __pycache__ entries (or does the patch deal with them
properly?).

And just to throw in something else: we really, really should support
$PYTHONDONTWRITECODE (or the -B flag), remove all the pyc/pyo stuff
completely from the pkg-plist files and move the logic conditionally
into bsd.python.mk (somewhat similar to your patch)[0].

Would it make sense to merge that idea[0] with your patch?

[0] https://wiki.freebsd.org/Ports/Python/CompiledPackages
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/168640

Cheers
Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-python/attachments/20130123/5c4bccc9/attachment.sig>


More information about the freebsd-python mailing list