Skip to content

Commit

Permalink
Fix pep508_rs doc test (#963)
Browse files Browse the repository at this point in the history
Since nextest does not run doctests, this did not show up on CI.
  • Loading branch information
konstin authored Jan 18, 2024
1 parent 5ec5a32 commit 7acde5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/install-wheel-rs/src/wheel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub(crate) fn write_script_entrypoints(
record,
)?;
// We need to make the launcher executable
#[cfg(target_family = "unix")]
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
fs::set_permissions(
Expand Down
11 changes: 6 additions & 5 deletions crates/pep508-rs/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,15 +733,16 @@ impl MarkerExpression {
/// # use pep440_rs::Version;
///
/// # fn main() -> Result<(), Pep508Error> {
/// use puffin_normalize::ExtraName;
/// 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();
/// assert!(marker_tree.evaluate_extras_and_python_version(&["day".to_string()].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("day").unwrap()].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"#)?;
/// 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(&["day".to_string()].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, 9])]));
/// 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(&[ExtraName::from_str("day").unwrap()].into(), &vec![Version::new([3, 11])]));
/// # Ok(())
/// # }
/// ```
Expand Down

0 comments on commit 7acde5a

Please sign in to comment.