Skip to content

Commit

Permalink
Merge pull request #739 from conda/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
maresb authored Nov 25, 2024
2 parents b7e87a1 + 4f9e53b commit 6efc47b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ repos:
exclude: ^conda_lock/_vendor/conda/_vendor/appdirs\.py$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.8.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion conda_lock/interfaces/vendored_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from conda_lock._vendor.conda.models.match_spec import MatchSpec


__all__ = ["toposort", "MatchSpec", "mask_anaconda_token", "split_anaconda_token"]
__all__ = ["MatchSpec", "mask_anaconda_token", "split_anaconda_token", "toposort"]
2 changes: 1 addition & 1 deletion conda_lock/interfaces/vendored_poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"Link",
"Operation",
"PoetryDependency",
"PoetryPackage",
"PoetryDirectoryDependency",
"PoetryFileDependency",
"PoetryPackage",
"PoetryProjectPackage",
"PoetrySolver",
"PoetryURLDependency",
Expand Down
2 changes: 1 addition & 1 deletion conda_lock/lockfile/v2prelim/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ def __init__(
"GitMeta",
"HashModel",
"InputMeta",
"LockMeta",
"LockedDependency",
"Lockfile",
"LockMeta",
"MetadataOption",
"TimeMeta",
"UpdateSpecification",
Expand Down
2 changes: 1 addition & 1 deletion conda_lock/virtual_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def to_repodata_entry(self) -> Tuple[str, Dict[str, Any]]:
class FakeRepoData(BaseModel):
base_path: pathlib.Path
packages_by_subdir: DefaultDict[FakePackage, Set[str]] = Field(
default_factory=lambda: defaultdict(set) # type: ignore[arg-type]
default_factory=lambda: defaultdict(set) # type: ignore[arg-type,unused-ignore]
)
all_subdirs: Set[str] = {
"noarch",
Expand Down
6 changes: 3 additions & 3 deletions tests/test_conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1989,17 +1989,17 @@ def test_aggregate_lock_specs_invalid_pip_repos():
sources=[],
)

spec_a_b = base_spec.copy(update={"pip_repositories": [repo_a, repo_b]})
spec_a_b = base_spec.model_copy(update={"pip_repositories": [repo_a, repo_b]})
agg_spec = aggregate_lock_specs([base_spec, spec_a_b, spec_a_b], platforms=[])
assert agg_spec.pip_repositories == spec_a_b.pip_repositories

# swap the order of the two repositories, which is an error
spec_b_a = base_spec.copy(update={"pip_repositories": [repo_b, repo_a]})
spec_b_a = base_spec.model_copy(update={"pip_repositories": [repo_b, repo_a]})
with pytest.raises(ChannelAggregationError):
agg_spec = aggregate_lock_specs([base_spec, spec_a_b, spec_b_a], platforms=[])

# We can combine ["a"] with ["b", "a"], but not with ["a", "b"].
spec_a = base_spec.copy(update={"pip_repositories": [repo_a]})
spec_a = base_spec.model_copy(update={"pip_repositories": [repo_a]})
aggregate_lock_specs([base_spec, spec_a, spec_b_a], platforms=[])
with pytest.raises(ChannelAggregationError):
aggregate_lock_specs([base_spec, spec_a, spec_a_b], platforms=[])
Expand Down

0 comments on commit 6efc47b

Please sign in to comment.