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

Revamp the conda/schemas repository #52

Open
jaimergp opened this issue May 8, 2023 · 5 comments
Open

Revamp the conda/schemas repository #52

jaimergp opened this issue May 8, 2023 · 5 comments

Comments

@jaimergp
Copy link
Contributor

jaimergp commented May 8, 2023

Note: I was going to post this in conda/schemas directly but I can't tag the steering team from there, hence the issue here.

We have a few CEPs coming up (see #51 #8 #50) where it has been suggested that we document the proposed standards with an accompanying JSON schema in the conda/schemas repo.

As I start writing some of these schemas down, I will be using pydantic to write reusable models that can auto export JSON documents. I wonder if there's an interest in doing this retroactively for existing models that have not been standardized yet, so if this catches up, I'd like to propose the following repository structure:

  • examples/: Real-life examples of the documented file types, that can be used in test suites if necessary.
  • schemas/: Publishable JSON schema documents.
  • models/: Python scripts that generate JSON schemas into schemas/. Most likely using pydantic.
  • scripts/: Other helper utilities (e.g. refresh all JSON schemas from their models, publish to a HTML tree, etc).
  • tests/: Automations to make sure the proposed models actually implement the existing "standards" (as in examples/), but also reject non-compliant files (e.g. extra keys due to typos).

Eventually I can foresee how the models directory becomes a collection of well structured modules with no extra dependencies (other than Pydantic) that would be best served as an importable Python package. Downstream packages (maybe including conda!) could benefit from using these models to transparently add typing their code paths, or at least compare their custom implementations to accepted community standards in their test suites.

I'd love to hear thoughts from @conda-incubator/steering! Thanks!

@jezdez
Copy link
Member

jezdez commented May 8, 2023

👍 Good idea!

@travishathaway
Copy link
Contributor

travishathaway commented May 9, 2023

I noticed that the .condarc file is not currently listed in the https://github.com/conda/schemas repositories, but if you would like to add that too, I have actually already done a lot of the work. You can check it out here (it's a pydantic model):

@jaimergp
Copy link
Contributor Author

jaimergp commented May 9, 2023

Lol I was just tagging you in the PR. Thanks for the tip!

@jaimergp
Copy link
Contributor Author

For reference, Microsoft seems to have some schemas for conda here too: https://github.com/microsoft/vscode-python/tree/main/schemas

@jezdez
Copy link
Member

jezdez commented Jun 2, 2023

For reference, Microsoft seems to have some schemas for conda here too: microsoft/vscode-python@main/schemas

😬

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

3 participants