Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pep440_rs, pep508_rs and pyproject-toml #1945

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 48 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ rustc_version = "0.4.0"
semver = "1.0.13"
target-lexicon = "0.12.8"
indexmap = "2.0.2"
pyproject-toml = "0.8.1"
pyproject-toml = "0.10.0"
python-pkginfo = "0.6.0"
textwrap = "0.16.0"
ignore = "0.4.20"
Expand All @@ -72,8 +72,8 @@ cc = "1.0.72"
dunce = "1.0.2"
normpath = "1.0.0"
path-slash = "0.2.1"
pep440_rs = { version = "0.3.6", features = ["serde"] }
pep508_rs = { version = "0.2.1", features = ["serde"] }
pep440_rs = { version = "0.5.0", features = ["serde", "tracing"] }
pep508_rs = { version = "0.4.2", features = ["serde", "tracing"] }
time = "0.3.17"

# cli
Expand Down
4 changes: 2 additions & 2 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fn bin_wasi_helper(
if !metadata21
.requires_dist
.iter()
.any(|requirement| requirement.name == "wasmtime")
.any(|requirement| requirement.name.as_ref() == "wasmtime")
{
// Having the wasmtime version hardcoded is not ideal, it's easy enough to overwrite
metadata21
Expand Down Expand Up @@ -900,7 +900,7 @@ impl BuildContext {
.metadata21
.requires_dist
.iter()
.any(|requirement| requirement.name == "cffi")
.any(|requirement| requirement.name.as_ref() == "cffi")
{
eprintln!(
"⚠️ Warning: missing cffi package dependency, please add it to pyproject.toml. \
Expand Down
2 changes: 1 addition & 1 deletion src/module_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ mod tests {
#[test]
// The mechanism is the same for wheel_writer
fn sdist_writer_excludes() -> Result<(), Box<dyn std::error::Error>> {
let metadata = Metadata21::new("dummy".to_string(), Version::from_release(vec![1, 0]));
let metadata = Metadata21::new("dummy".to_string(), Version::new([1, 0]));
let perm = 0o777;

// No excludes
Expand Down
2 changes: 1 addition & 1 deletion src/pyproject_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ impl PyProjectToml {
.build_system
.requires
.iter()
.find(|x| x.name == maturin);
.find(|x| x.name.as_ref() == maturin);
if let Some(requires_maturin) = requires_maturin {
match requires_maturin.version_or_url.as_ref() {
Some(VersionOrUrl::VersionSpecifier(version_specifier)) => {
Expand Down
9 changes: 4 additions & 5 deletions src/python_interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn windows_interpreter_no_build(

// From requires-python in pyproject.toml
if let Some(requires_python) = requires_python {
if !requires_python.contains(&Version::from_release(vec![major, minor])) {
if !requires_python.contains(&Version::new([major as u64, minor as u64])) {
return true;
}
}
Expand Down Expand Up @@ -726,7 +726,7 @@ impl PythonInterpreter {
.filter_map(|config| match requires_python {
Some(requires_python) => {
if requires_python
.contains(&Version::from_release(vec![config.major, config.minor]))
.contains(&Version::new([config.major as u64, config.minor as u64]))
{
Some(Self::from_config(config))
} else {
Expand Down Expand Up @@ -760,7 +760,7 @@ impl PythonInterpreter {
.filter(|minor| {
requires_python
.map(|requires_python| {
requires_python.contains(&Version::from_release(vec![3, *minor]))
requires_python.contains(&Version::new([3, *minor as u64]))
})
.unwrap_or(true)
})
Expand All @@ -776,8 +776,7 @@ impl PythonInterpreter {
.filter(|minor| {
requires_python
.map(|requires_python| {
requires_python
.contains(&Version::from_release(vec![3, *minor]))
requires_python.contains(&Version::new([3, *minor as u64]))
})
.unwrap_or(true)
})
Expand Down
12 changes: 6 additions & 6 deletions test-crates/pyo3-no-extension-module/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading