Skip to content

Commit bc4a663

Browse files
committed
eclass: Delete backwards-compat code for @ECLASS-VARIABLE
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
1 parent 8499c36 commit bc4a663

2 files changed

Lines changed: 1 addition & 47 deletions

File tree

‎src/pkgcore/ebuild/eclass.py‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -279,36 +279,6 @@ def parse(self, lines, line_ind, next_line):
279279
return AttrDict(data)
280280

281281

282-
# For backwards compatibility, can be removed after 2022-12-31
283-
class EclassVarBlockCompat(ParseEclassDoc):
284-
"""ECLASS-VARIABLE doc block."""
285-
286-
tag = "@ECLASS-VARIABLE:"
287-
key = "variables"
288-
default = True
289-
290-
def __init__(self):
291-
tags = {
292-
"@ECLASS-VARIABLE:": ("name", True, self._eclass_variable, None),
293-
"@DEPRECATED:": ("deprecated", False, self._tag_deprecated, False),
294-
"@DEFAULT_UNSET": ("default_unset", False, self._tag_bool, False),
295-
"@INTERNAL": ("internal", False, self._tag_bool, False),
296-
"@REQUIRED": ("required", False, self._tag_bool, False),
297-
"@PRE_INHERIT": ("pre_inherit", False, self._tag_bool, False),
298-
"@USER_VARIABLE": ("user_variable", False, self._tag_bool, False),
299-
"@OUTPUT_VARIABLE": ("output_variable", False, self._tag_bool, False),
300-
"@DESCRIPTION:": ("description", True, self._tag_multiline_str, None),
301-
}
302-
super().__init__(tags)
303-
304-
def _eclass_variable(self, block, tag, lineno):
305-
"""Parse @ECLASS-VARIABLE tag."""
306-
logger.warning(
307-
f"{tag!r}, line {lineno}: deprecated, use '@ECLASS_VARIABLE' instead"
308-
)
309-
return self._tag_inline_arg(block, tag, lineno)
310-
311-
312282
class EclassFuncBlock(ParseEclassDoc):
313283
"""FUNCTION doc block."""
314284

‎tests/ebuild/test_eclass.py‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ def make_eclass(name, provides=None):
7575
# @DESCRIPTION:
7676
# Public variable.
7777
78-
# @ECLASS-VARIABLE: FOO_ANOTHER_ECLASS_VAR
79-
# @DESCRIPTION:
80-
# Yet another variable.
81-
8278
# @FUNCTION: _foo_internal_func
8379
# @USAGE: <bar> [<baz>]
8480
# @RETURN: nothing special
@@ -150,7 +146,6 @@ def test_foo_eclass(self, tmp_path):
150146
(
151147
"FOO_PUBLIC_ECLASS_VAR",
152148
"_FOO_INTERNAL_ECLASS_VAR",
153-
"FOO_ANOTHER_ECLASS_VAR",
154149
)
155150
)
156151
assert doc.internal_variable_names == frozenset(("_FOO_INTERNAL_ECLASS_VAR",))
@@ -194,7 +189,7 @@ def test_foo_eclass(self, tmp_path):
194189
"description": "\n\nPublic variable for foo_public_func.",
195190
}
196191

197-
assert len(doc.variables) == 3
192+
assert len(doc.variables) == 2
198193
assert doc.variables[0] == {
199194
"name": "_FOO_INTERNAL_ECLASS_VAR",
200195
"deprecated": False,
@@ -217,17 +212,6 @@ def test_foo_eclass(self, tmp_path):
217212
"output_variable": False,
218213
"description": "\n\nPublic variable.",
219214
}
220-
assert doc.variables[2] == {
221-
"name": "FOO_ANOTHER_ECLASS_VAR",
222-
"deprecated": False,
223-
"default_unset": False,
224-
"internal": False,
225-
"required": False,
226-
"pre_inherit": False,
227-
"user_variable": False,
228-
"output_variable": False,
229-
"description": "\n\nYet another variable.",
230-
}
231215

232216
def test_recursive_provides(self, tmp_path):
233217
with chdir(tmp_path):

0 commit comments

Comments
 (0)