"""The package was not found."""
def __str__(self):
- tmpl = "No package metadata was found for {self.name}"
- return tmpl.format(**locals())
+ return f"No package metadata was found for {self.name}"
@property
def name(self):
self.mode, _, self.value = spec.partition('=')
def __repr__(self):
- return '<FileHash mode: {} value: {}>'.format(self.mode, self.value)
+ return f'<FileHash mode: {self.mode} value: {self.value}>'
class Distribution:
"""
def make_condition(name):
- return name and 'extra == "{name}"'.format(name=name)
+ return name and f'extra == "{name}"'
def parse_condition(section):
section = section or ''
extra, sep, markers = section.partition(':')
if extra and markers:
- markers = '({markers})'.format(markers=markers)
+ markers = f'({markers})'
conditions = list(filter(None, [markers, make_condition(extra)]))
return '; ' + ' and '.join(conditions) if conditions else ''