pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[HEADS UP] Python-3.x support improved



Hi!

I've just committed changes to pkgsrc allowing python-3.x to be used
as default more easily. For this, I've removed the
PYTHON_VERSIONS_INCLUDE_3X variable that was supposed to be set
per-package to allow a package to be built against python-3.x. This is
now allowed by default.

To try it out, set PYTHON_VERSION_DEFAULT=33 in your /etc/mk.conf; I
suggest rebuilding all packages from scratch if you do that.

To make this useful, I've also marked many packages explicitly as not
building or working correctly with python-3.x, either because they
themselves are not ready or because a dependency isn't. This is
annotated by

PYTHON_VERSIONS_INCOMPATIBLE=  33 # not yet ported as of x.y.z

or

PYTHON_VERSIONS_INCOMPATIBLE=  33 # py-foo, py-bar

respectively. Please use the same style for other packages, try with
both python-2.7 and python-3.3 during updates, and keep the
information up-to-date.

Previously I had already added lang/python/versioned_dependencies.mk
which automatically switches between the python-2.x and python-3.x
versions of packages where these are provided as separate tarballs.
See that file for details.


Some comments on packaging python modules in general:

Use distutils.mk or egg.mk, not extension.mk.

Don't write your own python path fixer, use REPLACE_PYTHON (including
application.mk).

Remove python or py from PKGNAME -- pkgsrc has the "py-" prefix for
python modules.

Use REPLACE_PYTHON instead of writing your own fixers (you need to
include lang/python/application.mk for that).

Some packages are not smart enough to know about PEP 3147, which
specifies a __pycache__ directory as location for pre-compiled python
modules. You can mark such packages with

PY_PEP3147=    no

to fix package installation with python-3.x.

Let me know if I broke anything. I've done multiple bulk builds of
~3700 packages, but I might have overlooked something.

Cheers,
 Thomas


Home | Main Index | Thread Index | Old Index