Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirement, resolvelib: Hash package contents to verify requirement file hashes #462

Merged
merged 28 commits into from
Jan 25, 2023

Conversation

tetsuo-cpp
Copy link
Contributor

Closes #433

@tetsuo-cpp tetsuo-cpp marked this pull request as draft January 4, 2023 14:52
@tetsuo-cpp
Copy link
Contributor Author

tetsuo-cpp commented Jan 4, 2023

Just pushing for visibility, this is not ready. Still needs tests, refinement, etc.

In order to get this to work, I've had to push hashed requirements file down the dependency resolution path where we can no longer take advantage of the fact that these files are guaranteed to be fully resolved. We could potentially do something like get hack the Candidate to report no sub-dependencies when hashes are provided.

There's some really ugly bits here that I'm not super pleased with. I'll sleep on it and come back to it tomorrow but if anyone has a better design, I'd be glad to hear it.

@tetsuo-cpp tetsuo-cpp requested review from woodruffw and di January 4, 2023 15:10
@tetsuo-cpp tetsuo-cpp marked this pull request as ready for review January 16, 2023 15:26
@tetsuo-cpp tetsuo-cpp requested a review from woodruffw January 16, 2023 15:26
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! A few small nits, but overall this looks great!

(We should also make sure to add a CHANGELOG entry before merging.)

@tetsuo-cpp tetsuo-cpp merged commit a082574 into main Jan 25, 2023
@tetsuo-cpp tetsuo-cpp deleted the alex/third-party-index-hashing branch January 25, 2023 02:47
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 19, 2023
## [2.5.1]

### Fixed

* Fixed a crash on Windows caused by multiple open file handles to
  input requirements ([#551](pypa/pip-audit#551))

## [2.5.0]

### Changed

* Improved error messaging when a requirements input or indirect dependency
  has an invalid (non-PEP 440) requirements specifier
  ([#507](pypa/pip-audit#507))

* `pip-audit`'s handling of dependency resolution has been significantly
  refactored and simplified ([#523](pypa/pip-audit#523))

### Fixed

* Fixed a potential crash on invalid unicode in subprocess streams
  ([#536](pypa/pip-audit#536))

## [2.4.15]

**YANKED**

### Fixed

* Fixed an issue where hash checking would fail when using third-party indices
  ([#462](pypa/pip-audit#462))

* Fixed the behavior of the `--skip-editable` flag, which had regressed
  with an internal API change
  ([#499](pypa/pip-audit#499))

* Fixed a dependency resolution bug that can potentially be triggered when
  multiple packages have the same subdependency
  ([#488](pypa/pip-audit#488))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hash checking: respect third party indices
2 participants