coherent-oss / coherent.build

A zero-config Python project build backend
5 stars 0 forks source link

Error when no deps have extras #8

Closed jaraco closed 1 month ago

jaraco commented 1 month ago

When attempting a build on a project that has no extras, the following error occurs:

Traceback (most recent call last):
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
    main()
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/pyproject_hooks/_in_process/_in_process.py", line 357, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/pyproject_hooks/_in_process/_in_process.py", line 326, in build_sdist
    return backend.build_sdist(sdist_directory, config_settings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/coherent/build/backend.py", line 193, in build_sdist
    metadata = Metadata.discover()
               ^^^^^^^^^^^^^^^^^^^
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/coherent/build/backend.py", line 142, in discover
    return cls(cls._discover_fields())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/coherent/build/backend.py", line 121, in __init__
    for item in always_items(values):
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/coherent/build/backend.py", line 155, in _discover_fields
    for extra in discovery.extras_from_deps(deps):
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-m2vzbehk/coherent/build/discovery.py", line 139, in extras_from_deps
    return functools.reduce(operator.or_, map(extras_from_dep, deps))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: reduce() of empty iterable with no initial value