From f95401d82ca82e124715e53b89eced64f9ba6a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9cile=20Vuilleumier?= Date: Wed, 10 Apr 2024 13:21:17 +0200 Subject: [PATCH] Upgrade to Python 3.11 --- Dockerfile | 2 +- README.md | 4 ++-- tests/integration_test.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a2aab6..066fa5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7-2020-12-19 +FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11 COPY ./bridge-style /tmp/bridge-style COPY requirements.txt /tmp/ diff --git a/README.md b/README.md index 7213be5..0ca14c2 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ docker run --rm -d --name lyrx2sld -p 80:80 camptocamp/lyrx2sld:latest ### Usage lyrx data should be sent as a file to http://localhost/v1/lyrx2sld/ through a POST request. The converted SLD styling is sent back in the response content (content type: application/x-zip-compressed). Example using `curl`: ``` -curl --location -d @/path/to/input.lyrx http://localhost/v1/lyrx2sld/ -o /path/to/output.zip +curl --location -d @/path/to/input.lyrx -H 'Content-Type: application/json' -o /path/to/output.zip "http://localhost/v1/lyrx2sld/" ``` Optional request parameter: `replaceesri` to replace ESRI font markers with standard symbols, to be set to `true` or `false` (default): ``` -curl --location -d @/path/to/input.lyrx "http://localhost/v1/lyrx2sld/?replaceesri=true" -o /path/to/output.zip +curl --location -d @/path/to/input.lyrx -H 'Content-Type: application/json' -o /path/to/output.zip "http://localhost/v1/lyrx2sld/?replaceesri=true" ``` Warnings and errors from bridge-style are written to the logs - to view them: ``` diff --git a/tests/integration_test.sh b/tests/integration_test.sh index 4360997..1d871fa 100755 --- a/tests/integration_test.sh +++ b/tests/integration_test.sh @@ -4,7 +4,7 @@ SERVICE="http://localhost/v1/lyrx2sld/" INPUT_FILE="tests/data/withicons.lyrx" OUTPUT_FILE="/tmp/output.zip" -STATUS_CODE=$(curl --write-out %{http_code} -v -d @$INPUT_FILE -o $OUTPUT_FILE $SERVICE) +STATUS_CODE=$(curl --write-out %{http_code} -v -d @$INPUT_FILE -H 'Content-Type: application/json' -o $OUTPUT_FILE $SERVICE) if [ -f "$OUTPUT_FILE" ] && [ $STATUS_CODE = 200 ]; then echo "Output file has been created and request status code is 200"