Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Add pypy3 compat to tests, and add support for dev-lang/pypy #708

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pkgcheck/checks/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_python_eclass(pkg):


def is_python_interpreter(pkg):
if pkg.key == "dev-lang/python":
if pkg.key in ("dev-lang/pypy", "dev-lang/python"):
# ignore python:2.7 deps since they are being phased out from eclass
# support
return pkg.slot is None or not pkg.slot.startswith("2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ diff -Naur python/PythonCheck/DistutilsNonPEP517Build/DistutilsNonPEP517Build-0.
EAPI=7

+DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit distutils-r1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EAPI=7

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit distutils-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=6

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit python-any-r1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EAPI=7
PYTHON_COMPAT=( python3_9 )
PYTHON_COMPAT=( pypy3 python3_9 )

inherit python-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ EAPI=8

DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit distutils-r1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ EAPI=8

DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=no
PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit distutils-r1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_10 )
PYTHON_COMPAT=( pypy3 python3_10 )

inherit distutils-r1

Expand Down
6 changes: 6 additions & 0 deletions testdata/repos/python/dev-lang/pypy/pypy-2.7.7.3.17.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
EAPI=8

DESCRIPTION="Stub ebuild for pypy interpreter"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="2.7/1234"
6 changes: 6 additions & 0 deletions testdata/repos/python/dev-lang/pypy/pypy-3.10.7.3.17.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
EAPI=8

DESCRIPTION="Stub ebuild for pypy3 interpreter"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
LICENSE="BSD"
SLOT="3.10/pypy310-1234"
21 changes: 13 additions & 8 deletions testdata/repos/python/eclass/python-any-r1.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@

_python_set_impls() {
local i slot
local -a use
PYTHON_DEPS="|| ("
for i in "${PYTHON_COMPAT[@]}"; do
slot=${i#python}
slot=${slot/_/.}
use+=( "python_targets_${i}" )
PYTHON_DEPS+=" python_targets_${i}? ( dev-lang/python:${slot} )"
case ${i} in
python*)
slot=${i#python}
slot=${slot/_/.}
PYTHON_DEPS+=" dev-lang/python:${slot}"
;;
pypy3)
PYTHON_DEPS+=" >=dev-lang/pypy-3.10:="
;;
esac
done
IUSE+=" ${use[@]}"
PYTHON_REQUIRED_USE="|| ( ${use[@]} )"
PYTHON_USEDEP=$(IFS=","; echo "${use[*]}")
PYTHON_DEPS+=" )"
PYTHON_REQUIRED_USE='I-DO-NOT-EXIST-IN-PYTHON-ANY-R1'
}
_python_set_impls

Expand Down
13 changes: 10 additions & 3 deletions testdata/repos/python/eclass/python-r1.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ _python_set_impls() {
local i slot
local -a use
for i in "${PYTHON_COMPAT[@]}"; do
slot=${i#python}
slot=${slot/_/.}
use+=( "python_targets_${i}" )
PYTHON_DEPS+=" python_targets_${i}? ( dev-lang/python:${slot} )"
case ${i} in
python*)
slot=${i#python}
slot=${slot/_/.}
PYTHON_DEPS+=" python_targets_${i}? ( dev-lang/python:${slot} )"
;;
pypy3)
PYTHON_DEPS+=" python_targets_${i}? ( >=dev-lang/pypy-3.10:= )"
;;
esac
done
IUSE+=" ${use[@]}"
PYTHON_REQUIRED_USE="|| ( ${use[@]} )"
Expand Down
13 changes: 10 additions & 3 deletions testdata/repos/python/eclass/python-single-r1.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ _python_set_impls() {
local i slot
local -a use use_deps
for i in "${PYTHON_COMPAT[@]}"; do
slot=${i#python}
slot=${slot/_/.}
use+=( "python_single_target_${i}" )
PYTHON_DEPS+=" python_single_target_${i}? ( dev-lang/python:${slot} )"
case ${i} in
python*)
slot=${i#python}
slot=${slot/_/.}
PYTHON_DEPS+=" python_single_target_${i}? ( dev-lang/python:${slot} )"
;;
pypy3)
PYTHON_DEPS+=" python_single_target_${i}? ( >=dev-lang/pypy-3.10:= )"
;;
esac
done
IUSE+=" ${use[@]}"
PYTHON_REQUIRED_USE="^^ ( ${use[@]} )"
Expand Down
Loading