From 84a486fb1400ae46817e1012460accc7f1d03b5c Mon Sep 17 00:00:00 2001 From: Paul Sanders Date: Sun, 10 Dec 2023 21:01:31 -0500 Subject: [PATCH] Bump default pytest version 7.4.2 -> 7.4.3 --- src/package_version.rs | 2 +- src/project_generator.rs | 33 +++++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/package_version.rs b/src/package_version.rs index cd22196..95451f1 100644 --- a/src/package_version.rs +++ b/src/package_version.rs @@ -166,7 +166,7 @@ pub fn default_version(package: &PythonPackage, min_python_version: &str) -> Str "3.6.0".to_string() } } - PythonPackage::Pytest => "7.4.2".to_string(), + PythonPackage::Pytest => "7.4.3".to_string(), PythonPackage::PytestCov => "4.1.0".to_string(), PythonPackage::Ruff => "0.1.7".to_string(), PythonPackage::Tomli => "2.0.1".to_string(), diff --git a/src/project_generator.rs b/src/project_generator.rs index e72093f..8835cf5 100644 --- a/src/project_generator.rs +++ b/src/project_generator.rs @@ -734,16 +734,23 @@ maturin=={maturin} ) } - fn min_requirments_file() -> String { - r#"mypy>=1.7.1 -pre-commit>=3.5.0 -pytest>=7.4.2 -pytest-cov>=4.1.0 -ruff>=0.1.7 -maturin>=1.4.0 + fn min_requirments_file(min_python_version: &str) -> String { + let mypy = default_version(&PythonPackage::MyPy, min_python_version); + let maturin = default_version(&PythonPackage::Maturin, min_python_version); + let pre_commit = default_version(&PythonPackage::PreCommit, min_python_version); + let pytest = default_version(&PythonPackage::Pytest, min_python_version); + let pytest_cov = default_version(&PythonPackage::PytestCov, min_python_version); + let ruff = default_version(&PythonPackage::Ruff, min_python_version); + format!( + r#"mypy>={mypy} +pre-commit>={pre_commit} +pytest>={pytest} +pytest-cov>={pytest_cov} +ruff>={ruff} +maturin>={maturin} -e . "# - .to_string() + ) } #[test] @@ -2133,7 +2140,10 @@ fix = true let content = std::fs::read_to_string(expected_file).unwrap(); - assert_eq!(content, min_requirments_file()); + assert_eq!( + content, + min_requirments_file(&project_info.min_python_version) + ); } #[test] @@ -2170,7 +2180,10 @@ fix = true let content = std::fs::read_to_string(expected_file).unwrap(); - assert_eq!(content, min_requirments_file()); + assert_eq!( + content, + min_requirments_file(&project_info.min_python_version) + ); } #[test]