Skip to content

Commit

Permalink
i18n: merge_file() deprecate positional arguments
Browse files Browse the repository at this point in the history
They always have been ignored but it became an hard error with no
deprecation period in 0.60.0. Since it breaks some GNOME projects,
deprecate for now and keep it removed for 0.61.0.

Fixes: #9441
  • Loading branch information
xclaesse committed Oct 26, 2021
1 parent 67e8417 commit 3a01543
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mesonbuild/modules/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .. import mlog
from ..interpreter.type_checking import CT_BUILD_BY_DEFAULT, CT_INPUT_KW, CT_INSTALL_DIR_KW, CT_INSTALL_TAG_KW, CT_OUTPUT_KW, INSTALL_KW, NoneType, in_set_validator
from ..interpreterbase import FeatureNew
from ..interpreterbase.decorators import ContainerTypeInfo, KwargInfo, noPosargs, typed_kwargs, typed_pos_args
from ..interpreterbase.decorators import ContainerTypeInfo, KwargInfo, typed_kwargs, typed_pos_args
from ..scripts.gettext import read_linguas

if T.TYPE_CHECKING:
Expand Down Expand Up @@ -128,7 +128,6 @@ def _get_data_dirs(state: 'ModuleState', dirs: T.Iterable[str]) -> T.List[str]:
return [path.join(src_dir, d) for d in dirs]

@FeatureNew('i18n.merge_file', '0.37.0')
@noPosargs
@typed_kwargs(
'i18n.merge_file',
CT_BUILD_BY_DEFAULT,
Expand All @@ -143,6 +142,9 @@ def _get_data_dirs(state: 'ModuleState', dirs: T.Iterable[str]) -> T.List[str]:
KwargInfo('type', str, default='xml', validator=in_set_validator({'xml', 'desktop'})),
)
def merge_file(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: 'MergeFile') -> ModuleReturnValue:
if args:
mlog.deprecation('i18n.merge_file does not take any positional arguments. ' +
'This will become an hard error in next Meson release.')
if not shutil.which('xgettext'):
self.nogettext_warning()
return ModuleReturnValue(None, [])
Expand Down

0 comments on commit 3a01543

Please sign in to comment.