Skip to content

Commit

Permalink
Remove pyclass extends
Browse files Browse the repository at this point in the history
Enabling extends blocks the auto-generation of IntoPy (missing
PyAsPointer). The python code doesn't depend on these types being in a
class hierarchy.

Signed-off-by: J Robert Ray <[email protected]>
  • Loading branch information
J Robert Ray committed Aug 8, 2021
1 parent 3f0e662 commit d1e602d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
13 changes: 6 additions & 7 deletions src/solve/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ pub enum NoteEnum {
SkipPackageNote(SkipPackageNote),
}

#[pyclass(extends=Change)]
#[pyclass]
#[derive(Clone, Debug)]
pub struct RequestPackage {
request: api::PkgRequest,
Expand All @@ -367,7 +367,7 @@ impl ChangeT for RequestPackage {
}
}

#[pyclass(extends=Change)]
#[pyclass]
#[derive(Clone, Debug)]
pub struct RequestVar {
request: api::VarRequest,
Expand Down Expand Up @@ -396,7 +396,7 @@ impl ChangeT for RequestVar {
}
}

#[pyclass(extends=Change, subclass)]
#[pyclass]
#[derive(Clone, Debug)]
pub struct SetOptions {
options: api::OptionMap,
Expand All @@ -421,7 +421,7 @@ impl ChangeT for SetOptions {
}
}

#[pyclass(extends=Change, subclass)]
#[pyclass]
#[derive(Clone, Debug)]
pub struct SetPackage {
spec: api::Spec,
Expand All @@ -441,7 +441,7 @@ impl ChangeT for SetPackage {
}

/// Sets a package in the resolve, denoting is as a new build.
#[pyclass(extends=SetPackage)]
#[pyclass]
#[derive(Clone, Debug)]
pub struct SetPackageBuild {
spec: api::Spec,
Expand All @@ -462,7 +462,6 @@ impl ChangeT for SetPackageBuild {
base.with_package(self.spec.clone(), self.source.clone())
}
}

#[pyclass]
#[derive(Clone, Debug)]
pub struct State {
Expand Down Expand Up @@ -683,7 +682,7 @@ impl SkipPackageNote {
}
}

#[pyclass(extends=Change)]
#[pyclass]
#[derive(Clone, Debug)]
pub struct StepBack {
cause: String,
Expand Down
14 changes: 7 additions & 7 deletions src/solve/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ValidatorT for Validators {
pub struct Validator {}

/// Ensures that deprecated packages are not included unless specifically requested.
#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct DeprecationValidator {}

Expand Down Expand Up @@ -76,7 +76,7 @@ impl ValidatorT for DeprecationValidator {
}

/// Enforces the resolution of binary packages only, denying new builds from source.
#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct BinaryOnlyValidator {}

Expand All @@ -103,7 +103,7 @@ impl ValidatorT for BinaryOnlyValidator {
}
}

#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct EmbeddedPackageValidator {}

Expand Down Expand Up @@ -139,7 +139,7 @@ impl ValidatorT for EmbeddedPackageValidator {
}

/// Ensures that a package is compatible with all requested options.
#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct OptionsValidator {}

Expand All @@ -163,7 +163,7 @@ impl ValidatorT for OptionsValidator {
}

/// Ensures that a package meets all requested version criteria.
#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct PkgRequestValidator {}

Expand Down Expand Up @@ -194,7 +194,7 @@ impl ValidatorT for PkgRequestValidator {
}

/// Validates that the pkg install requirements do not conflict with the existing resolve.
#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct PkgRequirementsValidator {}

Expand Down Expand Up @@ -251,7 +251,7 @@ impl ValidatorT for PkgRequirementsValidator {
}

/// Validates that the var install requirements do not conflict with the existing options.
#[pyclass(extends=Validator)]
#[pyclass]
#[derive(Clone, Copy)]
pub struct VarRequirementsValidator {}

Expand Down

0 comments on commit d1e602d

Please sign in to comment.