Fix search issues for progress_func, add zstd for GH cache

This commit is contained in:
Mikhail f. Shiryaev 2024-06-13 14:25:02 +02:00
parent b37e443b3b
commit f1707998d2
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
2 changed files with 7 additions and 6 deletions

View File

@ -10,14 +10,15 @@ RUN sed -i "s|http://archive.ubuntu.com|$apt_archive|g" /etc/apt/sources.list
RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install --yes \
aspell \
curl \
git \
gh \
file \
gh \
git \
libxml2-utils \
locales \
moreutils \
python3-pip \
yamllint \
locales \
zstd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf /tmp/*

View File

@ -112,12 +112,12 @@ class GitHub(github.Github):
# pylint: enable=signature-differs
def get_pulls_from_search(self, *args: Any, **kwargs: Any) -> PullRequests:
"""The search api returns actually issues, so we need to fetch PullRequests"""
issues = self.search_issues(*args, **kwargs)
repos = {}
prs = [] # type: PullRequests
progress_func = kwargs.pop(
"progress_func", lambda x: x
) # type: Callable[[Issues], Issues]
issues = self.search_issues(*args, **kwargs)
repos = {}
prs = [] # type: PullRequests
for issue in progress_func(issues):
# See https://github.com/PyGithub/PyGithub/issues/2202,
# obj._rawData doesn't spend additional API requests