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

ENH: lint incorrect distro names in os_version #2155

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

h-vetinari
Copy link
Member

This is for linting wrong distro values used in os_version (which becomes more important after conda-forge/conda-forge-pinning-feedstock#6626, as it might lead to zipping problems and thus rerender errors).

With this PR, a conda-forge.yml of

os_version:
  linux_64: wrong

would lead to

pydantic_core._pydantic_core.ValidationError: 1 validation error for ConfigModel
os_version.linux_64
  Input should be 'cos7', 'ubi8', 'alma8' or 'alma9' [type=literal_error, input_value='wrong', input_type=str]
    For further information visit https://errors.pydantic.dev/2.10/v/literal_error

We'll certainly want to polish this further (e.g. into a concrete hint/lint), hence this is a draft. It's also a draft because by themselves, the changes in dc74f55 do not work. It needs #1920 (or something similar) to actually work, see #2152. Currently it includes that PR, which should be merged first.

@isuruf
Copy link
Member

isuruf commented Nov 22, 2024

Why do you need the other PR for this PR? Shouldn't your last commit work on its own?

@h-vetinari
Copy link
Member Author

Why do you need the other PR for this PR? Shouldn't your last commit work on its own?

I thought so too, but I've tested it, and it has no effect (which is why I ended up opening #2152)

@h-vetinari
Copy link
Member Author

Although, now with the discussions about the JSON schema etc. - perhaps I'm missing whatever the equivalent of efb395f is on the JSON side? 🤔

@h-vetinari
Copy link
Member Author

h-vetinari commented Nov 22, 2024

perhaps I'm missing whatever the equivalent of efb395f is on the JSON side? 🤔

Yeah, I hadn't gotten how the JSON schema needs to be regenerated after changing the pydantic model.

Opened an issue for making that more obvious: #2160

@h-vetinari h-vetinari marked this pull request as ready for review November 22, 2024 21:51
@h-vetinari h-vetinari requested a review from a team as a code owner November 22, 2024 21:51
Copy link
Member

@beckermr beckermr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit.

@beckermr beckermr dismissed their stale review November 22, 2024 23:03

Not needed.

@h-vetinari h-vetinari merged commit 04d862f into conda-forge:main Nov 24, 2024
2 checks passed
@h-vetinari h-vetinari deleted the os_version branch November 24, 2024 19:48
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.

3 participants