Abseil Common Libraries (Python)
APACHE-2.0 License
Bot releases are visible (Hide)
absl.flags.override_value
function to provide FlagHolder
with a construct to modify values. The new interface parallels absl.flags.FlagValues.__setattr__
but checks that the provided value conforms to the flag's expected type.absltest.TestCase.assertDataclassEqual
that tests equality of dataclass.dataclass
objects with better error messages when the assert fails.absl.flags.argparse_flags.ArgumentParser
now correctly inherits an empty instance of FlagValues
to ensure that absl flags, such as --flagfile
, --undefok
are supported.foo
no longer retains the value bar
after FLAGS.foo = bar
fails due to a validation error.Published by yilei about 1 year ago
absl-py
no longer supports Python 3.6. It has reached end-of-life for morelogging.exception
can now take exc_info
as argument, withTrue
. Prior to this change setting exc_info
would raiseKeyError
, this change fixes this behaviour.absltest.TestCase.enter_context
unittest.TestCase.enterContext
(when called via instance)unittest.TestCase.enterClassContext
(when called via class) now. As a_cls_exit_stack
attribute is notabsltest.TestCase
and _exit_stack
attribute is not defined onabsltest.TestCase.assertSameStructure()
now uses the test case'sTestCase.addTypeEqualityFunc()
) forabslTest.TestCase.fail()
now names its arguments(self, msg=None, user_msg=None)
, and not (self, msg=None, prefix=None)
,DEFINE_enum
, DEFINE_multi_enum
, and EnumParser
now raise errors whenenum_values
is provided as a single string value. Additionally,EnumParser.enum_values
is now stored as a list copy of the providedenum_values
parameter.paramaterized.CoopTestCase()
to use Python 3 metaclass__metaclass__
absltest.TestCase.assertSequenceStartsWith
now explicitly failMapping
or Set
object as the whole
argument.Published by yilei almost 2 years ago
@flagsaver.as_parsed
: this allows saving/restoring flags.present
is set.logging.find_log_dir()
now falls backtempfile.gettempdir()
instead of /tmp/
.short_name=
) to DEFINE_multi_enum_class
Flag
object.Published by yilei about 2 years ago
absl.flags.set_default
function that updates the flagFlagHolder
. This parallels theabsl.flags.FlagValues.set_default
interface which takes a flag name.FlagHolder
instance(s) inflags.register_validator
flags.validator
flags.register_multi_flags_validator
flags.multi_flags_validator
flags.mark_flag_as_required
flags.mark_flags_as_required
flags.mark_flags_as_mutual_exclusive
flags.mark_bool_flags_as_mutual_exclusive
flags.declare_key_flag
assertRaisesWithPredicateMatch
andassertRaisesWithLiteralMatch
now capture the raised Exception
forflag_name
arguments in the following functionsflags.register_validator
flags.validator
flags.register_multi_flags_validator
flags.multi_flags_validator
flags.mark_flag_as_required
flags.mark_flags_as_required
flags.mark_flags_as_mutual_exclusive
flags.mark_bool_flags_as_mutual_exclusive
flags.declare_key_flag
Published by yilei over 2 years ago
TempFileCleanup.SUCCESS
is used.Published by yilei over 2 years ago
Flag
instances now raise an error if used in a bool context. This prevents the occasional mistake of testing an instance for truthiness rather than testing flag.value
.absl-py
no longer depends on six
.Published by yilei almost 3 years ago
absl-py
no longer supports Python 2.7, 3.4, 3.5. All versions have reachedvX.Y.Z
instead of pypi-vX.Y.Z
in the git