Skip to content

Commit cf339db

Browse files
committed
Refresh Python quickstart for Python 3.12
1 parent f715525 commit cf339db

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ jobs:
2020
run: |
2121
apt update || echo "apt-update failed" # && apt -y upgrade
2222
- uses: actions/checkout@v3
23-
- name: Setup Python
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
- name: Setup Python dependencies
2427
run: |
25-
sudo apt -y update
26-
sudo apt -y install python3-pip python3-testresources
2728
cd src
29+
python -m pip install --upgrade pip
2830
python -m pip install -r requirements.txt
2931
- name: Setup app
3032
run: |

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ To run this prebuilt project, you will need:
1717

1818
- [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.
1919
- To run this tutorial using a self managed Couchbase cluster, please refer to the [appendix](#running-self-managed-couchbase-cluster).
20-
- [Python](https://www.python.org/downloads/) 3.9 or higher installed
20+
- [Python](https://www.python.org/downloads/) 3.12 or higher installed
21+
- This quickstart is verified in CI and locally with Python 3.12.
2122
- 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.
2223
- Loading Travel Sample Bucket
2324
If travel-sample is not loaded in your Capella cluster, you can load it by following the instructions for your Capella Cluster:
@@ -37,11 +38,9 @@ git clone https://github.com/couchbase-examples/python-quickstart.git
3738

3839
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.
3940

40-
> Note: If your Python is not symbolically linked to python3, you need to run all commands using `python3` instead of `python`.
41-
4241
```shell
4342
cd src
44-
python -m pip install -r requirements.txt
43+
python3 -m pip install -r requirements.txt
4544
```
4645

4746
> 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
@@ -79,7 +78,7 @@ At this point, we have installed the dependencies, loaded the travel-sample data
7978

8079
```sh
8180
cd src
82-
python app.py
81+
python3 app.py
8382
```
8483

8584
### Using Docker
@@ -115,7 +114,7 @@ To run the integration tests, use the following commands:
115114

116115
```sh
117116
cd src
118-
python -m pytest
117+
python3 -m pytest
119118
```
120119

121120
## Appendix

src/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim-bullseye
1+
FROM python:3.12-slim-bookworm
22

33
WORKDIR /app
44

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
couchbase==4.6.1
2-
flask_restx==1.3.0
2+
flask_restx==1.3.2
33
pytest==9.0.3
44
python-dotenv==1.2.2
55
requests==2.33.1

0 commit comments

Comments
 (0)