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

fix: Flatten if/else conditions in run requirements and constraints #2197

Merged
merged 4 commits into from
Dec 26, 2024

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Dec 26, 2024

Checklist

  • Added a news entry
  • Regenerated schema JSON if schema altered (python conda_smithy/schema.py)

Flatten if/else conditions in run requirements and constraints, in v1 recipes, in addition to build requirements. This prevents the subsequent code from crashing on them:

  File "/home/mgorny/miniforge3/lib/python3.12/site-packages/conda_smithy/linter/lints.py", line 854, in <genexpr>
    if any(req.startswith("__osx >") for req in to_check):
           ^^^^^^^^^^^^^^
AttributeError: 'CommentedMap' object has no attribute 'startswith'

Fixes #2196
Probably fixes #2165 as well

Flatten if/else conditions in run requirements and constraints, in v1
recipes, in addition to build requirements.  This prevents
the subsequent code from crashing on them:

```
  File "/home/mgorny/miniforge3/lib/python3.12/site-packages/conda_smithy/linter/lints.py", line 854, in <genexpr>
    if any(req.startswith("__osx >") for req in to_check):
           ^^^^^^^^^^^^^^
AttributeError: 'CommentedMap' object has no attribute 'startswith'
```

Fixes conda-forge#2196
@mgorny mgorny requested a review from a team as a code owner December 26, 2024 15:16
@mgorny
Copy link
Contributor Author

mgorny commented Dec 26, 2024

CC @wolfv

@beckermr beckermr merged commit e598613 into conda-forge:main Dec 26, 2024
2 checks passed
@mgorny mgorny deleted the flatten-if-else-in-run branch December 26, 2024 18:20
@mgorny
Copy link
Contributor Author

mgorny commented Dec 26, 2024

Thanks!

@wolfv
Copy link
Member

wolfv commented Dec 26, 2024

Thanks!!

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