diff --git a/test-redis-cache-module/pyproject.toml b/test-redis-cache-module/pyproject.toml new file mode 100644 index 0000000..c71bdac --- /dev/null +++ b/test-redis-cache-module/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "test-redis-cache-module" +version = "0" +requires-python = ">=3.12" + +dependencies = [ + "ipdb>=0.13.13", + "locust>=2.32.7", + "matplotlib>=3.10.1", + "memory-profiler>=0.61.0", + "redis>=5.2.1", + "sentry-sdk", +] + +[tool.uv.sources] +sentry-sdk = { path = "../../sentry-python", editable = true } diff --git a/test-redis-cache-module/requirements.txt b/test-redis-cache-module/requirements.txt deleted file mode 100644 index 3cbf85b..0000000 --- a/test-redis-cache-module/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ - -redis # caching - -ipdb # debugging - -locust # load testing -memory_profiler # memory profiling -matplotlib # plotting the memory profile - --e ../../../code/sentry-python # sdk in a sibling folder to this projects folder diff --git a/test-redis-cache-module/run-locust.sh b/test-redis-cache-module/run-locust.sh index e0d5b14..312c922 100755 --- a/test-redis-cache-module/run-locust.sh +++ b/test-redis-cache-module/run-locust.sh @@ -1,10 +1,8 @@ #!/usr/bin/env bash +set -euo pipefail -# exit on first error -set -xe +if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh +fi -# create and activate virtual environment -python -m venv .venv -source .venv/bin/activate - -locust \ No newline at end of file +uv run locust diff --git a/test-redis-cache-module/run.sh b/test-redis-cache-module/run.sh index 7f9cc3c..2702ff8 100755 --- a/test-redis-cache-module/run.sh +++ b/test-redis-cache-module/run.sh @@ -1,19 +1,13 @@ #!/usr/bin/env bash +set -euo pipefail -# exit on first error -set -xe - -# create and activate virtual environment -python -m venv .venv -source .venv/bin/activate - -# Install (or update) requirements -python -m pip install -r requirements.txt +if ! command -v uv &> /dev/null; then + curl -LsSf https://astral.sh/uv/install.sh | sh +fi pkill redis-server || true sleep 1 rm -rf dump.rdb redis-server --daemonize yes -# Run program -python main.py \ No newline at end of file +uv run python main.py