Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions packages/jsonschema-rs/meta.yaml
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
Copy link
Copy Markdown
Member

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:

Suggested change
url: https://files.pythonhosted.org/packages/d2/7b/40ed0aa40ff2f3bc9bfccf20ea29d9a99199a8eefda26ae9d65601c144fa/jsonschema_rs-0.45.0.tar.gz
url: https://files.pythonhosted.org/packages/source/j/jsonschema_rs/jsonschema_rs-0.45.0.tar.gz

If you use pyodide skeleton to create the recipe, it will automatically resolve the URLs. :D

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
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();
Loading