Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 448068 - pyparsing-1.5.7+ has split versions for py2 & py3
Summary: pyparsing-1.5.7+ has split versions for py2 & py3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 10:24 UTC by Michał Górny
Modified: 2013-01-01 16:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 10:24:54 UTC
Up to 1.5.6, pyparsing had two .py files in the package -- one for py2 and one for py3. Then upstream split the package.

Now, pyparsing-1.5.7 supports only Python 2 and pyparsing-2.0.0 only Python 3. I'm not sure how compatible the versions are, the diff is a bit long.

What should we do now?

a) create an ugly mixed ebuild like pyparsing-1.5.7.2.0.0 which fetches both sources and installs one version or the other,

b) slot pyparsing, into 1.5.7:1 and 2.0.0:2. Create virtual/pyparsing which will grab the correct ebuild depending on Python implementations requested.
Comment 1 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 10:32:38 UTC
Solution (b) seems better so far, but you haven't listed any advantages/disadvantages of both approaches.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 10:50:42 UTC
Well, in short words:

a)

Advantages:
 1) we have only a single package for it,
 2) deps don't have to change.

Disadv.:
 1) hacky ebuild, hacky version numbers,
 2) i'm not sure if upstream is going to develop 1.* anymore,
 3) i don't think we're going to make sure that the codebases don't diverge.

2) could mean that we're going to have 1.5.7.2.0.0, then 1.5.7.2.0.1, and so on. And 3) would mean that at some point we may be actually installing two different versions of 'pyparsing' and pretending it's just one module which supports both py2 & py3.


b)

Advantages:
 1) clean, sane and so on,
 2) safe for upstream stopping to develop 2.x variant.

Disadvantages:
 1) more packages,
 2) need to update the deps in the tree.

In case upstream stops supporting 1.* and 2.* diverges too much, we can just add a new virtual/ version which does not support python-2 at all.
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 10:57:23 UTC
Thanks, that's useful. Put like that, creating a virtual seems a bit heavy-weight; is it possible to come up with a way to get the deps right without that? Perhaps the depending package could grow yet another variable?

PY_VER_DEP="py2? dep:1 py3? dep:2"
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 11:05:11 UTC
(In reply to comment #3)
> Thanks, that's useful. Put like that, creating a virtual seems a bit
> heavy-weight; is it possible to come up with a way to get the deps right
> without that? Perhaps the depending package could grow yet another variable?
> 
> PY_VER_DEP="py2? dep:1 py3? dep:2"

To be honest, I don't like this idea. It drops the responsibility for checking the pyparsing deps to the ebuilds, while being practically equivalent to the virtual.
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 11:13:38 UTC
Silly idea: hard-coded list in the eclass?
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 11:15:37 UTC
(In reply to comment #5)
> Silly idea: hard-coded list in the eclass?

That's just reinventing the concept of virtuals in the eclass IMO.
Comment 7 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 11:18:39 UTC
Maybe, but it does get rid of the disadvantages you mention for (b): (1), we don't have more packages, and (2) we don't need to update the deps in the tree.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 11:22:31 UTC
(In reply to comment #7)
> Maybe, but it does get rid of the disadvantages you mention for (b): (1), we
> don't have more packages, and (2) we don't need to update the deps in the
> tree.

But we have more code in the eclass which is a bit package-centric. That starts to raise questions, and all the metadata in the tree needs to be updated.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 11:24:11 UTC
(In reply to comment #7)
> Maybe, but it does get rid of the disadvantages you mention for (b): (1), we
> don't have more packages, and (2) we don't need to update the deps in the
> tree.

I'd forget: how can we do it?

I don't think it will be really helpful to say 'for pyparsing dep, you need to use $(python_get_pyparsing_dep) instead of the package dep'...
Comment 10 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 12:14:32 UTC
> I don't think it will be really helpful to say 'for pyparsing dep, you need
> to use $(python_get_pyparsing_dep) instead of the package dep'...

How I would code it in python:

VERDEP = {"dev-python/pyparsing": [['=', '1.5.7'], ['>=', 2.0.0']]}
for dep in pkg_deps:
  if dep.pkg in VERDEP:
    pkg_deps.remove(dep)
    new = VERDEP[dep.pkg]
    pkg_deps.append(new[0] + dep.pkg + '-' + new[1])
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 12:22:26 UTC
(In reply to comment #10)
> > I don't think it will be really helpful to say 'for pyparsing dep, you need
> > to use $(python_get_pyparsing_dep) instead of the package dep'...
> 
> How I would code it in python:
> 
> VERDEP = {"dev-python/pyparsing": [['=', '1.5.7'], ['>=', 2.0.0']]}
> for dep in pkg_deps:
>   if dep.pkg in VERDEP:
>     pkg_deps.remove(dep)
>     new = VERDEP[dep.pkg]
>     pkg_deps.append(new[0] + dep.pkg + '-' + new[1])

I understand your intent but eclass can't access or modify package dependencies. It would need to be something explicitly requested by the package.

Therefore, it's only the question of whether user puts well-known virtual/pyparsing or something like $(python_get_pyparsing_dep). With the virtual being a common way of handling that kind of deps, and eclass being a custom solution which is a bit too centric IMO, esp. with the design of the eclasses.
Comment 12 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 12:34:52 UTC
Alright, let's just go with the virtual, then. Mike, agree?
Comment 13 Mike Gilbert gentoo-dev 2012-12-21 19:54:46 UTC
Yeah, virtual sounds good to me. I don't like the idea of combining two packages that have been separated upstream.
Comment 14 Arfrever Frehtes Taifersar Arahesis 2012-12-21 21:57:19 UTC
Another possibility is to have pyparsing-2 (in a new slot), which nominally supports all versions of Python, but does not install any files for Python 2, and depends on:
2.5? ( =dev-python/pyparsing-1*[2.5] )
2.6? ( =dev-python/pyparsing-1*[2.6] )
2.7? ( =dev-python/pyparsing-1*[2.7] )
...

Then reverse dependencies would not need to be migrated to depend on a virtual.
Comment 15 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-12-21 21:59:44 UTC
Ooh, I must admit I rather like that idea.
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 22:05:03 UTC
(In reply to comment #14)
> Another possibility is to have pyparsing-2 (in a new slot), which nominally
> supports all versions of Python, but does not install any files for Python
> 2, and depends on:
> 2.5? ( =dev-python/pyparsing-1*[2.5] )
> 2.6? ( =dev-python/pyparsing-1*[2.6] )
> 2.7? ( =dev-python/pyparsing-1*[2.7] )
> ...
> 
> Then reverse dependencies would not need to be migrated to depend on a
> virtual.

Good time to wake up. I've just committed the virtual...

But it's basically the same idea as the both-in-one ebuild, just that you put it out to two ebuilds...
Comment 17 Arfrever Frehtes Taifersar Arahesis 2012-12-21 22:12:27 UTC
This idea does not have any disadvantages mentioned for solution A from comment #0.

You should wait more than half day before implementing controversial changes.
Comment 18 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-21 22:19:56 UTC
(In reply to comment #17)
> This idea does not have any disadvantages mentioned for solution A from
> comment #0.
> 
> You should wait more than half day before implementing controversial changes.

What is 'controversial' here?
Comment 19 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-01-01 16:03:43 UTC
The virtual and the ebuild are now committed.