Skip to content

Commit 0a195c9

Browse files
committed
supports_cpython*() → supported_cpython*()
1 parent efea83f commit 0a195c9

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ What major versions of PyPy are there?
8888

8989
What CPython series do PyPy 7.3.\* support?
9090

91-
>>> vd.pypy.supports_cpython_series("7.3")
91+
>>> vd.pypy.supported_cpython_series("7.3")
9292
['2.7', '3.6', '3.7', '3.8']
9393

9494

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ What major versions of PyPy are there?
7676

7777
What CPython series do PyPy 7.3.\* support?
7878

79-
>>> vd.pypy.supports_cpython_series("7.3")
79+
>>> vd.pypy.supported_cpython_series("7.3")
8080
['2.7', '3.6', '3.7', '3.8']
8181

8282

src/pyversion_info/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def __init__(
387387
for v, versions in cpython_versions.items()
388388
}
389389

390-
def supports_cpython(self, version: str) -> List[str]:
390+
def supported_cpython(self, version: str) -> List[str]:
391391
"""
392392
Given a PyPy micro version, returns a list of the corresponding CPython
393393
micro versions in version order.
@@ -405,19 +405,19 @@ def supports_cpython(self, version: str) -> List[str]:
405405
except KeyError:
406406
raise UnknownVersionError(version)
407407

408-
def supports_cpython_series(
408+
def supported_cpython_series(
409409
self, version: str, released: bool = False
410410
) -> List[str]:
411411
"""
412412
Given a PyPy version, returns a list of all CPython series supported by
413413
that version or its subversions in version order. If ``released`` is
414414
true, only released versions are considered.
415415
416-
>>> db.supports_cpython_series("7.3.5")
416+
>>> db.supported_cpython_series("7.3.5")
417417
['2.7', '3.7']
418-
>>> db.supports_cpython_series("7.3")
418+
>>> db.supported_cpython_series("7.3")
419419
['2.7', '3.6', '3.7', '3.8']
420-
>>> db.supports_cpython_series("7")
420+
>>> db.supported_cpython_series("7")
421421
['2.7', '3.5', '3.6', '3.7', '3.8']
422422
423423
:raises UnknownVersionError: if there is no entry for ``version`` in

src/pyversion_info/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def show(
155155
(
156156
"cpython_series",
157157
"CPython-Series",
158-
info.supports_cpython_series(
158+
info.supported_cpython_series(
159159
version, released=subversions == "released"
160160
),
161161
)
@@ -177,15 +177,15 @@ def show(
177177
(
178178
"cpython_series",
179179
"CPython-Series",
180-
info.supports_cpython_series(
180+
info.supported_cpython_series(
181181
version, released=subversions == "released"
182182
),
183183
)
184184
)
185185
else:
186186
data.insert(1, ("level", "Level", "micro"))
187187
if isinstance(info, PyPyVersionInfo):
188-
data.append(("cpython", "CPython", info.supports_cpython(version)))
188+
data.append(("cpython", "CPython", info.supported_cpython(version)))
189189
if do_json:
190190
print(json.dumps({k: v for k, _, v in data}, indent=4, default=str))
191191
else:

test/test_pypy_info.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ def pypyinfo(version_database: VersionDatabase) -> PyPyVersionInfo:
7070
("7.3.7", ["3.7.12", "3.8.12"]),
7171
],
7272
)
73-
def test_supports_cpython(
73+
def test_supported_cpython(
7474
pypyinfo: PyPyVersionInfo, version: str, cpythons: List[str]
7575
) -> None:
76-
assert pypyinfo.supports_cpython(version) == cpythons
76+
assert pypyinfo.supported_cpython(version) == cpythons
7777

7878

7979
@pytest.mark.parametrize("v", INVALID_VERSIONS + ["7.3", "7"])
80-
def test_supports_cpython_invalid(pypyinfo: PyPyVersionInfo, v: str) -> None:
80+
def test_supported_cpython_invalid(pypyinfo: PyPyVersionInfo, v: str) -> None:
8181
with pytest.raises(ValueError) as excinfo:
82-
pypyinfo.supports_cpython(v)
82+
pypyinfo.supported_cpython(v)
8383
assert str(excinfo.value) == f"Invalid micro version: {v!r}"
8484

8585

8686
@pytest.mark.parametrize("v", ["0.8.0", "1.5.0", "3.0.0", "7.3.9", "9.0.0"])
87-
def test_supports_cpython_unknown(pypyinfo: PyPyVersionInfo, v: str) -> None:
87+
def test_supported_cpython_unknown(pypyinfo: PyPyVersionInfo, v: str) -> None:
8888
with pytest.raises(UnknownVersionError) as excinfo:
89-
pypyinfo.supports_cpython(v)
89+
pypyinfo.supported_cpython(v)
9090
assert str(excinfo.value) == f"Unknown version: {v!r}"
9191
assert excinfo.value.version == v
9292

@@ -99,12 +99,12 @@ def test_supports_cpython_unknown(pypyinfo: PyPyVersionInfo, v: str) -> None:
9999
],
100100
)
101101
@pytest.mark.parametrize("released", [False, True])
102-
def test_supports_cpython_series(
102+
def test_supported_cpython_series(
103103
pypyinfo: PyPyVersionInfo, version: str, released: bool, series: List[str]
104104
) -> None:
105-
assert pypyinfo.supports_cpython_series(version, released=released) == series
105+
assert pypyinfo.supported_cpython_series(version, released=released) == series
106106
if released is False:
107-
assert pypyinfo.supports_cpython_series(version) == series
107+
assert pypyinfo.supported_cpython_series(version) == series
108108

109109

110110
@pytest.mark.parametrize(
@@ -118,24 +118,24 @@ def test_supports_cpython_series(
118118
("8.0.0", True, []),
119119
],
120120
)
121-
def test_supports_cpython_series_released(
121+
def test_supported_cpython_series_released(
122122
pypyinfo: PyPyVersionInfo, version: str, released: bool, series: List[str]
123123
) -> None:
124-
assert pypyinfo.supports_cpython_series(version, released=released) == series
124+
assert pypyinfo.supported_cpython_series(version, released=released) == series
125125
if released is False:
126-
assert pypyinfo.supports_cpython_series(version) == series
126+
assert pypyinfo.supported_cpython_series(version) == series
127127

128128

129129
@pytest.mark.parametrize("v", INVALID_VERSIONS)
130-
def test_supports_cpython_series_invalid(pypyinfo: PyPyVersionInfo, v: str) -> None:
130+
def test_supported_cpython_series_invalid(pypyinfo: PyPyVersionInfo, v: str) -> None:
131131
with pytest.raises(ValueError) as excinfo:
132-
pypyinfo.supports_cpython_series(v)
132+
pypyinfo.supported_cpython_series(v)
133133
assert str(excinfo.value) == f"Invalid version string: {v!r}"
134134

135135

136136
@pytest.mark.parametrize("v", ["0.8", "1.5", "3", "7.3.9", "9.0.0"])
137-
def test_supports_cpython_series_unknown(pypyinfo: PyPyVersionInfo, v: str) -> None:
137+
def test_supported_cpython_series_unknown(pypyinfo: PyPyVersionInfo, v: str) -> None:
138138
with pytest.raises(UnknownVersionError) as excinfo:
139-
pypyinfo.supports_cpython_series(v)
139+
pypyinfo.supported_cpython_series(v)
140140
assert str(excinfo.value) == f"Unknown version: {v!r}"
141141
assert excinfo.value.version == v

0 commit comments

Comments
 (0)