Skip to main content

extract_pkg_name

Function extract_pkg_name 

Source
pub fn extract_pkg_name(requirement: &str) -> &str
Expand description

Normalize a requirement spec to its bare package name.

Strips environment markers (;), extras ([...]), version specifiers (==, >=, etc.), and trailing whitespace. "nvidia-cudnn-cu12==8.9..." → "nvidia-cudnn-cu12"; "triton-windows [test]>=3.5 ; sys_platform==..." → "triton-windows".