Skip to content

Commit 3317fbc

Browse files
Separating jupyter book deployment libraries requirements from local python environment packages requirements
1 parent 974d1d1 commit 3317fbc

File tree

4 files changed

+56
-18
lines changed

4 files changed

+56
-18
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ jobs:
3131
with:
3232
python-version: '3.11'
3333

34-
- name: Install dependencies
34+
- name: Setup Conda
35+
uses: conda-incubator/setup-miniconda@v3
36+
with:
37+
auto-update-conda: true
38+
python-version: '3.11'
39+
40+
- name: Install book building dependencies
3541
run: |
36-
python -m pip install --upgrade pip
37-
pip install -r requirements.txt
42+
conda env create -f requirements-book.yml
43+
conda activate jupyter-book
3844
3945
- name: Build the book
4046
run: |

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,28 @@ Remember: Everyone learns differently. If this approach doesn't click with you,
7676
### (...)
7777

7878
### 2. Here is how this course is structured and intended to be used.
79-
This is important because if you go how it is intended you'll get the maximum amount of value out of this course.
79+
This is important because if you go how it is intended you'll get the maximum amount of value out of this course.
80+
81+
## Installation 📦
82+
83+
There are two ways to use this repository:
84+
85+
1. **To run the code examples locally:** ```bash
86+
pip install -r requirements.txt ```
87+
This will install all the necessary ML/DL libraries needed to run the example code.
88+
89+
2. **To build the book locally:** ```bash
90+
# Create and activate conda environment with book-building dependencies
91+
conda env create -f requirements-book.yml
92+
conda activate jupyter-book
93+
94+
# Build the book
95+
jupyter-book build . --all`
96+
97+
The separation provides several benefits:
98+
1. Faster deployments since only necessary packages are installed
99+
2. Clearer separation of concerns between book building and code running
100+
3. Conda environment for book building helps avoid dependency conflicts
101+
4. Users can choose to install only what they need
102+
103+
You might also want to add a `.gitignore` entry for the conda environment:

requirements-book.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: jupyter-book
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.11
6+
- jupyter-book>=0.13.0
7+
- ghp-import
8+
- sphinx>=4.0
9+
- sphinx-book-theme
10+
- myst-nb
11+
- myst-parser
12+
- nbformat
13+
- nbconvert
14+
- linkify-it-py

requirements.txt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
jupyter-book>=0.13.0
2-
ghp-import
3-
sphinx>=4.0
4-
sphinx-book-theme
5-
myst-nb
6-
myst-parser
7-
nbformat
8-
nbconvert
9-
linkify-it-py
10-
11-
python==3.11.10
12-
matplotlib==3.9.2
1+
# Core ML/DL libraries
2+
torch==2.5.1
133
numpy==2.1.3
144
pandas==2.2.3
15-
requests==2.32.3
16-
torch==2.5.1
5+
6+
# Visualization
7+
matplotlib==3.9.2
8+
9+
# Other utilities
10+
requests==2.32.3

0 commit comments

Comments
 (0)