From 7de6e474fcabcdeff3e263b01b6b9f127edae64b Mon Sep 17 00:00:00 2001 From: Brian C S Kempa Date: Sun, 17 Dec 2023 21:01:54 -0800 Subject: [PATCH] Pin python libraries Use pinned `requirements.txt` and an additional `constraints.txt` file to ensure pip constructs a viable build environment. The upstream version (see [1]) partially depends on the distribution repositories for versioning via packages like `python3-doc8` but I went though and pinned everything in the `pip` files instead to create a single source of truth independent of system packages. Based on [1] by @clalancette upstream in `ros2/ros2_documentation` [1] https://github.com/ros2/ros2_documentation/pull/2725/commits/e43347d0413bef6801339894a8e63b2bd56e4c3a --- .github/workflows/spaceros.yml | 4 ++-- constraints.txt | 33 +++++++++++++++++++++++++++++++++ docker/image/Dockerfile | 2 +- requirements.txt | 18 +++++++++--------- 4 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 constraints.txt diff --git a/.github/workflows/spaceros.yml b/.github/workflows/spaceros.yml index 2b0902e..63b429c 100644 --- a/.github/workflows/spaceros.yml +++ b/.github/workflows/spaceros.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies with pip run: | - pip install --no-warn-script-location --user --upgrade -r requirements.txt + pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt - name: Build run: make html @@ -44,7 +44,7 @@ jobs: - name: Install dependencies with pip run: | - pip install --no-warn-script-location --user --upgrade -r requirements.txt + pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt - name: Build run: make multiversion diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 0000000..b597d60 --- /dev/null +++ b/constraints.txt @@ -0,0 +1,33 @@ +Jinja2==3.0.3 +MarkupSafe==2.0.1 +Pygments==2.11.2 +alabaster==0.7.12 +babel==2.8.0 +certifi==2020.6.20 +chardet==4.0.0 +imagesize==1.3.0 +importlib-metadata==4.6.4 +more-itertools==8.10.0 +packaging==21.3 +pbr==5.8.0 +pip==22.0.2 +pyparsing==2.4.7 +pytz==2022.1 +requests==2.25.1 +restructuredtext-lint==1.3.2 +roman==3.3 +setuptools==59.6.0 +six==1.16.0 +snowballstemmer==2.2.0 +doc8==0.8.1 +docutils==0.16.0 +Sphinx==4.3.2 +sphinx-copybutton==0.4.0 +sphinx-multiversion==0.2.4 +sphinx-rtd-theme==1.0.0 +sphinx-sitemap==2.3.0 +sphinx-tabs==3.2.0 +stevedore==3.5.0 +urllib3==1.26.5 +wheel==0.37.1 +zipp==1.0.0 diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 62462e8..430cdf7 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -25,4 +25,4 @@ WORKDIR /tmp/doc_repository USER $user -CMD pip3 install --no-warn-script-location --user --upgrade -r requirements.txt && make multiversion +CMD pip3 install --no-warn-script-location --user -r requirements.txt -c constraints.txt && make multiversion diff --git a/requirements.txt b/requirements.txt index 4d95bd1..5d8ce4e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -doc8 -docutils==0.16 -pip -sphinx -sphinx-copybutton -sphinx-multiversion -sphinx-rtd-theme -sphinx-sitemap -sphinx-tabs +doc8==0.8.1 +docutils==0.16.0 +pip==22.0.2 +sphinx==4.3.2 +sphinx-copybutton==0.4.0 +sphinx-multiversion==0.2.4 +sphinx-rtd-theme==1.0.0 +sphinx-sitemap==2.3.0 +sphinx-tabs==3.2.0