Complete worked example
python
import tomllib
def inspect_example(text):
document = tomllib.loads(text)
project = document['project']
build = document['build-system']
return {'name': project['name'], 'version': project['version'],
'runtime': project.get('dependencies', []),
'build': build['requires'], 'python': project['requires-python']}- Reasoning
- The worked report returns the project name, version, runtime dependency list, build requirement list and requires-python string. The fixture needs setuptools to build but has no runtime dependencies. Its test extra names mypy without making mypy a requirement for every installed user.