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
{

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
"source": [
2121
"## Prerequisites\n",
2222
"\n",
23-
"Install required packages."
23+
"First, install the required dependencies by uncommenting and invoking the\n",
24+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
25+
"environment afterwards. If you observe any installation problems, please report\n",
26+
"them back to us."
2427
],
2528
"metadata": {
2629
"collapsed": false
@@ -34,7 +37,7 @@
3437
},
3538
"outputs": [],
3639
"source": [
37-
"#!pip install -r requirements.txt"
40+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
3841
]
3942
},
4043
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Synopsis::
1111
1212
# Install prerequisites.
13-
pip install -r requirements.txt
13+
pip install -U -r requirements.txt
1414
1515
# Start database.
1616
docker run --rm -it --publish=4200:4200 crate/crate:nightly

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
"source": [
3939
"## Getting Started\n",
4040
"\n",
41-
"Install required Python packages."
41+
"First, install the required dependencies by uncommenting and invoking the\n",
42+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
43+
"environment afterwards. If you observe any installation problems, please report\n",
44+
"them back to us."
4245
]
4346
},
4447
{
@@ -52,7 +55,7 @@
5255
},
5356
"outputs": [],
5457
"source": [
55-
"#!pip install -r requirements.txt"
58+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/machine-learning/llm-langchain/requirements.txt"
5659
]
5760
},
5861
{

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

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

topic/machine-learning/mlops-mlflow/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ way, it is easy to wipe your virtualenv and start from scratch anytime.
4848
```shell
4949
python3 -m venv .venv
5050
source .venv/bin/activate
51-
pip install -r requirements.txt
51+
pip install -U -r requirements.txt
5252
```
5353

5454

topic/timeseries/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ folder, also satisfying all the dependencies.
6262
```console
6363
python3 -m venv .venv
6464
source .venv/bin/activate
65-
pip install -r requirements.txt -r requirements-dev.txt
65+
pip install -U -r requirements.txt -r requirements-dev.txt
6666
```
6767

6868
Then, invoke the software tests, roughly validating all notebooks within

topic/timeseries/dask-weather-data-import.ipynb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@
5454
"id": "b59cf879",
5555
"metadata": {},
5656
"source": [
57-
"## Step 1: Install dependencies"
57+
"## Step 1: Install dependencies\n",
58+
"\n",
59+
"First, install the required dependencies by uncommenting and invoking the\n",
60+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
61+
"environment afterwards. If you observe any installation problems, please report\n",
62+
"them back to us."
5863
]
5964
},
6065
{
@@ -66,7 +71,7 @@
6671
},
6772
"outputs": [],
6873
"source": [
69-
"!pip install --upgrade 'cratedb-toolkit' 'dask' 'kaggle' 'pandas==2.0.*' 'pueblo>=0.0.7' 'sqlalchemy-cratedb'"
74+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
7075
]
7176
},
7277
{

topic/timeseries/exploratory_data_analysis.ipynb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
"source": [
3333
"## Getting started\n",
3434
"\n",
35-
"To get started with this notebook install necessary dependecies and import required modules:"
35+
"First, install the required dependencies by uncommenting and invoking the\n",
36+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
37+
"environment afterwards. If you observe any installation problems, please report\n",
38+
"them back to us."
3639
]
3740
},
3841
{
@@ -42,10 +45,7 @@
4245
"metadata": {},
4346
"outputs": [],
4447
"source": [
45-
"#!pip install -r requirements.txt\n",
46-
"\n",
47-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
48-
"#!pip install -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
48+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
4949
]
5050
},
5151
{
@@ -59,10 +59,8 @@
5959
"warnings.filterwarnings('ignore')\n",
6060
"import pandas as pd\n",
6161
"import sqlalchemy as sa\n",
62-
"import requests\n",
6362
"import os\n",
64-
"from pycaret.time_series import TSForecastingExperiment\n",
65-
"import refinitiv.data as rd"
63+
"from pycaret.time_series import TSForecastingExperiment"
6664
]
6765
},
6866
{

topic/timeseries/time-series-decomposition.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
"source": [
3737
"## Getting started\n",
3838
"\n",
39-
"To get started with this notebook install necessary dependecies and import required 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."
4043
]
4144
},
4245
{
@@ -46,10 +49,7 @@
4649
"metadata": {},
4750
"outputs": [],
4851
"source": [
49-
"#!pip install -r requirements.txt\n",
50-
"\n",
51-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
52-
"#!pip install -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
52+
"#!pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
5353
]
5454
},
5555
{

topic/timeseries/timeseries-anomaly-detection.ipynb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"\n",
3232
"## Getting started\n",
3333
"\n",
34-
"First, you should install the required dependencies, you can do that by uncommenting and running the next cell. Next, import the ones we will use in this exercise.\n",
35-
"\n",
36-
"[SQLAlchemy]: https://cratedb.com/docs/python/en/latest/sqlalchemy.html\n",
37-
"[Pycaret]: https://github.com/pycaret/pycaret"
34+
"First, install the required dependencies by uncommenting and invoking the\n",
35+
"`pip install` command below. Please make sure to restart the notebook runtime\n",
36+
"environment afterwards. If you observe any installation problems, please report\n",
37+
"them back to us."
3838
]
3939
},
4040
{
@@ -43,10 +43,7 @@
4343
"metadata": {},
4444
"outputs": [],
4545
"source": [
46-
"%pip install -r requirements.txt\n",
47-
"\n",
48-
"# Note: If you are running in an environment like Google Colab, please use the absolute path of the requirements:\n",
49-
"#%pip install -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
46+
"#%pip install -U -r https://github.com/crate/cratedb-examples/raw/main/topic/timeseries/requirements.txt"
5047
]
5148
},
5249
{

0 commit comments

Comments
 (0)