Skip to content

Commit

Permalink
Merge pull request #160 from sanders41/pytest
Browse files Browse the repository at this point in the history
Bump default pytest version 7.4.2 -> 7.4.3
  • Loading branch information
sanders41 authored Dec 11, 2023
2 parents 43f3631 + 84a486f commit 35868e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/package_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
33 changes: 23 additions & 10 deletions src/project_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 35868e6

Please sign in to comment.