Skip to content

Commit 564234f

Browse files
committed
[tooling] Move dev tools to a specifc group
1 parent beb8c9a commit 564234f

File tree

7 files changed

+54
-29
lines changed

7 files changed

+54
-29
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: make image
3030
- name: Save monitoring image artifact
3131
run: |
32-
docker save interuss/monitoring -o monitoring-image.tar
32+
docker save interuss/monitoring interuss/monitoring-dev -o monitoring-image.tar
3333
mkdir -p image-artifact/monitoring
3434
mv monitoring-image.tar image-artifact/
3535
cp monitoring/image image-artifact/monitoring/

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ endif
1111

1212
.PHONY: format
1313
format: image
14-
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run ruff format
15-
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run ruff check --fix
16-
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run basedpyright
14+
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff format
15+
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff check --fix
16+
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run basedpyright
1717
cd monitoring && make format
1818
cd schemas && make format
1919

@@ -29,10 +29,10 @@ check-hygiene: image lint validate-uss-qualifier-docs
2929
.PHONY: python-lint
3030
python-lint: image
3131

32-
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run ruff format --check || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1)
33-
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run ruff check || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1)
32+
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff format --check || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1)
33+
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run ruff check || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1)
3434
shasum -b -a 256 .basedpyright/baseline.json > /tmp/baseline-before.hash
35-
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring uv run basedpyright || (echo "Typing check didn't succeed. Please fix issue and run make format to validate changes." && exit 1)
35+
docker run --rm -u ${USER_GROUP} -v "$(CURDIR):/app" -w /app interuss/monitoring-dev uv run basedpyright || (echo "Typing check didn't succeed. Please fix issue and run make format to validate changes." && exit 1)
3636
shasum -b -a 256 .basedpyright/baseline.json > /tmp/baseline-after.hash
3737
diff /tmp/baseline-before.hash /tmp/baseline-after.hash || (echo "Basedpyright baseline changed, probably dues to issues that have been cleanup. Use the following command to update baseline: make format" && exit 1)
3838

monitoring/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
#
1010
# This image is intended to be built from the repository root context/folder.
1111

12-
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
12+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS base
1313
# Not -alpine because: https://stackoverflow.com/a/58028091/651139
1414

1515
# Install system tools
1616
# openssl: Provides TLS tools
1717
# curl: Useful debugging utility
18-
# gcc: Required to build various packages
1918
# ca-certificates: Needed to accurately validate TLS connections
20-
RUN apt-get update --fix-missing && apt-get install -y make openssl curl libgeos-dev gcc g++ && apt-get install ca-certificates
19+
RUN apt-get update --fix-missing && apt-get install -y make openssl curl && apt-get install ca-certificates
2120

2221
# Required to build in an ARM environment
2322
# gevent: libffi-dev libssl-dev python3-dev build-essential
@@ -80,3 +79,12 @@ ENV GIT_COMMIT_HASH=$commit_hash
8079

8180
# No entry point maximizes flexibility in the use of this image
8281
ENTRYPOINT []
82+
83+
FROM base AS with-dev-dependencies
84+
85+
RUN --mount=type=cache,target=/root/.cache/uv \
86+
--mount=type=bind,source=./uv.lock,target=/app/uv.lock \
87+
--mount=type=bind,source=./pyproject.toml,target=/app/pyproject.toml \
88+
cd /app/ && \
89+
unset UV_FROZEN && \
90+
uv sync --locked --no-install-project --compile-bytecode --group dev

monitoring/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ docker image build \
1919
-t "${TAG}" \
2020
--build-arg version="$(scripts/git/version.sh monitoring --long)" \
2121
--build-arg commit_hash="$(git rev-parse HEAD)" \
22+
--target base \
23+
. \
24+
|| exit 1
25+
26+
docker image build \
27+
-f monitoring/Dockerfile \
28+
-t "${TAG}-dev" \
29+
--build-arg version="$(scripts/git/version.sh monitoring --long)" \
30+
--build-arg commit_hash="$(git rev-parse HEAD)" \
31+
--target with-dev-dependencies \
2232
. \
2333
|| exit 1
2434
echo "File created by monitoring/build.sh to keep track of the latest build run date time." > monitoring/image

monitoring/uss_qualifier/scripts/run_unit_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ docker run --name uss_qualifier_unit_test \
2424
-e MONITORING_GITHUB_ROOT=${MONITORING_GITHUB_ROOT:-} \
2525
-v "$(pwd):/app" \
2626
-v /var/run/docker.sock:/var/run/docker.sock \
27-
interuss/monitoring \
27+
interuss/monitoring-dev \
2828
uss_qualifier/scripts/in_container/run_unit_tests.sh

pyproject.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ requires-python = "==3.13.5"
77
dependencies = [
88
"aiohttp",
99
"arrow",
10-
"basedpyright>=1.31.1",
1110
"bc-jsonpath-ng",
1211
"cryptography",
1312
"deprecation",
@@ -38,11 +37,8 @@ dependencies = [
3837
"pykml",
3938
"pyopenssl",
4039
"pyproj",
41-
"pytest",
42-
"pytest-mock",
4340
"pyyaml",
4441
"requests",
45-
"ruff",
4642
"s2sphere",
4743
"scipy",
4844
"shapely",
@@ -53,6 +49,18 @@ dependencies = [
5349
"uuid6",
5450
]
5551

52+
[dependency-groups]
53+
dev = [
54+
"basedpyright>=1.31.1",
55+
"pytest",
56+
"pytest-mock",
57+
"ruff",
58+
"types-lxml>=2025.8.25",
59+
]
60+
61+
[tool.uv]
62+
default-groups = []
63+
5664
[tool.ruff]
5765
target-version = "py313"
5866

@@ -80,8 +88,3 @@ exclude = [
8088
"monitoring/mock_uss/output/*",
8189
"monitoring/uss_qualifier/output/*",
8290
]
83-
84-
[dependency-groups]
85-
dev = [
86-
"types-lxml>=2025.8.25",
87-
]

uv.lock

Lines changed: 13 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)