-
Notifications
You must be signed in to change notification settings - Fork 76
Add jsonschema-rs package #559
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
Open
evroon
wants to merge
2
commits into
pyodide:main
Choose a base branch
from
evroon:jsonschema-rs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+65
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package: | ||
| name: jsonschema-rs | ||
| version: 0.45.0 | ||
| tag: | ||
| - rust | ||
| top-level: | ||
| - jsonschema_rs | ||
| source: | ||
| url: https://files.pythonhosted.org/packages/d2/7b/40ed0aa40ff2f3bc9bfccf20ea29d9a99199a8eefda26ae9d65601c144fa/jsonschema_rs-0.45.0.tar.gz | ||
| sha256: 897deffee817fe0f493710221e19bc4d9fedabdba121d9f8e0aa824460d2498d | ||
| patches: | ||
| # Needed for https://github.com/Stranger6667/jsonschema/issues/1093 | ||
| - patches/0001-remove-WASM-incompatible-http-options.patch | ||
| build: | ||
| script: | | ||
| # jsonschema-rs overrides the default target set by pyodide-build so we have | ||
| # to set it explicitly here | ||
| rustup target add wasm32-unknown-emscripten | ||
| requirements: | ||
| executable: | ||
| - rustup | ||
| test: | ||
| imports: | ||
| - jsonschema_rs | ||
| about: | ||
| home: https://github.com/Stranger6667/jsonschema | ||
| PyPI: https://pypi.org/project/jsonschema-rs/0.45.0 | ||
| summary: "A high-performance JSON Schema validator for Python" | ||
| license: MIT | ||
| extra: | ||
| recipe-maintainers: | ||
| - evroon | ||
33 changes: 33 additions & 0 deletions
33
packages/jsonschema-rs/patches/0001-remove-WASM-incompatible-http-options.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| diff --git a/crates/jsonschema-py/src/lib.rs b/crates/jsonschema-py/src/lib.rs | ||
| index 9c94628..2def1c7 100644 | ||
| --- a/crates/jsonschema-py/src/lib.rs | ||
| +++ b/crates/jsonschema-py/src/lib.rs | ||
| @@ -956,28 +956,6 @@ fn make_options( | ||
| }); | ||
| options = options.with_email_options(email_opts); | ||
| } | ||
| - if let Some(http_options) = http_options { | ||
| - let opts = http_options.extract::<HttpOptions>().map_err(|_| { | ||
| - exceptions::PyTypeError::new_err("http_options must be an instance of HttpOptions") | ||
| - })?; | ||
| - let mut http_opts = jsonschema::HttpOptions::new(); | ||
| - if let Some(timeout) = opts.timeout { | ||
| - http_opts = http_opts.timeout(std::time::Duration::from_secs_f64(timeout)); | ||
| - } | ||
| - if let Some(connect_timeout) = opts.connect_timeout { | ||
| - http_opts = | ||
| - http_opts.connect_timeout(std::time::Duration::from_secs_f64(connect_timeout)); | ||
| - } | ||
| - if !opts.tls_verify { | ||
| - http_opts = http_opts.danger_accept_invalid_certs(true); | ||
| - } | ||
| - if let Some(ref ca_cert) = opts.ca_cert { | ||
| - http_opts = http_opts.add_root_certificate(ca_cert); | ||
| - } | ||
| - options = options.with_http_options(&http_opts).map_err(|e| { | ||
| - exceptions::PyRuntimeError::new_err(format!("Failed to configure HTTP options: {e}")) | ||
| - })?; | ||
| - } | ||
| if let Some(keywords) = keywords { | ||
| for (name, callback) in keywords.iter() { | ||
| let name_str = name.to_string(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyPI has predictable URLs for sdists (and wheels, too), so this can be simplified as follows:
If you use
pyodide skeletonto create the recipe, it will automatically resolve the URLs. :D