Skip to content

Enable parsing struct meta sections#804

Merged
mlin merged 9 commits intochanzuckerberg:mainfrom
adamnovak:struct-meta
Oct 27, 2025
Merged

Enable parsing struct meta sections#804
mlin merged 9 commits intochanzuckerberg:mainfrom
adamnovak:struct-meta

Conversation

@adamnovak
Copy link
Contributor

@adamnovak adamnovak commented Sep 18, 2025

Motivation

This should fix #803 and also fix #760, which Toil needs fixed in order to start running tests against the WDL 1.2 spec tests.

Approach

This adds the meta_section productions as allowed peers of struct fields in the grammar for parsing structs, and handles them similarly to how they are handled when they show up in workflow or task blocks when building the object model from the parse tree.

I have some changes to the imports and type specs in here which appeared to be needed to actually import the code on my machine; I'm not sure how the old version actually worked. I don't think I can pull them out of the branch because otherwise the files can't be imported, as far as I can tell.

Checklist

  • Add appropriate test(s) to the automatic suite
  • Use make pretty to reformat the code with ruff format
  • Use make check to statically check the code using ruff check and mypy
  • Send PR from a dedicated branch without unrelated edits
  • Ensure compatibility with this project's MIT license

@adamnovak adamnovak marked this pull request as ready for review September 18, 2025 22:30
@mlin
Copy link
Collaborator

mlin commented Sep 18, 2025

See also prior wip #797 but this might well be more complete

@coveralls
Copy link

coveralls commented Oct 24, 2025

Pull Request Test Coverage Report for Build 18798570385

Details

  • 23 of 26 (88.46%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 95.201%

Changes Missing Coverage Covered Lines Changed/Added Lines %
WDL/_parser.py 18 19 94.74%
WDL/Tree.py 5 7 71.43%
Files with Coverage Reduction New Missed Lines %
WDL/runtime/task.py 1 95.62%
Totals Coverage Status
Change from base Build 18765276648: -0.04%
Covered Lines: 7479
Relevant Lines: 7856

💛 - Coveralls

@mlin
Copy link
Collaborator

mlin commented Oct 24, 2025

@adamnovak Can I just ask about the couple of unrelated changes in the type hints and Any-- did you find those necessary to satisfy a certain version of mypy? (the CI here doesn't pin the mypy version, but I can't recall it tripping up in these areas)

@adamnovak
Copy link
Contributor Author

I was getting type-checking failures without quoting those types, and I think with Any coming from . as well. I thought we just weren't importing the Tree types and also Any just wasn't actually in . somehow, but now I think there must be something wrong with my setup to run the type checking and how it handles imports from ..

I tested in a fresh Python 3.12 venv with:

    pip install '.[dev]'
    make check

And it turns out I don't need these changes (anymore?)
@adamnovak
Copy link
Contributor Author

@mlin I checked again on a fresh install on Python 3.12 and mypy 1.18.2, and it looks like those typing changes aren't actually needed. So I've pulled them out.

@mlin mlin merged commit beaa9a9 into chanzuckerberg:main Oct 27, 2025
8 checks passed
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.

Struct meta support struct parameter_meta

3 participants