Skip to content

Commit 1251af4

Browse files
authored
🎨🐛Maintenance: fix CI build image issue (#4434)
1 parent c51bb02 commit 1251af4

File tree

16 files changed

+49
-14
lines changed

16 files changed

+49
-14
lines changed

.ruff.toml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,27 @@ ignore = [
4545
"S101", # use of `assert` detected hanbled by pylance, does not support noseq
4646
"TID252", # [*] Relative imports from parent modules are banned
4747
]
48-
extend-exclude = ["**/tests", "**/generated_models", "**/director/"]
48+
49+
target-version = "py310"
50+
51+
52+
[per-file-ignores]
53+
"**/tests/**" = [
54+
"T201", # print found
55+
"ARG001", # unused function argument
56+
"PT019", # user pytest.mark.usefixture
57+
"PLR2004", # use of magic values
58+
"PLR0913", # too many arguments
59+
"N806", # Uppercase variables in functions
60+
"PT001", # use pytest.fixture over pytest.fixture() whatsoever
61+
"ERA001", # found commented out code
62+
]
63+
64+
[flake8-pytest-style]
65+
fixture-parentheses = false
66+
parametrize-names-type = "csv"
67+
68+
69+
70+
[pylint]
71+
max-args = 10

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ ruff: ## python ruffing
514514
@ruff --version
515515
# Running ruff in packages and services (except director)
516516
@ruff check \
517+
--config=$(CURDIR)/.ruff.toml \
518+
--respect-gitignore \
519+
--extend-exclude="**/tests" \
520+
--extend-exclude="**/generated_models" \
521+
--extend-exclude="**/director/" \
517522
$(CURDIR)/services \
518523
$(CURDIR)/packages
519524

scripts/common.Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ pyupgrade: ## upgrades python syntax for newer versions of the language (SEE htt
129129
pylint: $(REPO_BASE_DIR)/.pylintrc ## runs pylint (python linter) on src and tests folders
130130
@pylint --rcfile="$(REPO_BASE_DIR)/.pylintrc" -v $(CURDIR)/src $(CURDIR)/tests
131131

132+
.PHONY: ruff
133+
ruff: $(REPO_BASE_DIR)/.ruff.toml ## runs ruff (python fast linter) on src and tests folders
134+
@ruff check \
135+
--config=$(REPO_BASE_DIR)/.ruff.toml \
136+
--respect-gitignore \
137+
$(CURDIR)/src \
138+
$(CURDIR)/tests
132139

133140
.PHONY: mypy
134141
mypy: $(REPO_BASE_DIR)/scripts/mypy.bash $(REPO_BASE_DIR)/mypy.ini ## runs mypy python static type-checker on this services's code. Use AFTER make install-*

services/agent/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ WORKDIR /build/services/agent
110110
RUN \
111111
--mount=type=bind,source=packages,target=/build/packages,rw \
112112
--mount=type=bind,source=services/agent,target=/build/services/agent,rw \
113-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
113+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
114114
pip install \
115115
--requirement requirements/prod.txt \
116116
&& pip list -v

services/api-server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ WORKDIR /build/services/api-server
106106
RUN \
107107
--mount=type=bind,source=packages,target=/build/packages,rw \
108108
--mount=type=bind,source=services/api-server,target=/build/services/api-server,rw \
109-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
109+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
110110
pip install \
111111
--requirement requirements/prod.txt \
112112
&& pip list -v

services/autoscaling/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ WORKDIR /build/services/autoscaling
124124
RUN \
125125
--mount=type=bind,source=packages,target=/build/packages,rw \
126126
--mount=type=bind,source=services/autoscaling,target=/build/services/autoscaling,rw \
127-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
127+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
128128
pip install \
129129
--requirement requirements/prod.txt \
130130
&& pip list -v

services/catalog/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ WORKDIR /build/services/catalog
106106
RUN \
107107
--mount=type=bind,source=packages,target=/build/packages,rw \
108108
--mount=type=bind,source=services/catalog,target=/build/services/catalog,rw \
109-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
109+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
110110
pip install \
111111
--requirement requirements/prod.txt \
112112
&& pip list -v

services/dask-sidecar/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ WORKDIR /build/services/dask-sidecar
110110
RUN \
111111
--mount=type=bind,source=packages,target=/build/packages,rw \
112112
--mount=type=bind,source=services/dask-sidecar,target=/build/services/dask-sidecar,rw \
113-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
113+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
114114
pip install \
115115
--requirement requirements/prod.txt \
116116
&& pip list -v

services/datcore-adapter/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ WORKDIR /build/services/datcore-adapter
107107
RUN \
108108
--mount=type=bind,source=packages,target=/build/packages,rw \
109109
--mount=type=bind,source=services/datcore-adapter,target=/build/services/datcore-adapter,rw \
110-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
110+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
111111
pip install \
112112
--requirement requirements/prod.txt \
113113
&& pip list -v

services/director-v2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ WORKDIR /build/services/director-v2
107107
RUN \
108108
--mount=type=bind,source=packages,target=/build/packages,rw \
109109
--mount=type=bind,source=services/director-v2,target=/build/services/director-v2,rw \
110-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
110+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
111111
pip install \
112112
--requirement requirements/prod.txt \
113113
&& pip list -v

services/dynamic-sidecar/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ WORKDIR /build/services/dynamic-sidecar
122122
RUN \
123123
--mount=type=bind,source=packages,target=/build/packages,rw \
124124
--mount=type=bind,source=services/dynamic-sidecar,target=/build/services/dynamic-sidecar,rw \
125-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
125+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
126126
pip install \
127127
--requirement requirements/prod.txt \
128128
&& pip list -v

services/invitations/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ WORKDIR /build/services/invitations
107107
RUN \
108108
--mount=type=bind,source=packages,target=/build/packages,rw \
109109
--mount=type=bind,source=services/invitations,target=/build/services/invitations,rw \
110-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
110+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
111111
pip install \
112112
--requirement requirements/prod.txt \
113113
&& pip list -v

services/migration/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ WORKDIR /build/packages/postgres-database
5858
# install only base 3rd party dependencies
5959
RUN \
6060
--mount=type=bind,source=packages/postgres-database,target=/build/packages/postgres-database,rw \
61-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
61+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
6262
pip install \
6363
--requirement requirements/prod.txt \
6464
&& pip list -v

services/resource-usage-tracker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ WORKDIR /build/services/resource-usage-tracker
107107
RUN \
108108
--mount=type=bind,source=packages,target=/build/packages,rw \
109109
--mount=type=bind,source=services/resource-usage-tracker,target=/build/services/resource-usage-tracker,rw \
110-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
110+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
111111
pip install \
112112
--requirement requirements/prod.txt \
113113
&& pip list -v

services/storage/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ WORKDIR /build/services/storage
119119
RUN \
120120
--mount=type=bind,source=packages,target=/build/packages,rw \
121121
--mount=type=bind,source=services/storage,target=/build/services/storage,rw \
122-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
122+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
123123
pip install \
124124
--requirement requirements/prod.txt \
125125
&& pip list -v

services/web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ WORKDIR /build/services/web/server
117117
RUN \
118118
--mount=type=bind,source=packages,target=/build/packages,rw \
119119
--mount=type=bind,source=services/web/server,target=/build/services/web/server,rw \
120-
--mount=type=cache,mode=0755,target=/root/.cache/pip \
120+
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
121121
pip install \
122122
--requirement requirements/prod.txt \
123123
&& pip list -v

0 commit comments

Comments
 (0)