Skip to content

Commit

Permalink
fix: issue with pm manifest cache
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Dec 14, 2023
1 parent 123e0d3 commit 794e905
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/ape/api/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ def _extract_local_manifest(
**extras,
)

# Replace the dependency's manifest with the temp project's.
self.replace_manifest(project.manifest)
return project.manifest

def _get_sources(self, project: ProjectAPI) -> List[Path]:
Expand Down
21 changes: 15 additions & 6 deletions tests/integration/cli/test_pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ def test_install_path_not_exists(ape_cli, runner):


@run_once
def test_install_path_to_local_package(ape_cli, runner):
project = "with-contracts"
path = Path(__file__).parent / "projects" / project
result = runner.invoke(ape_cli, ["pm", "install", path.as_posix(), "--name", project])
def test_install_path_to_local_package(ape_cli, runner, project):
project_name = "with-contracts"
path = Path(__file__).parent / "projects" / project_name
name = path.stem
result = runner.invoke(ape_cli, ["pm", "install", path.as_posix(), "--name", project_name])
assert result.exit_code == 0, result.output
assert f"Package '{path.as_posix()}' installed."

# Ensure was installed correctly.
assert (project.dependency_manager.DATA_FOLDER / "packages" / name).is_dir()


@run_once
def test_install_path_to_local_config_file(ape_cli, runner):
Expand Down Expand Up @@ -188,11 +192,16 @@ def test_remove_cancel(ape_cli, runner):


@skip_projects_except("only-dependencies")
def test_remove_invalid_version(ape_cli, runner):
def test_remove_invalid_version(ape_cli, runner, project):
package_name = "dependency-in-project-only"

# Install packages
runner.invoke(ape_cli, ["pm", "install", ".", "--force"])

package_name = "dependency-in-project-only"
# Ensure was installed correctly.
assert package_name in project.dependencies
assert (project.dependency_manager.DATA_FOLDER / "packages" / package_name).is_dir()

invalid_version = "0.0.0"
result = runner.invoke(ape_cli, ["pm", "remove", package_name, invalid_version])

Expand Down

0 comments on commit 794e905

Please sign in to comment.