Skip to content

Commit f479301

Browse files
authored
ci: Support using git for dependencies in test-installation (#222)
Fix the CI test that fails when dependencies in pyproject.toml contain git urls. I didn't have time to update the tests, feel free to take over.
2 parents a09a130 + a30ce51 commit f479301

File tree

8 files changed

+67
-8
lines changed
  • .github/containers/test-installation
  • cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation
  • tests_golden/integration/test_cookiecutter_generation
    • actor/frequenz-actor-test/.github/containers/test-installation
    • api/frequenz-api-test/.github/containers/test-installation
    • app/frequenz-app-test/.github/containers/test-installation
    • lib/frequenz-test-python/.github/containers/test-installation
    • model/frequenz-model-test/.github/containers/test-installation

8 files changed

+67
-8
lines changed

.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
FROM --platform=${TARGETPLATFORM} python:3.11-slim
88

9-
RUN python -m pip install --upgrade --no-cache-dir pip
9+
RUN apt-get update -y && \
10+
apt-get install --no-install-recommends -y \
11+
git && \
12+
apt-get clean && \
13+
rm -rf /var/lib/apt/lists/* && \
14+
python -m pip install --upgrade --no-cache-dir pip
1015

1116
COPY dist dist
1217
RUN pip install dist/*.whl && \

RELEASE_NOTES.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ To upgrade without regenerating the project, you can follow these steps:
5858
5959
```sh
6060
awk -i inplace '/^sed s..frequenz-api-common/ { print; print "sed '"'"'s|https://frequenz-floss.github.io/frequenz-api-common/v[0-9].[0-9]/objects.inv|https://frequenz-floss.github.io/frequenz-api-common/v'"'"'${ver_minor}'"'"'/objects.inv|'"'"' -i mkdocs.yml"; next }1' CONTRIBUTING.md
61+
62+
- Run the following command to fix the `test-installation` CI job when using git URLs in `pyproject.toml`:
63+
64+
```sh
65+
patch -p1 <<'EOF'
66+
diff --git a/.github/containers/test-installation/Dockerfile b/.github/containers/test-installation/Dockerfile
67+
index 772b2ae..2494545 100644
68+
--- a/.github/containers/test-installation/Dockerfile
69+
+++ b/.github/containers/test-installation/Dockerfile
70+
@@ -6,7 +6,12 @@
71+
72+
FROM --platform=${TARGETPLATFORM} python:3.11-slim
73+
74+
-RUN python -m pip install --upgrade --no-cache-dir pip
75+
+RUN apt-get update -y && \
76+
+ apt-get install --no-install-recommends -y \
77+
+ git && \
78+
+ apt-get clean && \
79+
+ rm -rf /var/lib/apt/lists/* && \
80+
+ python -m pip install --upgrade --no-cache-dir pip
81+
82+
COPY dist dist
83+
RUN pip install dist/*.whl && \
84+
EOF
6185
```
6286
6387
## New Features
@@ -77,4 +101,4 @@ To upgrade without regenerating the project, you can follow these steps:
77101
78102
### Cookiecutter template
79103
80-
<!-- Here bug fixes for cookiecutter specifically -->
104+
- Fix the `test-installation` CI job when dependencies in `pyproject.toml` contain git URLs.

cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77

88
FROM --platform=${TARGETPLATFORM} python:3.11-slim
99

10-
RUN python -m pip install --upgrade --no-cache-dir pip
10+
RUN apt-get update -y && \
11+
apt-get install --no-install-recommends -y \
12+
git && \
13+
apt-get clean && \
14+
rm -rf /var/lib/apt/lists/* && \
15+
python -m pip install --upgrade --no-cache-dir pip
1116

1217
COPY dist dist
1318
RUN pip install dist/*.whl && \

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
FROM --platform=${TARGETPLATFORM} python:3.11-slim
77

8-
RUN python -m pip install --upgrade --no-cache-dir pip
8+
RUN apt-get update -y && \
9+
apt-get install --no-install-recommends -y \
10+
git && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/* && \
13+
python -m pip install --upgrade --no-cache-dir pip
914

1015
COPY dist dist
1116
RUN pip install dist/*.whl && \

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
FROM --platform=${TARGETPLATFORM} python:3.11-slim
77

8-
RUN python -m pip install --upgrade --no-cache-dir pip
8+
RUN apt-get update -y && \
9+
apt-get install --no-install-recommends -y \
10+
git && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/* && \
13+
python -m pip install --upgrade --no-cache-dir pip
914

1015
COPY dist dist
1116
RUN pip install dist/*.whl && \

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
FROM --platform=${TARGETPLATFORM} python:3.11-slim
77

8-
RUN python -m pip install --upgrade --no-cache-dir pip
8+
RUN apt-get update -y && \
9+
apt-get install --no-install-recommends -y \
10+
git && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/* && \
13+
python -m pip install --upgrade --no-cache-dir pip
914

1015
COPY dist dist
1116
RUN pip install dist/*.whl && \

tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
FROM --platform=${TARGETPLATFORM} python:3.11-slim
77

8-
RUN python -m pip install --upgrade --no-cache-dir pip
8+
RUN apt-get update -y && \
9+
apt-get install --no-install-recommends -y \
10+
git && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/* && \
13+
python -m pip install --upgrade --no-cache-dir pip
914

1015
COPY dist dist
1116
RUN pip install dist/*.whl && \

tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/containers/test-installation/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
FROM --platform=${TARGETPLATFORM} python:3.11-slim
77

8-
RUN python -m pip install --upgrade --no-cache-dir pip
8+
RUN apt-get update -y && \
9+
apt-get install --no-install-recommends -y \
10+
git && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/* && \
13+
python -m pip install --upgrade --no-cache-dir pip
914

1015
COPY dist dist
1116
RUN pip install dist/*.whl && \

0 commit comments

Comments
 (0)