@@ -9,7 +9,7 @@ edition = "2021"
99include = [" src/**/*.rs" , " Cargo.toml" , " build.rs" , " Lib/**/*.py" ]
1010
1111[features ]
12- default = [" compiler" ]
12+ default = [" compiler" , " js " ]
1313importlib = []
1414encodings = [" importlib" ]
1515vm-tracing-logging = []
@@ -22,6 +22,8 @@ ast = ["rustpython-ast"]
2222codegen = [" rustpython-codegen" , " ast" ]
2323parser = [" rustpython-parser" , " ast" ]
2424
25+ js = [" getrandom/js" , " chrono/wasmbind" , " wasm-bindgen" ]
26+
2527[dependencies ]
2628rustpython-compiler = { path = " ../compiler" , optional = true , version = " 0.1.2" }
2729rustpython-ast = { path = " ../compiler/ast" , optional = true , version = " 0.1" }
@@ -38,11 +40,11 @@ num-traits = "0.2.14"
3840num-integer = " 0.1.44"
3941num-rational = " 0.4.0"
4042rand = " 0.8.5"
41- getrandom = { version = " 0.2.6" , features = [ " js " ] }
43+ getrandom = { version = " 0.2.6" }
4244log = " 0.4.16"
4345serde = { version = " 1.0.136" , features = [" derive" ] }
4446caseless = " 0.2.1"
45- chrono = { version = " 0.4.19" , features = [ " wasmbind " ] }
47+ chrono = { version = " 0.4.19" , default- features = false , features = [ " clock " , " std " , " oldtime " ] }
4648itertools = " 0.10.3"
4749hex = " 0.4.3"
4850hexf-parse = " 0.2.1"
@@ -126,8 +128,8 @@ features = [
126128 " impl-default" , " vcruntime" , " ifdef" , " netioapi" , " memoryapi" ,
127129]
128130
129- [target .'cfg(target_arch = "wasm32")' .dependencies ]
130- wasm-bindgen = " 0.2.80"
131+ [target .'cfg(all( target_arch = "wasm32", target_os = "unknown") )' .dependencies ]
132+ wasm-bindgen = { version = " 0.2.80" , optional = true }
131133
132134[build-dependencies ]
133135itertools = " 0.10.3"
0 commit comments