diff --git a/py-rattler/Cargo.lock b/py-rattler/Cargo.lock index f7b453528..b79f022e6 100644 --- a/py-rattler/Cargo.lock +++ b/py-rattler/Cargo.lock @@ -214,7 +214,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -249,7 +249,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -422,15 +422,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -522,7 +522,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -533,7 +533,7 @@ checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" dependencies = [ "darling_core", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -628,7 +628,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -649,7 +649,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -909,7 +909,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -998,7 +998,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -1167,7 +1167,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1208,9 +1208,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1334,7 +1334,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -1351,12 +1351,12 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -1689,7 +1689,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -1758,7 +1758,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -1832,7 +1832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap 2.2.5", ] [[package]] @@ -1865,7 +1865,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", "unicase", ] @@ -1915,7 +1915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64", - "indexmap 2.2.3", + "indexmap 2.2.5", "line-wrap", "quick-xml", "serde", @@ -1991,7 +1991,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", "version_check", "yansi", ] @@ -2028,6 +2028,7 @@ dependencies = [ "rattler_index", "rattler_lock", "rattler_networking", + "rattler_package_streaming", "rattler_repodata_gateway", "rattler_shell", "rattler_solve", @@ -2179,7 +2180,7 @@ dependencies = [ [[package]] name = "rattler" -version = "0.19.0" +version = "0.19.3" dependencies = [ "anyhow", "async-compression", @@ -2192,7 +2193,7 @@ dependencies = [ "futures", "fxhash", "hex", - "indexmap 2.2.3", + "indexmap 2.2.5", "itertools", "memchr", "memmap2", @@ -2223,13 +2224,13 @@ dependencies = [ [[package]] name = "rattler_conda_types" -version = "0.19.0" +version = "0.20.2" dependencies = [ "chrono", "fxhash", "glob", "hex", - "indexmap 2.2.3", + "indexmap 2.2.5", "itertools", "lazy-regex", "nom", @@ -2251,7 +2252,7 @@ dependencies = [ [[package]] name = "rattler_digest" -version = "0.19.0" +version = "0.19.2" dependencies = [ "blake2", "digest", @@ -2265,7 +2266,7 @@ dependencies = [ [[package]] name = "rattler_index" -version = "0.19.0" +version = "0.19.3" dependencies = [ "fs-err", "rattler_conda_types", @@ -2278,11 +2279,11 @@ dependencies = [ [[package]] name = "rattler_lock" -version = "0.19.0" +version = "0.20.2" dependencies = [ "chrono", "fxhash", - "indexmap 2.2.3", + "indexmap 2.2.5", "itertools", "pep440_rs", "pep508_rs", @@ -2300,22 +2301,24 @@ dependencies = [ [[package]] name = "rattler_macros" -version = "0.19.0" +version = "0.19.2" dependencies = [ "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] name = "rattler_networking" -version = "0.19.0" +version = "0.19.2" dependencies = [ "anyhow", "async-trait", "base64", + "chrono", "dirs", "fslock", "getrandom", + "http", "itertools", "keyring", "lazy_static", @@ -2335,7 +2338,7 @@ dependencies = [ [[package]] name = "rattler_package_streaming" -version = "0.19.0" +version = "0.20.0" dependencies = [ "bzip2", "chrono", @@ -2360,7 +2363,7 @@ dependencies = [ [[package]] name = "rattler_repodata_gateway" -version = "0.19.0" +version = "0.19.3" dependencies = [ "anyhow", "async-compression", @@ -2398,10 +2401,10 @@ dependencies = [ [[package]] name = "rattler_shell" -version = "0.19.0" +version = "0.19.3" dependencies = [ "enum_dispatch", - "indexmap 2.2.3", + "indexmap 2.2.5", "itertools", "rattler_conda_types", "serde_json", @@ -2413,7 +2416,7 @@ dependencies = [ [[package]] name = "rattler_solve" -version = "0.19.0" +version = "0.20.2" dependencies = [ "anyhow", "chrono", @@ -2432,7 +2435,7 @@ dependencies = [ [[package]] name = "rattler_virtual_packages" -version = "0.19.0" +version = "0.19.3" dependencies = [ "cfg-if", "libloading", @@ -2468,9 +2471,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767be24c0da52e7448d495b8d162506a9aa125426651d547d545d6c2b4b65b62" +checksum = "52b1349400e2ffd64a9fb5ed9008e33c0b8ef86bd5bae8f73080839c7082f1d5" dependencies = [ "cfg-if", "rustix 0.38.31", @@ -2508,9 +2511,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" dependencies = [ "async-compression", "base64", @@ -2586,9 +2589,9 @@ dependencies = [ [[package]] name = "retry-policies" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17dd00bff1d737c40dbcd47d4375281bf4c17933f9eef0a185fc7bacca23ecbd" +checksum = "493b4243e32d6eedd29f9a398896e35c6943a123b55eec97dcaee98310d25810" dependencies = [ "anyhow", "chrono", @@ -2794,7 +2797,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -2803,7 +2806,7 @@ version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "itoa", "ryu", "serde", @@ -2817,7 +2820,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -2842,7 +2845,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_derive", "serde_json", @@ -2859,7 +2862,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -2868,7 +2871,7 @@ version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "itoa", "ryu", "serde", @@ -3010,7 +3013,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -3038,9 +3041,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" dependencies = [ "proc-macro2", "quote", @@ -3108,9 +3111,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand 2.0.1", @@ -3135,7 +3138,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -3209,7 +3212,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -3270,7 +3273,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "toml_datetime", "winnow", ] @@ -3300,7 +3303,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", ] [[package]] @@ -3452,9 +3455,9 @@ checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3496,7 +3499,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", "wasm-bindgen-shared", ] @@ -3530,7 +3533,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.53", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3603,12 +3606,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", - "windows-targets 0.52.0", + "windows-core 0.54.0", + "windows-targets 0.52.4", ] [[package]] @@ -3617,7 +3620,26 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-result" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +dependencies = [ + "windows-targets 0.52.4", ] [[package]] @@ -3635,7 +3657,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -3655,17 +3677,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -3676,9 +3698,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -3688,9 +3710,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -3700,9 +3722,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -3712,9 +3734,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -3724,9 +3746,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -3736,9 +3758,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -3748,9 +3770,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" diff --git a/py-rattler/Cargo.toml b/py-rattler/Cargo.toml index 7cb7a7430..a099b0cf2 100644 --- a/py-rattler/Cargo.toml +++ b/py-rattler/Cargo.toml @@ -33,6 +33,7 @@ rattler_solve = { path = "../crates/rattler_solve", default-features = false, fe ] } rattler_index = { path = "../crates/rattler_index" } rattler_lock = { path = "../crates/rattler_lock", default-features = false } +rattler_package_streaming = { path = "../crates/rattler_package_streaming", default-features = false } pyo3 = { version = "0.19", features = [ "abi3-py38", diff --git a/py-rattler/docs/about_json.md b/py-rattler/docs/about_json.md index 12d6cb3a6..2635a3199 100644 --- a/py-rattler/docs/about_json.md +++ b/py-rattler/docs/about_json.md @@ -1,4 +1,3 @@ # AboutJson ::: rattler.package.about_json - diff --git a/py-rattler/docs/run_exports_json.md b/py-rattler/docs/run_exports_json.md new file mode 100644 index 000000000..9bddd929f --- /dev/null +++ b/py-rattler/docs/run_exports_json.md @@ -0,0 +1,4 @@ + +# RunExportsJson + +::: rattler.package.run_exports_json diff --git a/py-rattler/mkdocs.yml b/py-rattler/mkdocs.yml index 4d4b53c7a..bc6cb907e 100644 --- a/py-rattler/mkdocs.yml +++ b/py-rattler/mkdocs.yml @@ -48,6 +48,7 @@ nav: - PypiPackageEnvironmentData: pypi_package_environment_data.md - metadata: - AboutJson: about_json.md + - RunExportsJson: run_exports_json.md - match_spec: - MatchSpec: match_spec.md - NamelessMatchSpec: nameless_match_spec.md diff --git a/py-rattler/rattler/__init__.py b/py-rattler/rattler/__init__.py index 6a76ebaf3..666c4ebd7 100644 --- a/py-rattler/rattler/__init__.py +++ b/py-rattler/rattler/__init__.py @@ -10,7 +10,7 @@ from rattler.channel import Channel, ChannelConfig from rattler.networking import AuthenticatedClient, fetch_repo_data from rattler.virtual_package import GenericVirtualPackage, VirtualPackage -from rattler.package import PackageName, AboutJson +from rattler.package import PackageName, AboutJson, RunExportsJson from rattler.prefix import PrefixRecord, PrefixPaths from rattler.solver import solve from rattler.platform import Platform @@ -61,4 +61,5 @@ "link", "index", "AboutJson", + "RunExportsJson", ] diff --git a/py-rattler/rattler/exceptions.py b/py-rattler/rattler/exceptions.py index 6929a8deb..dd9b1599a 100644 --- a/py-rattler/rattler/exceptions.py +++ b/py-rattler/rattler/exceptions.py @@ -18,6 +18,7 @@ ConvertSubdirError, VersionBumpError, EnvironmentCreationError, + ExtractError, ) except ImportError: # They are only redefined for documentation purposes @@ -77,6 +78,9 @@ class VersionBumpError(Exception): # type: ignore[no-redef] class EnvironmentCreationError(Exception): # type: ignore[no-redef] """An error that can occur when creating an environment.""" + class ExtractError(Exception): # type: ignore[no-redef] + """An error that can occur when extracting an archive.""" + __all__ = [ "ActivationError", @@ -97,4 +101,5 @@ class EnvironmentCreationError(Exception): # type: ignore[no-redef] "ConvertSubdirError", "VersionBumpError", "EnvironmentCreationError", + "ExtractError", ] diff --git a/py-rattler/rattler/package/__init__.py b/py-rattler/rattler/package/__init__.py index 269c235fd..29b70fc90 100644 --- a/py-rattler/rattler/package/__init__.py +++ b/py-rattler/rattler/package/__init__.py @@ -1,4 +1,5 @@ from rattler.package.package_name import PackageName from rattler.package.about_json import AboutJson +from rattler.package.run_exports_json import RunExportsJson -__all__ = ["PackageName", "AboutJson"] +__all__ = ["PackageName", "AboutJson", "RunExportsJson"] diff --git a/py-rattler/rattler/package/run_exports_json.py b/py-rattler/rattler/package/run_exports_json.py new file mode 100644 index 000000000..f90937f29 --- /dev/null +++ b/py-rattler/rattler/package/run_exports_json.py @@ -0,0 +1,200 @@ +from __future__ import annotations +import os +from pathlib import Path +from typing import List + +from rattler.rattler import PyRunExportsJson + + +class RunExportsJson: + """ + A representation of the `run_exports.json` file found in package archives. + The `run_exports.json` file contains information about the run exports of a package + """ + + _inner: PyRunExportsJson + + @staticmethod + def from_package_archive(path: os.PathLike[str]) -> RunExportsJson: + """ + Parses the package file from archive. + Note: If you want to extract multiple `info/*` files then this will be slightly + slower than manually iterating over the archive entries with + custom logic as this skips over the rest of the archive + + Examples + -------- + ```python + >>> run_exports = RunExportsJson.from_package_archive( + ... "../test-data/with-symlinks/python-3.10.6-h2c4edbf_0_cpython.tar.bz2" + ... ) + >>> run_exports + RunExportsJson() + >>> + ``` + """ + return RunExportsJson._from_py_run_exports_json( + PyRunExportsJson.from_package_archive(path) + ) + + @staticmethod + def from_path(path: os.PathLike[str]) -> RunExportsJson: + """ + Parses the object from a file specified by a `path`, using a format + appropriate for the file type. + + For example, if the file is in JSON format, this function reads the data + from the file at the specified path, parse the JSON string and return the + resulting object. If the file is not in a parsable format or if the file + could not read, this function returns an error. + """ + return RunExportsJson._from_py_run_exports_json( + PyRunExportsJson.from_path(Path(path)) + ) + + @staticmethod + def from_package_directory(path: os.PathLike[str]) -> RunExportsJson: + """ + Parses the object by looking up the appropriate file from the root of the + specified Conda archive directory, using a format appropriate for the file + type. + + For example, if the file is in JSON format, this function reads the + appropriate file from the archive, parse the JSON string and return the + resulting object. If the file is not in a parsable format or if the file + could not be read, this function returns an error. + """ + return RunExportsJson._from_py_run_exports_json( + PyRunExportsJson.from_package_directory(Path(path)) + ) + + @staticmethod + def from_str(string: str) -> RunExportsJson: + """ + Parses the object from a string, using a format appropriate for the file + type. + + For example, if the file is in JSON format, this function parses the JSON + string and returns the resulting object. If the file is not in a parsable + format, this function returns an error. + """ + return RunExportsJson._from_py_run_exports_json( + PyRunExportsJson.from_str(string) + ) + + @staticmethod + def package_path() -> str: + """ + Returns the path to the file within the Conda archive. + + The path is relative to the root of the archive and includes any necessary + directories. + """ + return PyRunExportsJson.package_path() + + @property + def weak(self) -> List[str]: + """ + Weak run exports apply a dependency from host to run. + + Examples + -------- + ```python + >>> run_exports = RunExportsJson.from_package_archive( + ... "../test-data/with-symlinks/python-3.10.6-h2c4edbf_0_cpython.tar.bz2" + ... ) + >>> run_exports.weak + ['python_abi 3.10.* *_cp310'] + >>> + ``` + """ + return self._inner.weak + + @property + def strong(self) -> List[str]: + """ + Strong run exports apply a dependency from build to host and run. + + Examples + -------- + ```python + >>> run_exports = RunExportsJson.from_package_archive( + ... "../test-data/with-symlinks/python-3.10.6-h2c4edbf_0_cpython.tar.bz2" + ... ) + >>> run_exports.strong + [] + >>> + ``` + """ + return self._inner.strong + + @property + def noarch(self) -> List[str]: + """ + NoArch run exports apply a run export only to noarch packages (other run exports are ignored). + For example, python uses this to apply a dependency on python to all noarch packages, but not to + the python_abi package. + + Examples + -------- + ```python + >>> run_exports = RunExportsJson.from_package_archive( + ... "../test-data/with-symlinks/python-3.10.6-h2c4edbf_0_cpython.tar.bz2" + ... ) + >>> run_exports.noarch + ['python'] + >>> + ``` + """ + return self._inner.noarch + + @property + def weak_constrains(self) -> List[str]: + """ + Weak constrains apply a constrain dependency from host to build, or run to host. + + Examples + -------- + ```python + >>> run_exports = RunExportsJson.from_package_archive( + ... "../test-data/with-symlinks/python-3.10.6-h2c4edbf_0_cpython.tar.bz2" + ... ) + >>> run_exports.weak_constrains + [] + >>> + ``` + """ + return self._inner.weak_constrains + + @property + def strong_constrains(self) -> List[str]: + """ + Strong constrains apply a constrain dependency from build to host and run. + + Examples + -------- + ```python + >>> run_exports = RunExportsJson.from_package_archive( + ... "../test-data/with-symlinks/python-3.10.6-h2c4edbf_0_cpython.tar.bz2" + ... ) + >>> run_exports.strong_constrains + [] + >>> + ``` + """ + return self._inner.strong_constrains + + @classmethod + def _from_py_run_exports_json( + cls, py_run_exports_json: PyRunExportsJson + ) -> RunExportsJson: + run_exports_json = cls.__new__(cls) + run_exports_json._inner = py_run_exports_json + + return run_exports_json + + def __repr__(self) -> str: + """ + Returns a representation of the RunExportsJson. + """ + return "RunExportsJson()" diff --git a/py-rattler/src/error.rs b/py-rattler/src/error.rs index b455be49e..1671c6781 100644 --- a/py-rattler/src/error.rs +++ b/py-rattler/src/error.rs @@ -8,6 +8,7 @@ use rattler_conda_types::{ ParseMatchSpecError, ParsePlatformError, ParseVersionError, VersionBumpError, }; use rattler_lock::{ConversionError, ParseCondaLockError}; +use rattler_package_streaming::ExtractError; use rattler_repodata_gateway::fetch::FetchRepoDataError; use rattler_shell::activation::ActivationError; use rattler_solve::SolveError; @@ -59,6 +60,8 @@ pub enum PyRattlerError { RequirementError(String), #[error("{0}")] EnvironmentCreationError(String), + #[error(transparent)] + ExtractError(#[from] ExtractError), } impl From for PyErr { @@ -105,6 +108,7 @@ impl From for PyErr { PyRattlerError::EnvironmentCreationError(err) => { EnvironmentCreationException::new_err(err) } + PyRattlerError::ExtractError(err) => ExtractException::new_err(err.to_string()), } } } @@ -130,3 +134,4 @@ create_exception!(exceptions, ParseCondaLockException, PyException); create_exception!(exceptions, ConversionException, PyException); create_exception!(exceptions, RequirementException, PyException); create_exception!(exceptions, EnvironmentCreationException, PyException); +create_exception!(exceptions, ExtractException, PyException); diff --git a/py-rattler/src/lib.rs b/py-rattler/src/lib.rs index 9fec90821..121a2af4a 100644 --- a/py-rattler/src/lib.rs +++ b/py-rattler/src/lib.rs @@ -19,13 +19,14 @@ mod solver; mod version; mod virtual_package; +mod run_exports_json; use about_json::PyAboutJson; use channel::{PyChannel, PyChannelConfig}; use error::{ ActivationException, CacheDirException, ConvertSubdirException, DetectVirtualPackageException, - EnvironmentCreationException, FetchRepoDataException, InvalidChannelException, - InvalidMatchSpecException, InvalidPackageNameException, InvalidUrlException, - InvalidVersionException, IoException, LinkException, ParseArchException, + EnvironmentCreationException, ExtractException, FetchRepoDataException, + InvalidChannelException, InvalidMatchSpecException, InvalidPackageNameException, + InvalidUrlException, InvalidVersionException, IoException, LinkException, ParseArchException, ParsePlatformException, PyRattlerError, SolverException, TransactionException, VersionBumpException, }; @@ -40,6 +41,7 @@ use networking::{authenticated_client::PyAuthenticatedClient, py_fetch_repo_data use package_name::PyPackageName; use prefix_paths::PyPrefixPaths; use repo_data::{patch_instructions::PyPatchInstructions, sparse::PySparseRepoData, PyRepoData}; +use run_exports_json::PyRunExportsJson; use version::PyVersion; use pyo3::prelude::*; @@ -97,6 +99,8 @@ fn rattler(py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_class::().unwrap(); + m.add_class::().unwrap(); + m.add_function(wrap_pyfunction!(py_solve, m).unwrap()) .unwrap(); m.add_function(wrap_pyfunction!(get_rattler_version, m).unwrap()) @@ -170,5 +174,8 @@ fn rattler(py: Python<'_>, m: &PyModule) -> PyResult<()> { ) .unwrap(); + m.add("ExtractError", py.get_type::()) + .unwrap(); + Ok(()) } diff --git a/py-rattler/src/lock/mod.rs b/py-rattler/src/lock/mod.rs index 4fb283db9..7c8e9a21f 100644 --- a/py-rattler/src/lock/mod.rs +++ b/py-rattler/src/lock/mod.rs @@ -476,7 +476,11 @@ impl PyPypiPackageEnvironmentData { /// The extras enabled for the package. Note that the order doesn't matter. #[getter] pub fn extras(&self) -> BTreeSet { - self.inner.extras.iter().map(|e| e.to_string()).collect() + self.inner + .extras + .iter() + .map(std::string::ToString::to_string) + .collect() } } diff --git a/py-rattler/src/run_exports_json.rs b/py-rattler/src/run_exports_json.rs new file mode 100644 index 000000000..0213f708e --- /dev/null +++ b/py-rattler/src/run_exports_json.rs @@ -0,0 +1,120 @@ +use pyo3::{pyclass, pymethods, PyResult}; +use rattler_conda_types::package::{PackageFile, RunExportsJson}; +use rattler_package_streaming::seek::read_package_file; +use std::path::PathBuf; + +use crate::error::PyRattlerError; + +/// A representation of the `run_exports.json` file found in package archives. +/// +/// The `run_exports.json` file contains information about the run exports of a package +#[pyclass] +#[repr(transparent)] +#[derive(Clone)] +pub struct PyRunExportsJson { + pub(crate) inner: RunExportsJson, +} + +impl From for PyRunExportsJson { + fn from(value: RunExportsJson) -> Self { + Self { inner: value } + } +} + +impl From for RunExportsJson { + fn from(value: PyRunExportsJson) -> Self { + value.inner + } +} + +#[pymethods] +impl PyRunExportsJson { + /// Parses the package file from archive. + /// Note: If you want to extract multiple `info/*` files then this will be slightly + /// slower than manually iterating over the archive entries with + /// custom logic as this skips over the rest of the archive + #[staticmethod] + pub fn from_package_archive(path: PathBuf) -> PyResult { + Ok(read_package_file::(path) + .map(Into::into) + .map_err(PyRattlerError::from)?) + } + + /// Parses the object from a file specified by a `path`, using a format appropriate for the file + /// type. + /// + /// For example, if the file is in JSON format, this function reads the data from the file at + /// the specified path, parse the JSON string and return the resulting object. If the file is + /// not in a parsable format or if the file could not read, this function returns an error. + #[staticmethod] + pub fn from_path(path: PathBuf) -> PyResult { + Ok(RunExportsJson::from_path(path) + .map(Into::into) + .map_err(PyRattlerError::from)?) + } + + /// Parses the object by looking up the appropriate file from the root of the specified Conda + /// archive directory, using a format appropriate for the file type. + /// + /// For example, if the file is in JSON format, this function reads the appropriate file from + /// the archive, parse the JSON string and return the resulting object. If the file is not in a + /// parsable format or if the file could not be read, this function returns an error. + #[staticmethod] + pub fn from_package_directory(path: PathBuf) -> PyResult { + Ok(RunExportsJson::from_package_directory(path) + .map(Into::into) + .map_err(PyRattlerError::from)?) + } + + /// Parses the object from a string, using a format appropriate for the file type. + /// + /// For example, if the file is in JSON format, this function parses the JSON string and returns + /// the resulting object. If the file is not in a parsable format, this function returns an + /// error. + #[staticmethod] + pub fn from_str(str: &str) -> PyResult { + Ok(RunExportsJson::from_str(str) + .map(Into::into) + .map_err(PyRattlerError::from)?) + } + + /// Returns the path to the file within the Conda archive. + /// + /// The path is relative to the root of the archive and include any necessary directories. + #[staticmethod] + pub fn package_path() -> PathBuf { + RunExportsJson::package_path().to_owned() + } + + /// Weak run exports apply a dependency from host to run. + #[getter] + pub fn weak(&self) -> Vec { + self.inner.weak.clone() + } + + /// Strong run exports apply a dependency from build to host and run. + #[getter] + pub fn strong(&self) -> Vec { + self.inner.strong.clone() + } + + /// NoArch run exports apply a run export only to noarch packages (other run exports are ignored). + /// For example, python uses this to apply a dependency on python to all noarch packages, but not to + /// the python_abi package. + #[getter] + pub fn noarch(&self) -> Vec { + self.inner.noarch.clone() + } + + /// Weak constrains apply a constrain dependency from host to build, or run to host. + #[getter] + pub fn weak_constrains(&self) -> Vec { + self.inner.weak_constrains.clone() + } + + /// Strong constrains apply a constrain dependency from build to host and run. + #[getter] + pub fn strong_constrains(&self) -> Vec { + self.inner.strong_constrains.clone() + } +}