You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These fields accept an array of tables with 2 keys: name and email. Both values must be strings. The name value MUST be a valid email name (i.e. whatever can be put as a name, before an email, in RFC 822 and not contain commas. The email value MUST be a valid email address. Both keys are optional.
Steps to Reproduce
There are a few scenarios where the key "name" from PEP621 is not honored to be optional. I am building with "make latexpdf".
First scenario
Set pyproject.toml to (both author and authors are commented out):
Traceback (most recent call last):
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
exec(code, namespace) # NoQA: S102
^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/code/gitlab.com/dynamist/dynamist-mighty-document/conf.py", line 35, in <module>
config = SphinxConfig("pyproject.toml", globalns=globals())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/sphinx_pyproject/__init__.py", line 162, in __init__
raise BadConfigError(
dom_toml.parser.BadConfigError: Either 'authors/maintainers' was not declared in the 'project' table or it was marked as 'dynamic', which is unsupported by 'sphinx-pyproject'.
Second scenario
Set pyproject.toml to ('authors' is defined but empty):
[project]
name = "Mighty Document"version = ""description = ""
[[project.authors]]
name = ""
The error message is:
Traceback (most recent call last):
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
exec(code, namespace) # NoQA: S102
^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/code/gitlab.com/dynamist/dynamist-mighty-document/conf.py", line 35, in <module>
config = SphinxConfig("pyproject.toml", globalns=globals())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/sphinx_pyproject/__init__.py", line 149, in __init__
pep621_config = parser_cls().parse(namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/sphinx_pyproject/__init__.py", line 313, in parse
return super().parse(config)
^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/dom_toml/parser.py", line 233, in parse
parsed_config[key] = getattr(self, f"parse_{key.replace('-', '_')}")(config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.11/site-packages/sphinx_pyproject/__init__.py", line 279, in parse_author
raise BadConfigError(f"The 'project.authors' key cannot be empty.")
dom_toml.parser.BadConfigError: The 'project.authors' key cannot be empty.
Third scenario
Set pyproject.toml to ('author' is defined but empty):
Description
When the authors field is not set at all, or when setting the authors field to an empty string I get errors.
PEP 621 states (emphasis mine):
Steps to Reproduce
There are a few scenarios where the key "name" from PEP621 is not honored to be optional. I am building with "make latexpdf".
First scenario
Set
pyproject.toml
to (bothauthor
andauthors
are commented out):The error message is:
Second scenario
Set
pyproject.toml
to ('authors' is defined but empty):The error message is:
Third scenario
Set
pyproject.toml
to ('author' is defined but empty):The error message is:
Actual result:
Se error messages above.
Expected result:
Undefined or empty "authors" fields should be accepted.
Reproduces how often:
Easily reproduced. Every time.
Version
All Sphinx related tools and libraries are self-contained in a pipx environment.
The text was updated successfully, but these errors were encountered: