vomebook commited on
Commit ·
e34e2fe
1
Parent(s): 79c1d14
Organize Space quality dependency files
Browse files
Dockerfile
CHANGED
|
@@ -18,8 +18,9 @@ RUN npm run check:static
|
|
| 18 |
FROM python:3.11.17-slim AS source-check-python
|
| 19 |
|
| 20 |
WORKDIR /check
|
| 21 |
-
COPY requirements
|
| 22 |
-
|
|
|
|
| 23 |
COPY app.py ./
|
| 24 |
COPY backend/ backend/
|
| 25 |
COPY typings/ typings/
|
|
@@ -44,7 +45,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends python3 \
|
|
| 44 |
COPY --from=source-check-node /check/ /check/
|
| 45 |
COPY --from=source-check-python /usr/local/lib/python3.11/site-packages/ /tmp/python-static-tools/
|
| 46 |
COPY --from=source-check-python /usr/local/bin/ruff /tmp/python-static-tools/bin/ruff
|
| 47 |
-
COPY
|
|
|
|
| 48 |
ENV PYTHONPATH=/tmp/python-static-tools
|
| 49 |
RUN npx --no-install pyright --project pyrightconfig.json \
|
| 50 |
&& npx --no-install pyright --project pyrightconfig.strict.json \
|
|
|
|
| 18 |
FROM python:3.11.17-slim AS source-check-python
|
| 19 |
|
| 20 |
WORKDIR /check
|
| 21 |
+
COPY requirements.txt ruff.toml ./
|
| 22 |
+
COPY config/dependencies/static-check.txt config/dependencies/static-check.txt
|
| 23 |
+
RUN pip install --no-cache-dir -r config/dependencies/static-check.txt
|
| 24 |
COPY app.py ./
|
| 25 |
COPY backend/ backend/
|
| 26 |
COPY typings/ typings/
|
|
|
|
| 45 |
COPY --from=source-check-node /check/ /check/
|
| 46 |
COPY --from=source-check-python /usr/local/lib/python3.11/site-packages/ /tmp/python-static-tools/
|
| 47 |
COPY --from=source-check-python /usr/local/bin/ruff /tmp/python-static-tools/bin/ruff
|
| 48 |
+
COPY ruff.toml ./
|
| 49 |
+
COPY config/dependencies/static-check.txt config/dependencies/static-check.txt
|
| 50 |
ENV PYTHONPATH=/tmp/python-static-tools
|
| 51 |
RUN npx --no-install pyright --project pyrightconfig.json \
|
| 52 |
&& npx --no-install pyright --project pyrightconfig.strict.json \
|
requirements-audit.txt → config/dependencies/audit.txt
RENAMED
|
File without changes
|
requirements-static-check.txt → config/dependencies/static-check.txt
RENAMED
|
File without changes
|
tests/gates/test_static_contract.py
CHANGED
|
@@ -455,6 +455,11 @@ class StaticFrontendContractTests(unittest.TestCase):
|
|
| 455 |
self.assertIn("pyrightconfig.json pyrightconfig.strict.json", node_stage)
|
| 456 |
self.assertIn("pip install --no-cache-dir -r requirements.txt", dockerfile)
|
| 457 |
self.assertIn("FROM python:3.11.17-slim AS source-check-python", dockerfile)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 458 |
self.assertIn("RUN python -B scripts/check_python_static.py", dockerfile)
|
| 459 |
self.assertIn("FROM node:26.11.1-bookworm-slim AS static-gate-test", dockerfile)
|
| 460 |
self.assertIn("COPY scripts/ scripts/", node_stage)
|
|
@@ -531,6 +536,9 @@ class StaticFrontendContractTests(unittest.TestCase):
|
|
| 531 |
runtime = re.split(r'^FROM ', dockerfile, flags=re.M)[-1]
|
| 532 |
self.assertTrue(runtime.startswith("python:3.11.17-slim\n"))
|
| 533 |
self.assertNotIn("COPY quality/", runtime)
|
|
|
|
|
|
|
|
|
|
| 534 |
self.assertIn("COPY --from=search-index-build /native/ /app/", runtime)
|
| 535 |
self.assertIn("COPY --from=search-index-verified /verified-git/ /app/data/", runtime)
|
| 536 |
self.assertIn("COPY --from=search-generation /selected/ /selected/", dockerfile)
|
|
|
|
| 455 |
self.assertIn("pyrightconfig.json pyrightconfig.strict.json", node_stage)
|
| 456 |
self.assertIn("pip install --no-cache-dir -r requirements.txt", dockerfile)
|
| 457 |
self.assertIn("FROM python:3.11.17-slim AS source-check-python", dockerfile)
|
| 458 |
+
python_stage = dockerfile.split("FROM python:3.11.17-slim AS source-check-python", 1)[1].split("\nFROM ", 1)[0]
|
| 459 |
+
pinned = (ROOT / "config/dependencies/static-check.txt").read_text().splitlines()
|
| 460 |
+
self.assertEqual(pinned, ["ruff==0.17.3", "coverage==7.17.0", "mutmut==3.8.1"])
|
| 461 |
+
self.assertIn("COPY config/dependencies/static-check.txt config/dependencies/static-check.txt", python_stage)
|
| 462 |
+
self.assertIn("RUN pip install --no-cache-dir -r config/dependencies/static-check.txt", python_stage)
|
| 463 |
self.assertIn("RUN python -B scripts/check_python_static.py", dockerfile)
|
| 464 |
self.assertIn("FROM node:26.11.1-bookworm-slim AS static-gate-test", dockerfile)
|
| 465 |
self.assertIn("COPY scripts/ scripts/", node_stage)
|
|
|
|
| 536 |
runtime = re.split(r'^FROM ', dockerfile, flags=re.M)[-1]
|
| 537 |
self.assertTrue(runtime.startswith("python:3.11.17-slim\n"))
|
| 538 |
self.assertNotIn("COPY quality/", runtime)
|
| 539 |
+
self.assertNotIn("config/dependencies/static-check.txt", runtime)
|
| 540 |
+
self.assertIn("COPY requirements.txt .", runtime)
|
| 541 |
+
self.assertEqual((ROOT / "config/dependencies/audit.txt").read_text().splitlines(), ["pip-audit==2.10.1"])
|
| 542 |
self.assertIn("COPY --from=search-index-build /native/ /app/", runtime)
|
| 543 |
self.assertIn("COPY --from=search-index-verified /verified-git/ /app/data/", runtime)
|
| 544 |
self.assertIn("COPY --from=search-generation /selected/ /selected/", dockerfile)
|