Python guidelines cleanup

Thomas Spura tomspur at fedoraproject.org
Fri Jul 31 06:53:10 UTC 2015


Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl> schrieb am Fr., 31. Juli
2015 um 06:06 Uhr:

> On Thu, Jul 30, 2015 at 07:34:48PM -0500, Jason L Tibbitts III wrote:
> > After some additional discussion and cleanup, I've gone ahead and moved
> > my drafts into place in the main guidelines.  Please let me know if I've
> > made any mistakes or typos or left out anything important.
> There's a dead link in "Example common spec file".
>
> > However, there is one thing I'm trying to understand about the new
> > guidelines (which came from one of the submitted drafts, not something
> > that I wrote).  They say:
> >
> > "
> > The following is a very simple spec file for a module building for both
> > python2 and python3. It builds both versions in the same directory; this
> > is possible because setuptools uses different build directories for
> > different python versions and architectures. In addition, python3 will
> > include the version of the interpreter in the names of generated files,
> > so the build products don't conflict. (Of course this only works if a
> > package builds for a single python2 version, which should always be the
> > case in Fedora.)
> > "
> >
> > Which is fine, except that I must be missing something about the second
> > sentence.  Setuptools in f22 and rawhide (which I know are different
> > versions) seems to use "build" regardless of which python version is
> > used to execute setup.py.  Am I misunderstanding what that sentence is
> > trying to tell me?
> I wrote that. I turns out, which I didn't know at the time, that this is
> only true for binary modules
> (for example python-systemd has build/{lib,temp}.linux-x86_64-{2.7,3.4}).
> For pure-python modules it seems to use a single build directory,
> but separate build/scripts directories.
>
> [ It seems that there's no nice way to tell setuptools/distutils/distribute
> to always use separate build directories. It still uses the same build
> directory even if 2to3 translation is specified in the setup.py file,
> which is
> probably a bug. In a pinch, it is possible to override the build dir with
> --build-lib. So something like this works, even if 2to3 is used:
> %{__python2} setup.py build --build-lib build/2
> %{__python3} setup.py build --build-lib build/3
> Fortunately this is rarely necessary.]
>

So either this is a bug in the case of 2to3 or the %py{2,3}_build macros
should implement this to work around it? Otherwise these packages would
need to be build within different build directories and the current
pushd/popd boilerplate.

   -Tom


> So I think the detailed justification should be removed, and the first
> paragraph of "Example common spec file" replaced with something like this:
>
> "The following is a very simple spec file for a module building for
> both python2 and python3. It builds both versions in the same
> directory; this is possible because build products for different
> versions of Python usually do not conflict."
>
> > For the package I'm using for testing (python-requests) it turns out
> > that the results of %py2_build and %py3_build are completely identical,
> > but this might just be coincidence.
>
> Zbyszek
> _______________________________________________
> python-devel mailing list
> python-devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/python-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/python-devel/attachments/20150731/d9c9d85b/attachment.html>


More information about the python-devel mailing list