Skip to content

Allow PyScript to fully run locally#1805

Merged
WebReflection merged 1 commit into
pyscript:mainfrom
WebReflection:local-toml-file
Oct 20, 2023
Merged

Allow PyScript to fully run locally#1805
WebReflection merged 1 commit into
pyscript:mainfrom
WebReflection:local-toml-file

Conversation

@WebReflection

Copy link
Copy Markdown
Contributor

Description

As @fpliger currently spotted, it's harder than it should to run PyScript project offline because we reach the CDN for the optional toml parser.

This MR moves that file locally so that we can use the dist folder to load on demand that library as opposite of needing the CDN.

Changes

  • curl the toml.js file into pyscript.core/src/ folder
  • exclude such file from the pre-commit hooks
  • verify the file is indeed part of the dist folder
  • since we're here ... updated polyscript to latest as there are various fixes in both coincident and polyscript that recently landed

Checklist

  • All tests pass locally
  • I have updated docs/changelog.md
  • I have created documentation for this(if applicable)

Comment thread pyscript.core/src/toml.js Outdated
@@ -0,0 +1,4 @@
// https://cdn.jsdelivr.net/npm/@webreflection/toml-j0.4/toml.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there value in noting the specific release of toml-j0.4 here, just in case we (you) ever do an update/release of that project and we want to be able to tell which version is included here? 1.1.3 it lookslike?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AFAIK nobody is planning to maintain or change that project so I might indeed jut create yet another automated artifact that grabs that from latest version (expected to be always the same) and place it in the src folder before building it.

Or maybe I can just add it as npm dependency and still automate that process ... this actually might be the best way to go:

  • the version is embedded in the package.json
  • the automation simply reflects that

Good hint!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done!

@JeffersGlass JeffersGlass left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One comment about possibly adding a version number; otherwise Looks Good to Me!

@WebReflection WebReflection merged commit 6dd242f into pyscript:main Oct 20, 2023
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.

2 participants