Skip to content
Merged
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
implement sys.implementation cache_tag
  • Loading branch information
youknowone committed Nov 14, 2025
commit fb8d3992f583cf4ea882c0873ff500f212e1b02c
8 changes: 5 additions & 3 deletions vm/src/stdlib/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,13 @@ mod sys {

#[pyattr]
fn implementation(vm: &VirtualMachine) -> PyRef<PyNamespace> {
// TODO: Add crate version to this namespace
const NAME: &str = "rustpython";

let cache_tag = format!("{NAME}-{}{}", version::MAJOR, version::MINOR);
let ctx = &vm.ctx;
py_namespace!(vm, {
"name" => ctx.new_str(ascii!("rustpython")),
"cache_tag" => ctx.new_str(ascii!("rustpython-01")),
"name" => ctx.new_str(NAME),
"cache_tag" => ctx.new_str(cache_tag),
"_multiarch" => ctx.new_str(MULTIARCH.to_owned()),
"version" => version_info(vm),
"hexversion" => ctx.new_int(version::VERSION_HEX),
Expand Down
Loading