Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Oct 26, 2024
1 parent 0c9e5a8 commit 3dc29ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions py-rattler/rattler/repo_data/package_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def to_graph(records: List[PackageRecord]) -> nx.DiGraph: # type: ignore[type-a
return graph

@staticmethod
def validate_package_records(records: List[PackageRecord]) -> None:
def validate(records: List[PackageRecord]) -> None:
"""
Validate that the given package records are valid w.r.t. 'depends' and 'constrains'.
Expand All @@ -133,16 +133,16 @@ def validate_package_records(records: List[PackageRecord]) -> None:
```python
>>> from os import listdir
>>> from os.path import isfile, join
>>> from rattler import PrefixRecord
>>> from rattler import PackageRecord
>>> records = [
... PrefixRecord.from_path(join("../test-data/conda-meta/", f))
... PackageRecord.from_path(join("../test-data/conda-meta/", f))
... for f in listdir("../test-data/conda-meta")
... if isfile(join("../test-data/conda-meta", f))
... ]
>>> PrefixRecord.validate_package_records(records)
>>> PackageRecord.validate(records)
```
"""
return PyRecord.validate_package_records(records)
return PyRecord.validate(records)

@classmethod
def _from_py_record(cls, py_record: PyRecord) -> PackageRecord:
Expand Down
2 changes: 1 addition & 1 deletion py-rattler/src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl PyRecord {
/// of each package are satisfied by the other packages in the list.
/// If there is a dependency that is not satisfied, this function will raise an exception.
#[staticmethod]
fn validate_package_records(records: Vec<&PyAny>) -> PyResult<()> {
fn validate(records: Vec<&PyAny>) -> PyResult<()> {
let records = records
.into_iter()
.map(PyRecord::try_from)
Expand Down

0 comments on commit 3dc29ed

Please sign in to comment.