Skip to content

Commit 65ed3ec

Browse files
Merge pull request #2947 from VWS-Python/adamtheturtle/remove-virtual-env-dockerfile
Remove redundant VIRTUAL_ENV variable from Dockerfile
2 parents aba2728 + 94ff092 commit 65ed3ec

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/mock_vws/_flask_server/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ COPY --chown=myuser:myuser . /app
1111

1212
# See https://pythonspeed.com/articles/activate-virtualenv-dockerfile/
1313
# For why we use this method of activating the virtual environment.
14-
ENV VIRTUAL_ENV=/app/docker_venvs/.venv
1514
ENV UV_PROJECT_ENVIRONMENT=/app/docker_venvs/.venv
16-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
15+
ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH"
1716

1817
WORKDIR /app
19-
RUN python3 -m venv $VIRTUAL_ENV && \
18+
RUN python3 -m venv $UV_PROJECT_ENVIRONMENT && \
2019
pip install --no-cache-dir uv==0.10.4 && \
2120
uv sync --no-cache
2221
EXPOSE 5000

tests/mock_vws/test_query.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import datetime
1010
import io
1111
import json
12+
import re
1213
import textwrap
1314
import time
1415
import uuid
@@ -72,6 +73,8 @@
7273
""",
7374
)
7475

76+
_JETTY_VERSION_RE = re.compile(pattern=r"Powered by Jetty:// [\d.]+")
77+
7578
_NGINX_REQUEST_ENTITY_TOO_LARGE_ERROR = textwrap.dedent(
7679
text="""\
7780
<html>\r
@@ -252,7 +255,11 @@ def test_incorrect_no_boundary(
252255
if resp_status_code != HTTPStatus.INTERNAL_SERVER_ERROR:
253256
handle_server_errors(response=vws_response)
254257

255-
assert requests_response.text == resp_text
258+
repl = "Powered by Jetty://"
259+
sub = _JETTY_VERSION_RE.sub
260+
actual = sub(repl=repl, string=requests_response.text)
261+
expected = sub(repl=repl, string=resp_text)
262+
assert actual == expected
256263
assert_vwq_failure(
257264
response=vws_response,
258265
status_code=resp_status_code,

0 commit comments

Comments
 (0)