network: add DetachedSignatureAvailableCheck#771
network: add DetachedSignatureAvailableCheck#771parona-source wants to merge 3 commits intopkgcore:masterfrom
Conversation
8697f61 to
694a268
Compare
thesamesam
left a comment
There was a problem hiding this comment.
Thanks a lot for this. It works well for me as well.
arthurzam
left a comment
There was a problem hiding this comment.
Some small changes I want, but looks really good.
I even want to run it global wise to know if it finds something
src/pkgcheck/checks/network.py
Outdated
| for url in f.uri: | ||
| for extension in self.detached_signature_extensions: | ||
| yield (f.filename, f"{url}{extension}") | ||
| return [] |
There was a problem hiding this comment.
| return [] |
no need for this return
There was a problem hiding this comment.
This is also done this way in PyPIAttestationAvailableCheck. Should that be changed as well?
I mostly copied that check.
There was a problem hiding this comment.
Applied suggestion. Didn't touch PyPIAttestationAvailableCheck
Edit: Touched it by minimising it as well.
src/pkgcheck/checks/network.py
Outdated
| result = future.result() | ||
| if result is not None: |
There was a problem hiding this comment.
| result = future.result() | |
| if result is not None: | |
| if (result := future.result()): |
There was a problem hiding this comment.
_UrlCheck and PypiAttestationAvailableCheck do this as well. Should I touch these?
There was a problem hiding this comment.
Realised I could minimise duplicated code by using _UrlCheck. Didn't touch them but I removed this from the new check.
PypiAttestationAvailableCheck looks like it could get minimised as well.
Edit: Touched them.
694a268 to
4269370
Compare
Signed-off-by: Alfred Wingate <parona@protonmail.com>
4269370 to
9f22eac
Compare
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Signed-off-by: Alfred Wingate <parona@protonmail.com>
4ca63cf to
b8f8b4b
Compare
@thesamesam was interested in this
I couldn't fully follow precedent with the network tests. The check deals with multiple network requests in one go so just a mocking of the returnvalue wasn't enough.