Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713894 - python-any-r1.eclass: needs PYTHON_SINGLE_USEDEP support
Summary: python-any-r1.eclass: needs PYTHON_SINGLE_USEDEP support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://archives.gentoo.org/gentoo-de...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-22 05:51 UTC by Michał Górny
Modified: 2020-12-23 10:14 UTC (History)
2 users (show)

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 2020-03-22 05:51:43 UTC
Technically, p-any-r1 can depend on single-impl packages, and such dependencies now require explicit PYTHON_SINGLE_USEDEP.  Since this isn't strictly necessary at the moment, and I see no reason to implement this early, let's keep the bug open in case anyone ends up needing it.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-17 16:15:57 UTC
@Nick, do you have a use case for this?
Comment 2 Nick Bowler 2020-12-17 16:25:15 UTC
I have an ebuild which used python-any-r1 to depend on fontforge[python] at build time.  Fontforge ebuild uses python-single-r1.

I just noticed (yesterday) that this is no longer installable, probably has been the case for some time due to python-single-r1 changes.  I'm not entirely sure what changed exactly but it sounds to me like this feature is now necessary?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-17 16:53:37 UTC
Ok, thanks for the info.  Now that it could actually be used, I'm going to look into implementing it in the next few days.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-17 21:25:44 UTC
I've just sent patches to gentoo-dev.  I'd appreciate if you could test whether they work for you.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-17 21:27:06 UTC
Also here, if GH is more convenient for you:

https://github.com/gentoo/gentoo/compare/master...mgorny:python-any-usedeps
Comment 6 Nick Bowler 2020-12-18 03:57:44 UTC
The eclasses pulled from the tip of your python-any-usedeps branch (with
all four patches applied) seem to be working at a first glance.

For the record, I changed in my ebuild:

  # Old (boring) way (EAPI 6) -- no longer working
  DEPEND="$(python_gen_any_dep \
    'media-gfx/fontforge[python,${PYTHON_USEDEP}]')"

  python_check_deps () {
    has_version "media-gfx/fontforge[${PYTHON_USEDEP}]"
  }

to

  # New (exciting) way (EAPI 7)
  BDEPEND="$(python_gen_any_dep \
    'media-gfx/fontforge[python,${PYTHON_SINGLE_USEDEP}]')"

  python_check_deps () {
    has_version -b "media-gfx/fontforge[${PYTHON_SINGLE_USEDEP}]"
  }

And manually inspected the resulting dependency string with new eclass, which
seems to be sensible:

  || ( ( dev-lang/python:3.8
         media-gfx/fontforge[python,python_single_target_python3_8(-)] )
       [ ... and so on ... ]
  )

And confirmed the package actually satisfies dependencies and compiles using
the correct python version.  Didn't test anything else.

Thanks!
Comment 7 Larry the Git Cow gentoo-dev 2020-12-23 10:14:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af76aa5899fa0c9acbefe94891449321f02f70cd

commit af76aa5899fa0c9acbefe94891449321f02f70cd
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-12-17 21:15:56 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-12-23 10:14:45 +0000

    python-any-r1.eclass: Support PYTHON_SINGLE_USEDEP
    
    Closes: https://bugs.gentoo.org/713894
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/python-any-r1.eclass | 48 +++++++++++++++++++++++++++++++++++----------
 1 file changed, 38 insertions(+), 10 deletions(-)