From f57e7de1556c19011eff726795063cf6fd48011f Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Thu, 20 Apr 2023 09:34:03 -0400 Subject: [PATCH 1/3] Pin markdownlint-cli version Avoid unplanned changes in linting requirements that can make it harder to get unrelated patches merged. Relates-to: #884 Signed-off-by: Daniel Farrell --- package/Dockerfile.shipyard-linting | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/Dockerfile.shipyard-linting b/package/Dockerfile.shipyard-linting index 57ca83816..e291f8df1 100644 --- a/package/Dockerfile.shipyard-linting +++ b/package/Dockerfile.shipyard-linting @@ -23,9 +23,11 @@ ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} \ # yamllint | YAML linting # yq | YAML processing +ENV MARKDOWNLINT_VERSION=0.33.0 + RUN apk add --no-cache bash findutils git grep make nodejs py3-six shellcheck upx yamllint yq && \ apk add --no-cache --virtual installers npm py3-pip && \ - npm install -g markdownlint-cli && \ + npm install -g markdownlint-cli@${MARKDOWNLINT_VERSION} && \ pip install gitlint && \ find /usr/bin/ -type f -executable -newercc /proc -size +1M \( -execdir upx {} \; -o -true \) && \ find /usr/lib/ -name __pycache__ -type d -exec rm -rf {} + && \ From e039d738999cbbd389fcf02b7e9adad03476b2ea Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Thu, 27 Apr 2023 13:05:05 -0400 Subject: [PATCH 2/3] Pin gitlint version Avoid unplanned changes in linting requirements that can make it harder to get unrelated patches merged. I looked at removing the need for pip by installing gitlint from the OS, but it's not available in Alpine (it is in Fedora). Relates-to: #884 Signed-off-by: Daniel Farrell --- package/Dockerfile.shipyard-linting | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/Dockerfile.shipyard-linting b/package/Dockerfile.shipyard-linting index e291f8df1..b93ecca53 100644 --- a/package/Dockerfile.shipyard-linting +++ b/package/Dockerfile.shipyard-linting @@ -23,12 +23,13 @@ ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} \ # yamllint | YAML linting # yq | YAML processing -ENV MARKDOWNLINT_VERSION=0.33.0 +ENV MARKDOWNLINT_VERSION=0.33.0 \ + GITLINT_VERSION=0.19.1 RUN apk add --no-cache bash findutils git grep make nodejs py3-six shellcheck upx yamllint yq && \ apk add --no-cache --virtual installers npm py3-pip && \ npm install -g markdownlint-cli@${MARKDOWNLINT_VERSION} && \ - pip install gitlint && \ + pip install gitlint==${GITLINT_VERSION} && \ find /usr/bin/ -type f -executable -newercc /proc -size +1M \( -execdir upx {} \; -o -true \) && \ find /usr/lib/ -name __pycache__ -type d -exec rm -rf {} + && \ apk del installers From e779ab670614439873c4491a4a3aca19b3b4d298 Mon Sep 17 00:00:00 2001 From: Mike Kolesnik Date: Mon, 11 Dec 2023 11:14:37 +0200 Subject: [PATCH 3/3] Fix linting image build failure due to PEP 668 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pip had a check enabled that fails the install due to packages being managed by the OS. The added flag ignores this check. Otherwise, the build fails with: ``` 11.85 × This environment is externally managed 11.85 ╰─> 11.85 The system-wide python installation should be maintained using the 11.85 system package manager (apk) only. ... 11.85 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. 11.85 hint: See PEP 668 for the detailed specification. ``` Signed-off-by: Mike Kolesnik --- package/Dockerfile.shipyard-linting | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/Dockerfile.shipyard-linting b/package/Dockerfile.shipyard-linting index b93ecca53..7d995b809 100644 --- a/package/Dockerfile.shipyard-linting +++ b/package/Dockerfile.shipyard-linting @@ -29,7 +29,7 @@ ENV MARKDOWNLINT_VERSION=0.33.0 \ RUN apk add --no-cache bash findutils git grep make nodejs py3-six shellcheck upx yamllint yq && \ apk add --no-cache --virtual installers npm py3-pip && \ npm install -g markdownlint-cli@${MARKDOWNLINT_VERSION} && \ - pip install gitlint==${GITLINT_VERSION} && \ + pip install --break-system-packages gitlint==${GITLINT_VERSION} && \ find /usr/bin/ -type f -executable -newercc /proc -size +1M \( -execdir upx {} \; -o -true \) && \ find /usr/lib/ -name __pycache__ -type d -exec rm -rf {} + && \ apk del installers