Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 730426 - distutils-r1 fails with single impl pyproject.toml project. Invalid use dep: '%PYTHON_USEDEP-NEEDS-TO-BE-USED-IN-PYTHON_GEN_COND_DEP%
Summary: distutils-r1 fails with single impl pyproject.toml project. Invalid use dep: ...
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:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-02 01:21 UTC by Marco Sirabella
Modified: 2020-07-02 08:29 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 Marco Sirabella 2020-07-02 01:21:24 UTC
Any ebuild with `DISTUTILS_SINGLE_IMPL=1` & `DISTUTILS_USE_SETUPTOOLS=pyproject.toml` fails early on with:
`BDEPEND: Invalid atom (Invalid use dep: '%PYTHON_USEDEP-NEEDS-TO-BE-USED-IN-PYTHON_GEN_COND_DEP%'), token 11` because the `${PYTHON_USEDEP}` is not properly escaped for the single impl usecase.

```
	if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
		local sdep=">=dev-python/setuptools-42.0.2[${PYTHON_USEDEP}]"
	else
		local sdep="$(python_gen_cond_dep '
			>=dev-python/setuptools-42.0.2[${PYTHON_MULTI_USEDEP}]
		')"
	fi

	case ${DISTUTILS_USE_SETUPTOOLS} in
		no|manual)
			;;
		bdepend)
			bdep+=" ${sdep}"
			;;
		rdepend)
			bdep+=" ${sdep}"
			rdep+=" ${sdep}"
			;;
		pyproject.toml)
			bdep+=" dev-python/pyproject2setuppy[${PYTHON_USEDEP}]"
			;;
		*)
			die "Invalid DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}"
			;;
	esac
```

Reproducible: Always

Steps to Reproduce:
1. 
```
PYTHON_COMPAT=( python3_{6,7} )
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_SETUPTOOLS=pyproject.toml

inherit distutils-r1
```

2. ebuild
3. fail
Actual Results:  
  BDEPEND: Invalid atom (Invalid use dep: '%PYTHON_USEDEP-NEEDS-TO-BE-USED-IN-PYTHON_GEN_COND_DEP%'), token 11


Expected Results:  
Single impl with pyproject.toml
Comment 1 Larry the Git Cow gentoo-dev 2020-07-02 08:29:28 UTC
The bug has been closed via the following commit(s):

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

commit c7299c1ecaed5e1103b9a07c08386d8457a2dd73
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-07-02 08:08:36 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-07-02 08:29:17 +0000

    distutils-r1.eclass: Fix pyproject.toml w/ single-r1
    
    Closes: https://bugs.gentoo.org/730426
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/distutils-r1.eclass | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)