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

Change the metadata format #457

Merged
merged 3 commits into from
Jun 1, 2022
Merged

Conversation

woxtu
Copy link
Contributor

@woxtu woxtu commented May 24, 2022

Hi,

This PR changes the metadata format written in <py-config> tag.

The current metadata format is like this:

# from https://github.com/pyscript/pyscript/blob/48e6b1a84efb0d41609258b0c2b5b525ca571719/docs/tutorials/getting-started.md#the-py-config-tag
- autoclose_loader: false
- runtimes:
  -
    src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
    name: pyodide-0.20
    lang: python

Representing it as JSON is like this:

[
  {
    "autoclose_loader": false
  },
  {
    "runtimes": [
      {
        "src": "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js",
        "name": "pyodide-0.20",
        "lang": "python"
      }
    ]
  }
]

I think this should be like this:

autoclose_loader: false
runtimes:
  - src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
    name: pyodide-0.20
    lang: python

Representing it as JSON is like this:

{
  "autoclose_loader": false,
  "runtimes": [
    {
      "src": "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js",
      "name": "pyodide-0.20",
      "lang": "python"
    }
  ]
}

Copy link
Contributor

@fpliger fpliger left a comment

Choose a reason for hiding this comment

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

Yup. This should have been right format. Thanks for the catch @woxtu !🎉

@fpliger
Copy link
Contributor

fpliger commented May 26, 2022

@pww217 CI is failing because it should test the examples against the newly built artifact, not against pyscript.net. Any ideas?

@marimeireles
Copy link
Member

Hey seems like this can be merged!
I've fixed the conflicts locally already, but thought I should ask if it's okay for me to force push it here?
@woxtu feel free to fix it locally and push it yourself if you prefer.
Thank you for the work! 🌸

@pww217
Copy link
Contributor

pww217 commented May 31, 2022

The docs review will still fail but the build latest should success with #433 and #435 merged. Thanks @marimeireles!

@woxtu
Copy link
Contributor Author

woxtu commented May 31, 2022

@marimeireles Thanks! It's okay to push yours.

@marimeireles
Copy link
Member

Cool!
Thank you people :)

@marimeireles marimeireles merged commit 4b4ff08 into pyscript:main Jun 1, 2022
@woxtu woxtu deleted the metadata-format branch June 18, 2022 09:02
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.

None yet

4 participants