Skip to content

Commit

Permalink
remove validate flag for now
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-byte committed Mar 5, 2023
1 parent 65c36b2 commit 6143b4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
9 changes: 2 additions & 7 deletions src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,14 +729,9 @@ def _download_link(self, operation: Install | Update, link: Link) -> Path:

return archive

def _populate_hashes_dict(
self, archive: Path, package: Package, validate=True
) -> None:
def _populate_hashes_dict(self, archive: Path, package: Package) -> None:
if package.files and archive.name in {f["file"] for f in package.files}:
if validate:
archive_hash = self._validate_archive_hash(archive, package)
else:
archive_hash: str = "sha256:" + get_file_hash(archive)
archive_hash = self._validate_archive_hash(archive, package)
self._hashes[package.name] = archive_hash

@staticmethod
Expand Down
16 changes: 7 additions & 9 deletions tests/installation/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,11 @@ def test_executor_should_write_pep610_url_references_for_wheel_files(


def test_executor_should_write_pep610_url_references_for_non_wheel_files(
tmp_venv: VirtualEnv, pool: RepositoryPool, config: Config, io: BufferedIO
tmp_venv: VirtualEnv, pool: RepositoryPool, config: Config, io: BufferedIO
):
url = (
Path(__file__)
.parent.parent.joinpath(
"fixtures/distributions/demo-0.1.0.tar.gz"
)
.parent.parent.joinpath("fixtures/distributions/demo-0.1.0.tar.gz")
.resolve()
)
package = Package("demo", "0.1.0", source_type="file", source_url=url.as_posix())
Expand Down Expand Up @@ -779,11 +777,11 @@ def test_executor_should_write_pep610_url_references_for_wheel_urls(


def test_executor_should_not_write_pep610_url_references_for_non_wheel_urls(
tmp_venv: VirtualEnv,
pool: RepositoryPool,
config: Config,
io: BufferedIO,
mock_file_downloads: None,
tmp_venv: VirtualEnv,
pool: RepositoryPool,
config: Config,
io: BufferedIO,
mock_file_downloads: None,
):
package = Package(
"demo",
Expand Down

0 comments on commit 6143b4e

Please sign in to comment.