Skip to content

Fixes #366 Seemingly unnecessary double quoting and escaping #379

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

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

schuylermartin45
Copy link
Collaborator

@schuylermartin45 schuylermartin45 commented Jun 12, 2025

Fixes a number of issues around excessive quotes in JINJA statements and other support. This should significantly improve previously seen odd behavior in crm convert and crm bump-recipe.

Also adds:

  • Parser support for multiline strings that use the "double-quote-and-backslash" method
  • Introduces a new NodeVar class to allow us to support tracking comments and selectors on JINJA variables. Most of this support is for V0, but there is some for V1.
  • Improves a number of critical JINJA regular experessions
  • A number of bug fixes around multiline string parsing
  • A minor refactor of some older test files
  • Regression tests that validate all these other improvements

From the integration tests, it looks like there is a slight decline in compatibility (by maybe a few recipe files). In my investigation, it looks like the recipe files that are now failing, for the most part, already contain invalid YAML. Overall, this should be a massive improvement over the current parsing issues.

@schuylermartin45 schuylermartin45 linked an issue Jun 12, 2025 that may be closed by this pull request
@schuylermartin45
Copy link
Collaborator Author

This is why we have such lovely integration tests:

  "exception_histogram": {
    "EXCEPTION: An exception occurred while parsing the recipe file": 238,
    "EXCEPTION: An exception occurred while converting to the new recipe file": 15
  },

The change in its current state tanks the success rate for parsing AnacondaRecipes and conda-forge recipe files.

@schuylermartin45
Copy link
Collaborator Author

It looks like comments/selectors on JINJA assignment lines are causing parsing issues with the current changes.

{% set native_compiler_subdir = 'linux-64' %}  # [linux]

@schuylermartin45
Copy link
Collaborator Author

A brief test shows that crm convert has apparently always dropped JINJA variables with comments on the same line. That has gone undetected for a while now and is tied to the variable assignment logic.

I won't break this out into a new ticket, this needs to be addressed in these changes.

@schuylermartin45 schuylermartin45 marked this pull request as ready for review June 18, 2025 20:38
@schuylermartin45 schuylermartin45 requested a review from a team as a code owner June 18, 2025 20:38
@skupr-anaconda
Copy link

@schuylermartin45
Copy link
Collaborator Author

schuylermartin45 commented Jun 18, 2025

Nice. The PR will fix this extra double-quoting https://github.com/AnacondaRecipes/pyside6-feedstock/pull/2/files#diff-f3725a55bf339595bf865fec73bda8ac99f283b0810c205442021f29c06eea9aR2, right?

It was supposed to, but I just looked and the test regression is wrong. This must have gotten lost in the fray, I'll take another look.

@schuylermartin45
Copy link
Collaborator Author

@skupr-anaconda Now we should be good. At least for the vast majority of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seemingly unnecessary double-quoting an escaping
3 participants