diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d093a17..4d17735 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,11 +20,13 @@ jobs: run: | apt update || echo "apt-update failed" # && apt -y upgrade - uses: actions/checkout@v3 - - name: Setup Python + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Setup Python dependencies run: | - sudo apt -y update - sudo apt -y install python3-pip python3-testresources cd src + python -m pip install --upgrade pip python -m pip install -r requirements.txt - name: Setup app run: | diff --git a/README.md b/README.md index 70ece5a..adbca80 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ To run this prebuilt project, you will need: - [Couchbase Capella](https://www.couchbase.com/products/capella/) cluster with [travel-sample](https://docs.couchbase.com/python-sdk/current/ref/travel-app-data-model.html) bucket loaded. - To run this tutorial using a self managed Couchbase cluster, please refer to the [appendix](#running-self-managed-couchbase-cluster). -- [Python](https://www.python.org/downloads/) 3.9 or higher installed +- [Python](https://www.python.org/downloads/) 3.12 or higher installed + - This quickstart is verified in CI and locally with Python 3.12. - Ensure that the Python version is [compatible](https://docs.couchbase.com/python-sdk/current/project-docs/compatibility.html#python-version-compat) with the Couchbase SDK. - Loading Travel Sample Bucket If travel-sample is not loaded in your Capella cluster, you can load it by following the instructions for your Capella Cluster: @@ -37,16 +38,16 @@ git clone https://github.com/couchbase-examples/python-quickstart.git The dependencies for the application are specified in the `requirements.txt` file in the source folder. Dependencies can be installed through `pip` the default package manager for Python. -> Note: If your Python is not symbolically linked to python3, you need to run all commands using `python3` instead of `python`. - ```shell cd src -python -m pip install -r requirements.txt +python3 -m pip install -r requirements.txt ``` +> Note: On Windows, or inside an activated virtual environment where `python3` is not available, use `python` in the commands below instead. + > Note: Python SDKs older than version 4.1.9 require OpenSSL v1.1. This might not be the default in some newer platforms. In such scenarios, please install the SDK without using the prebuilt wheels -> `python -m pip install couchbase --no-binary couchbase` +> `python3 -m pip install couchbase --no-binary couchbase` > Refer to the [instructions in the SDK](https://github.com/couchbase/couchbase-python-client#alternative-installation-methods) for more info. @@ -79,7 +80,7 @@ At this point, we have installed the dependencies, loaded the travel-sample data ```sh cd src -python app.py +python3 app.py ``` ### Using Docker @@ -115,7 +116,7 @@ To run the integration tests, use the following commands: ```sh cd src -python -m pytest +python3 -m pytest ``` ## Appendix diff --git a/src/Dockerfile b/src/Dockerfile index b41d5cb..6ce2c17 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim-bullseye +FROM python:3.12-slim-bookworm WORKDIR /app diff --git a/src/requirements.txt b/src/requirements.txt index de48862..401d73a 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,5 +1,5 @@ couchbase==4.6.1 -flask_restx==1.3.0 +flask_restx==1.3.2 pytest==9.0.3 python-dotenv==1.2.2 requests==2.33.1 \ No newline at end of file