Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 815190 - python-any-r1 function python_gen_any_dep does not expand variables such as ${PV}
Summary: python-any-r1 function python_gen_any_dep does not expand variables such as $...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-27 22:06 UTC by François Bissey
Modified: 2021-09-27 22:50 UTC (History)
3 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 François Bissey 2021-09-27 22:06:11 UTC
I was trying to a BDEPEND block that would be more easily maintainable where dependency have to match the version of the current package in my overlay (sage-on-gentoo). My block was as follow
BDEPEND="$(python_gen_any_dep '
	>=dev-python/sphinx-4.1.0[${PYTHON_USEDEP}]
	~sci-mathematics/sage-${PV}[${PYTHON_USEDEP},jmol]
	~sci-mathematics/sage_docbuild-${PV}[${PYTHON_USEDEP}]
	')"

This was rejected when run through repoman with
[INFO] checking package sci-mathematics/sage-doc
  dependency.syntax [fatal]     2
   sci-mathematics/sage-doc/sage-doc-9999.ebuild: BDEPEND: Invalid atom (~sci-mathematics/sage-${PV}[python_targets_python3_9(-),jmol]), token 6
   sci-mathematics/sage-doc/sage-doc-9999.ebuild: BDEPEND: Invalid atom (~sci-mathematics/sage-${PV}[python_targets_python3_9(-),jmol]), token 6
Please fix these important QA issues first.

==
Replacing ${PV} by explicit values did go through. Using ${PV} in `python_check_deps` did not result in any issues as it got properly expanded there. 
Variables such as ${PV} should be properly expanded in `python_den_any_dep` if it is possible.

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-27 22:14:07 UTC
I think this may work if you use double quotes and then escape: https://dev.gentoo.org/~mgorny/python-guide/buildsys.html#single-impl-package
Comment 2 François Bissey 2021-09-27 22:18:44 UTC
(In reply to Sam James from comment #1)
> I think this may work if you use double quotes and then escape:
> https://dev.gentoo.org/~mgorny/python-guide/buildsys.html#single-impl-package

Does work! Thanks for the style assist Sam. I totally didn't see that example later in the manual.