[v2 1/2] pytest: Update requirements to match sphinx versions

In order to better make use of pip caches, and also for better overall consistency, we should use the same versions of packages in each of our python requirements files. Update pytest to use the newer versions of packages we use in sphinx builds.
Signed-off-by: Tom Rini trini@konsulko.com --- Changes in v2: - Don't forget to send this patch, this time. --- test/py/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/py/requirements.txt b/test/py/requirements.txt index e241780f9238..86d6266053fd 100644 --- a/test/py/requirements.txt +++ b/test/py/requirements.txt @@ -8,21 +8,21 @@ fixtures==3.0.0 importlib-metadata==0.23 linecache2==1.0.0 more-itertools==7.2.0 -packaging==19.2 +packaging==21.3 pbr==5.4.3 pluggy==0.13.0 py==1.10.0 pycryptodomex==3.9.8 pyelftools==0.27 pygit2==1.9.2 -pyparsing==2.4.2 +pyparsing==3.0.7 pytest==6.2.5 pytest-xdist==2.5.0 python-mimeparse==1.6.0 python-subunit==1.3.0 -requests==2.25.1 +requests==2.27.1 setuptools==58.3.0 -six==1.12.0 +six==1.16.0 testtools==2.3.0 traceback2==1.4.0 unittest2==1.1.0

Given the number of jobs in CI we have which use python and pip install packages, we should do this once in the Dockerfile, in order to populate the cache. We let each job continue to create and use the virtual environments they need to facilitate making updates to these environments easier.
Signed-off-by: Tom Rini trini@konsulko.com --- Changes in v2: - Comment on why we wget - Drop commented out portion --- tools/docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index bd02531be249..20c2b2a9d64c 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -265,6 +265,17 @@ RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot RUN useradd -m -U uboot USER uboot:uboot
+# Populate the cache for pip to use. Get these via wget as the +# COPY / ADD directives don't work as we need them to. +RUN wget -O /tmp/pytest-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/test/py/requirements.txt +RUN wget -O /tmp/sphinx-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/doc/sphinx/requirements.tx... +RUN virtualenv -p /usr/bin/python3 /tmp/venv && \ + . /tmp/venv/bin/activate && \ + pip install -r /tmp/pytest-requirements.txt \ + -r /tmp/sphinx-requirements.txt && \ + deactivate && \ + rm -rf /tmp/venv /tmp/pytest-requirements.txt /tmp/sphinx-requirements.txt + # Create the buildman config file RUN /bin/echo -e "[toolchain]\nroot = /usr" > ~/.buildman RUN /bin/echo -e "kernelorg = /opt/gcc-12.2.0-nolibc/*" >> ~/.buildman

On Fri, 24 Mar 2023 at 07:58, Tom Rini trini@konsulko.com wrote:
Given the number of jobs in CI we have which use python and pip install packages, we should do this once in the Dockerfile, in order to populate the cache. We let each job continue to create and use the virtual environments they need to facilitate making updates to these environments easier.
Signed-off-by: Tom Rini trini@konsulko.com
Changes in v2:
- Comment on why we wget
- Drop commented out portion
tools/docker/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

On Thu, Mar 23, 2023 at 02:57:58PM -0400, Tom Rini wrote:
Given the number of jobs in CI we have which use python and pip install packages, we should do this once in the Dockerfile, in order to populate the cache. We let each job continue to create and use the virtual environments they need to facilitate making updates to these environments easier.
Signed-off-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org
With a locally done and then undone kludge to work around that this requires the first patch to be applied and pushed already, applied to u-boot/master, thanks!

On Fri, 24 Mar 2023 at 07:58, Tom Rini trini@konsulko.com wrote:
In order to better make use of pip caches, and also for better overall consistency, we should use the same versions of packages in each of our python requirements files. Update pytest to use the newer versions of packages we use in sphinx builds.
Signed-off-by: Tom Rini trini@konsulko.com
Changes in v2:
- Don't forget to send this patch, this time.
test/py/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Thu, Mar 23, 2023 at 02:57:57PM -0400, Tom Rini wrote:
In order to better make use of pip caches, and also for better overall consistency, we should use the same versions of packages in each of our python requirements files. Update pytest to use the newer versions of packages we use in sphinx builds.
Signed-off-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (2)
-
Simon Glass
-
Tom Rini