mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-27 14:15:49 +00:00
Fix pep508_rs doc test (#963)
Since nextest does not run doctests, this did not show up on CI.
This commit is contained in:
parent
5ec5a3243c
commit
7acde5a9a0
2 changed files with 7 additions and 6 deletions
|
|
@ -362,7 +362,7 @@ pub(crate) fn write_script_entrypoints(
|
||||||
record,
|
record,
|
||||||
)?;
|
)?;
|
||||||
// We need to make the launcher executable
|
// We need to make the launcher executable
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
|
|
||||||
|
|
@ -733,15 +733,16 @@ impl MarkerExpression {
|
||||||
/// # use pep440_rs::Version;
|
/// # use pep440_rs::Version;
|
||||||
///
|
///
|
||||||
/// # fn main() -> Result<(), Pep508Error> {
|
/// # fn main() -> Result<(), Pep508Error> {
|
||||||
|
/// use puffin_normalize::ExtraName;
|
||||||
/// let marker_tree = MarkerTree::from_str(r#"("linux" in sys_platform) and extra == 'day'"#)?;
|
/// let marker_tree = MarkerTree::from_str(r#"("linux" in sys_platform) and extra == 'day'"#)?;
|
||||||
/// let versions: Vec<Version> = (8..12).map(|minor| Version::new([3, minor])).collect();
|
/// let versions: Vec<Version> = (8..12).map(|minor| Version::new([3, minor])).collect();
|
||||||
/// assert!(marker_tree.evaluate_extras_and_python_version(&["day".to_string()].into(), &versions));
|
/// assert!(marker_tree.evaluate_extras_and_python_version(&[ExtraName::from_str("day").unwrap()].into(), &versions));
|
||||||
/// assert!(!marker_tree.evaluate_extras_and_python_version(&["night".to_string()].into(), &versions));
|
/// assert!(!marker_tree.evaluate_extras_and_python_version(&[ExtraName::from_str("night").unwrap()].into(), &versions));
|
||||||
///
|
///
|
||||||
/// let marker_tree = MarkerTree::from_str(r#"extra == 'day' and python_version < '3.11' and '3.10' <= python_version"#)?;
|
/// let marker_tree = MarkerTree::from_str(r#"extra == 'day' and python_version < '3.11' and '3.10' <= python_version"#)?;
|
||||||
/// assert!(!marker_tree.evaluate_extras_and_python_version(&["day".to_string()].into(), &vec![Version::new([3, 9])]));
|
/// assert!(!marker_tree.evaluate_extras_and_python_version(&[ExtraName::from_str("day").unwrap()].into(), &vec![Version::new([3, 9])]));
|
||||||
/// assert!(marker_tree.evaluate_extras_and_python_version(&["day".to_string()].into(), &vec![Version::new([3, 10])]));
|
/// assert!(marker_tree.evaluate_extras_and_python_version(&[ExtraName::from_str("day").unwrap()].into(), &vec![Version::new([3, 10])]));
|
||||||
/// assert!(!marker_tree.evaluate_extras_and_python_version(&["day".to_string()].into(), &vec![Version::new([3, 11])]));
|
/// assert!(!marker_tree.evaluate_extras_and_python_version(&[ExtraName::from_str("day").unwrap()].into(), &vec![Version::new([3, 11])]));
|
||||||
/// # Ok(())
|
/// # Ok(())
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue