Skip to content

fix: render any project description into valid files - #171

Open
noelmcloughlin wants to merge 2 commits into
linkml:mainfrom
lmodel:pyproject
Open

noelmcloughlin wants to merge 2 commits into
linkml:mainfrom
lmodel:pyproject

Conversation

@noelmcloughlin

@noelmcloughlin noelmcloughlin commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

A newline, quote or backslash in the project description no longer breaks the generated pyproject.toml, config.public.mk, example schema or init.py. Whitespace is collapsed to single spaces in pyproject.toml and config.public.mk, so the package summary stays on one line

Issue

When a long value is supplied for the project description, the template produces value inside a basic TOML string ("...") that wraps onto a second physical line. TOML basic strings cannot contain a raw newline.

To reproduce, generate a project (e.g. via copier copy of linkml-project-copier) and answer the project.description question with a long string such as:

Project with a really long description that should be shorter but is long because we decided to expand acronyms to be descriptive

The rendered pyproject.toml contains:

[project]
name = "nist_ai_600_1"
description = "Project with a really long description that should be shorter but is long because we
decided to expand acronyms to be descriptive"

Running any uv command then fails:

warning: Failed to parse `pyproject.toml` during settings discovery:
  TOML parse error at line 8, column 14

@dalito

dalito commented May 29, 2026

Copy link
Copy Markdown
Member

Can you look at where the description is re-used (it is at least in the package __init__.py) and wrap it with the wordwrap filter.

Another solution could be to use """ multiline-strings of toml in pyproject.toml.

@noelmcloughlin

Copy link
Copy Markdown
Contributor Author

Probably this would work since its part of spec.

description = """{{project_description}}""""

I think its best to fix at source since some other tools could trip over this pyproject.toml.

@matentzn
matentzn requested a review from dalito July 15, 2026 15:25
@noelmcloughlin noelmcloughlin changed the title fix(pyproject): allow long project description fix: render any project description into valid files Nov 8, 2026
Signed-off-by: noelmcloughlin <noel.mcloughlin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants