Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to parse summary with colon #284

Open
minrk opened this issue Jan 7, 2025 · 1 comment
Open

fails to parse summary with colon #284

minrk opened this issue Jan 7, 2025 · 1 comment
Labels
bug Something isn't working to sort Needs additional investigation

Comments

@minrk
Copy link

minrk commented Jan 7, 2025

What happened?

When there is a colon in about.summary, quotation marks are stripped during recursive parsing, leading to parse errors like:

EXCEPTION: An exception occurred while parsing the recipe file
mapping values are not allowed in this context
  in "<unicode string>", line 1, column 17
0 errors and 0 warnings were found.

without any context (the actual line is 26), even with --debug.

To Reproduce

Create meta.yaml:

{% set version = "1.0" %}
{% set build = 1 %}

package:
  name: test
  version: {{ version }}

source:
  url: https://example.org/{{ version }}.tar.gz
  sha256: 83624de0178b42d37ca1f7f905e1093556c6919fe5accd3e9f11d00a66e11256

build:
  number: {{ build }}

requirements:
  build:
    - {{ compiler('c') }}
  host:
    - zlib
test:
  commands:
    - "true"

about:
  home: https://example.com
  summary: "project: description"

extra:
  recipe-maintainers:
    - minrk

Run:

crm convert --debug meta.yaml

get

EXCEPTION: An exception occurred while parsing the recipe file
mapping values are not allowed in this context
  in "<unicode string>", line 1, column 17
0 errors and 0 warnings were found.

(notably, there is no debug info in the output).

Digging in with a debugger, the problem appears to be caused by stripping quotes on the summary line, because the line:

summary: project: description

is passed to yaml to parse, instead of the actual line summary: "project: description"

Additional Details (please complete the following information):

  • OS: macOS 15.2, arm
  • Conda Recipe Manager version 0.4.0

An easy enough workaround is to switch to

summary: |
    project: description

which parses fine

@minrk minrk added bug Something isn't working to sort Needs additional investigation labels Jan 7, 2025
@schuylermartin45
Copy link
Collaborator

Noted thanks for the details! We'll get to it when we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to sort Needs additional investigation
Projects
Status: Backlog
Development

No branches or pull requests

2 participants