Skip to content

Commit 650217a

Browse files
committed
Synchronize dependencies by using requirements.txt across the board
Diverging sets of dependencies are a constant struggle for people vs. machines, either aiming to use the notebooks, or to validate them, respectively. The idea is to improve the situation by referring to the canonical `requirements.txt` file from everywhere. In this spirit, dependency updates can be driven well by Dependabot, and relevant software artefacts should be synchronized better. By using absolute URLs to the `requirements.txt` files, the relevant `pip install` invocation should also work well on runtime environments like Google Colab, which need them.
1 parent 189c211 commit 650217a

21 files changed

+91
-77
lines changed

topic/machine-learning/automl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Alternatively, you can validate all resources in this folder by invoking a
9191
test runner program on the top-level folder of this repository. This is the
9292
same code path the CI jobs are taking.
9393
```shell
94-
pip install -r requirements.txt
94+
pip install -U -r requirements.txt
9595
ngr test topic/machine-learning/automl
9696
```
9797

topic/machine-learning/automl/automl_classification_with_pycaret.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@
115115
"source": [
116116
"## Getting started\n",
117117
"\n",
118-
"First, install the required dependencies. "
118+
"First, install the required dependencies by uncommenting and invoking the\n",
119+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
120+
"environment afterwards. If you observe any installation problems, please report\n",
121+
"them back to us."
119122
]
120123
},
121124
{
@@ -124,12 +127,7 @@
124127
"metadata": {},
125128
"outputs": [],
126129
"source": [
127-
"#!pip install -r requirements.txt\n",
128-
"\n",
129-
"# In an environment like Google Colab, please use the absolute URL to the requirements.txt file.\n",
130-
"# Note: Some inconsistencies of dependencies might get reported. They can usually be ignored.\n",
131-
"# Restart the runtime, if asked by Colab.\n",
132-
"#!pip install -r https://raw.githubusercontent.com/crate/cratedb-examples/main/topic/machine-learning/automl/requirements.txt"
130+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/automl/requirements.txt"
133131
]
134132
},
135133
{

topic/machine-learning/automl/automl_timeseries_forecasting_with_pycaret.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@
107107
"source": [
108108
"## Getting started\n",
109109
"\n",
110-
"First, install the required dependencies. "
110+
"First, install the required dependencies by uncommenting and invoking the\n",
111+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
112+
"environment afterwards. If you observe any installation problems, please report\n",
113+
"them back to us."
111114
]
112115
},
113116
{
@@ -116,12 +119,7 @@
116119
"metadata": {},
117120
"outputs": [],
118121
"source": [
119-
"#!pip install -r requirements.txt\n",
120-
"\n",
121-
"# In an environment like Google Colab, please use the absolute URL to the requirements.txt file.\n",
122-
"# Note: Some inconsistencies of dependencies might get reported. They can usually be ignored.\n",
123-
"# Restart the runtime, if asked by Colab.\n",
124-
"#!pip install -r https://raw.githubusercontent.com/crate/cratedb-examples/main/topic/machine-learning/automl/requirements.txt"
122+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/automl/requirements.txt"
125123
]
126124
},
127125
{

topic/machine-learning/llm-langchain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ from scratch anytime.
9797
```shell
9898
python3 -m venv .venv
9999
source .venv/bin/activate
100-
pip install -r requirements.txt
100+
pip install -U -r requirements.txt
101101
```
102102

103103

topic/machine-learning/llm-langchain/conversational_memory.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"source": [
1919
"## Prerequisites\n",
2020
"\n",
21-
"Install required packages."
21+
"First, install the required dependencies by uncommenting and invoking the\n",
22+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
23+
"environment afterwards. If you observe any installation problems, please report\n",
24+
"them back to us."
2225
],
2326
"metadata": {
2427
"collapsed": false
@@ -29,7 +32,7 @@
2932
"execution_count": 1,
3033
"outputs": [],
3134
"source": [
32-
"#!pip install -r requirements.txt"
35+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
3336
],
3437
"metadata": {
3538
"collapsed": false

topic/machine-learning/llm-langchain/conversational_memory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Synopsis::
55
66
# Install prerequisites.
7-
pip install -r requirements.txt
7+
pip install -U -r requirements.txt
88
99
# Start database.
1010
docker run --rm -it --publish=4200:4200 crate/crate:nightly

topic/machine-learning/llm-langchain/cratedb-vectorstore-rag-openai-sql.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@
5252
"id": "774c3e61",
5353
"metadata": {},
5454
"source": [
55-
"Install required Python packages, and import Python modules."
55+
"First, install the required dependencies by uncommenting and invoking the\n",
56+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
57+
"environment afterwards. If you observe any installation problems, please report\n",
58+
"them back to us."
5659
]
5760
},
5861
{
@@ -62,10 +65,7 @@
6265
"metadata": {},
6366
"outputs": [],
6467
"source": [
65-
"#!pip install -r requirements.txt\n",
66-
"\n",
67-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
68-
"#!pip install -r https://raw.githubusercontent.com/crate/cratedb-examples/main/topic/machine-learning/llm-langchain/requirements.txt"
68+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
6969
]
7070
},
7171
{

topic/machine-learning/llm-langchain/cratedb_rag_customer_support.ipynb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,18 @@
2828
},
2929
"source": [
3030
"## Getting Started\n",
31-
"CrateDB supports storing vectors since version 5.5. You can leverage the fully managed service of CrateDB Cloud, or install CrateDB on your own, for example using Docker.\n",
31+
"CrateDB supports storing vectors starting with version 5.5. You can leverage the\n",
32+
"fully managed service of CrateDB Cloud, or install CrateDB on your own, for example\n",
33+
"using Docker.\n",
3234
"\n",
33-
"`docker run --publish 4200:4200 --publish 5432:5432 --pull=always crate:latest -Cdiscovery.type=single-node`\n",
35+
"```shell\n",
36+
"docker run --publish 4200:4200 --publish 5432:5432 --pull=always crate:latest -Cdiscovery.type=single-node\n",
37+
"```\n",
3438
"\n",
35-
"Install required Python packages, and import Python modules."
39+
"First, install the required dependencies by uncommenting and invoking the\n",
40+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
41+
"environment afterwards. If you observe any installation problems, please report\n",
42+
"them back to us."
3643
]
3744
},
3845
{
@@ -47,10 +54,7 @@
4754
},
4855
"outputs": [],
4956
"source": [
50-
"#!pip install -r requirements.txt\n",
51-
"\n",
52-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
53-
"#!pip install -r https://raw.githubusercontent.com/crate/cratedb-examples/main/topic/machine-learning/llm-langchain/requirements.txt\""
57+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
5458
]
5559
},
5660
{

topic/machine-learning/llm-langchain/cratedb_rag_customer_support_langchain.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@
6767
"\n",
6868
"## Setup\n",
6969
"\n",
70-
"Install required Python packages, and import Python modules."
70+
"First, install the required dependencies by uncommenting and invoking the\n",
71+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
72+
"environment afterwards. If you observe any installation problems, please report\n",
73+
"them back to us."
7174
]
7275
},
7376
{
@@ -83,10 +86,7 @@
8386
},
8487
"outputs": [],
8588
"source": [
86-
"#!pip install -r requirements.txt\n",
87-
"\n",
88-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
89-
"#!pip install -r https://raw.githubusercontent.com/crate/cratedb-examples/main/topic/machine-learning/llm-langchain/requirements.txt"
89+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
9090
]
9191
},
9292
{

topic/machine-learning/llm-langchain/cratedb_rag_customer_support_vertexai.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@
6767
"\n",
6868
"## Setup\n",
6969
"\n",
70-
"Install required Python packages, and import Python modules."
70+
"First, install the required dependencies by uncommenting and invoking the\n",
71+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
72+
"environment afterwards. If you observe any installation problems, please report\n",
73+
"them back to us."
7174
]
7275
},
7376
{
@@ -82,10 +85,7 @@
8285
},
8386
"outputs": [],
8487
"source": [
85-
"#!pip install -r requirements.txt\n",
86-
"\n",
87-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
88-
"#!pip install -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt\""
88+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
8989
]
9090
},
9191
{

0 commit comments

Comments
 (0)