Skip to content

Commit

Permalink
move virtual_project_analysis.py to the tools directory
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Sep 23, 2024
1 parent d6c3f8d commit 5569f6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repos:
hooks:
- id: virtual_project_dependency_cycles
name: Check for dependency cycles in project packages
entry: ./activated.py python chia/util/virtual_project_analysis.py print_cycles --directory chia --config virtual_project.yaml
entry: ./activated.py python tools/virtual_project_analysis.py print_cycles --directory chia --config virtual_project.yaml
language: system
pass_filenames: false
- repo: local
Expand Down
10 changes: 5 additions & 5 deletions chia/_tests/tools/test_virtual_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import yaml
from click.testing import CliRunner

from chia.util.virtual_project_analysis import (
from tools.virtual_project_analysis import (
Annotation,
ChiaFile,
Config,
Expand Down Expand Up @@ -236,8 +236,8 @@ def mock_chia_file_parse(path: Path) -> ChiaFile:

@pytest.fixture
def prepare_mocks(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr("chia.util.virtual_project_analysis.build_dependency_graph", mock_build_dependency_graph)
monkeypatch.setattr("chia.util.virtual_project_analysis.ChiaFile.parse", mock_chia_file_parse)
monkeypatch.setattr("tools.virtual_project_analysis.build_dependency_graph", mock_build_dependency_graph)
monkeypatch.setattr("tools.virtual_project_analysis.ChiaFile.parse", mock_chia_file_parse)


def test_build_virtual_dependency_graph(prepare_mocks: None) -> None:
Expand Down Expand Up @@ -279,7 +279,7 @@ def mock_chia_file_parse2(path: Path) -> ChiaFile:

@pytest.fixture
def prepare_mocks2(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr("chia.util.virtual_project_analysis.ChiaFile.parse", mock_chia_file_parse2)
monkeypatch.setattr("tools.virtual_project_analysis.ChiaFile.parse", mock_chia_file_parse2)


def test_cycle_detection(prepare_mocks2: None) -> None:
Expand Down Expand Up @@ -441,7 +441,7 @@ def _mock_chia_file_parse(path: Path) -> ChiaFile:
}
return ChiaFile(path=Path(path), annotations=annotations_map.get(path, Annotation("chia-blockchain", False)))

monkeypatch.setattr("chia.util.virtual_project_analysis.ChiaFile.parse", _mock_chia_file_parse)
monkeypatch.setattr("tools.virtual_project_analysis.ChiaFile.parse", _mock_chia_file_parse)

graph = {
Path("/path/to/package1/module1a.py"): [Path("/path/to/package2/module2.py")],
Expand Down
File renamed without changes.

0 comments on commit 5569f6a

Please sign in to comment.