astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Rye forces author info to add packages #1369

Closed joorjeh closed 1 week ago

joorjeh commented 3 weeks ago

output of rye --version

rye 0.39.0 commit: 0.39.0 (bf3ccf818 2024-08-21) platform: linux (x86_64) self-python: cpython@3.12.3 symlink support: true uv enabled: true

Steps to reproduce:

rye init test-project
cd test-project
rye sync

Output of last command:

Initializing new virtualenv in /home/anon/new-project/.venv
Python version: cpython@3.12.3
Generating production lockfile: /home/anon/new-project/requirements.lock
Generating dev lockfile: /home/anon/new-project/requirements-dev.lock
Installing dependencies
Resolved 1 package in 0.87ms
error: Failed to prepare distributions
  Caused by: Failed to fetch wheel: new-project @ file:///home/anon/new-project
  Caused by: Build backend failed to build wheel through `build_editable()` with exit status: 1
--- stdout:

--- stderr:
Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "/home/anon/.cache/uv/builds-v0/.tmpLVKwJe/lib/python3.12/site-packages/hatchling/build.py", line 83, in build_editable
    return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable'])))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anon/.cache/uv/builds-v0/.tmpLVKwJe/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 90, in build
    self.metadata.validate_fields()
  File "/home/anon/.cache/uv/builds-v0/.tmpLVKwJe/lib/python3.12/site-packages/hatchling/metadata/core.py", line 266, in validate_fields
    self.core.validate_fields()
  File "/home/anon/.cache/uv/builds-v0/.tmpLVKwJe/lib/python3.12/site-packages/hatchling/metadata/core.py", line 1376, in validate_fields
    getattr(self, attribute)
  File "/home/anon/.cache/uv/builds-v0/.tmpLVKwJe/lib/python3.12/site-packages/hatchling/metadata/core.py", line 846, in authors
    authors_data['email'].append(str(Address(display_name=name, addr_spec=email)))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anon/.rye/py/cpython@3.12.3/lib/python3.12/email/headerregistry.py", line 49, in __init__
    raise a_s.all_defects[0]
email.errors.InvalidHeaderDefect: addr-spec local part with no domain
---
error: Installation of dependencies failed in venv at /home/anon/new-project/.venv. uv exited with status: exit status: 2

Can be fixed by setting defaults in configuration but seems onerous to force user, especially for one off little temp projects.

EDIT: Actually setting author in .rye/config.toml as shown in https://rye.astral.sh/guide/config/#config-file does not fix problem. author in pyproject.toml is filled in with entire string from .rye/config.toml, email still "nan". The configuration file in the docs needs to be updated I think?