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

Fail CI if CONDA_FORGE_YAML_SCHEMA_FILE is out of date #2160

Open
h-vetinari opened this issue Nov 22, 2024 · 0 comments
Open

Fail CI if CONDA_FORGE_YAML_SCHEMA_FILE is out of date #2160

h-vetinari opened this issue Nov 22, 2024 · 0 comments

Comments

@h-vetinari
Copy link
Member

In a setup that was not obvious to me, the JSON under conda_smithy/data/conda-forge.json needs to be updated after every change to conda_smithy/schema.py.

CI should fail if the output of python conda_smithy/schema.py is not the same as the content under CONDA_FORGE_YAML_SCHEMA_FILE, c.f.

if __name__ == "__main__":
# This is used to generate the model dump for conda-smithy internal use
# and for documentation purposes.
model = ConfigModel()
with CONDA_FORGE_YAML_SCHEMA_FILE.open(mode="w+") as f:
obj = model.model_json_schema()
f.write(json.dumps(obj, indent=2))
f.write("\n")
with CONDA_FORGE_YAML_DEFAULTS_FILE.open(mode="w+") as f:
f.write(yaml.dump(model.model_dump(by_alias=True), indent=2))

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

No branches or pull requests

1 participant