decorators: don't unsort sorted values for printing

Currently in our deprecated/new feature printing we carefully sort all
of the values, then put them in a set to print them. Which unsorts them.
I'm assuming this was done because a set looks nice when printed (which
is true). Let's keep the formatting, but print them in a stable order.
pull/11277/head
Dylan Baker 2 years ago committed by Eli Schwartz
parent c8b8e7e732
commit eaf365cb3e
  1. 5
      mesonbuild/interpreterbase/decorators.py

@ -652,10 +652,11 @@ class FeatureCheckBase(metaclass=abc.ABCMeta):
fv = cls.feature_registry[subproject]
tv = cls.get_target_version(subproject)
for version in sorted(fv.keys()):
message = ', '.join(sorted(f"'{i[0]}'" for i in fv[version]))
if cls.check_version(tv, version):
notice_str += '\n * {}: {}'.format(version, {i[0] for i in fv[version]})
notice_str += '\n * {}: {{{}}}'.format(version, message)
else:
warning_str += '\n * {}: {}'.format(version, {i[0] for i in fv[version]})
warning_str += '\n * {}: {{{}}}'.format(version, message)
if '\n' in notice_str:
mlog.notice(notice_str, fatal=False)
if '\n' in warning_str:

Loading…
Cancel
Save