Skip to content

Commit

Permalink
Separating jupyter book deployment libraries requirements from local …
Browse files Browse the repository at this point in the history
…python environment packages requirements
  • Loading branch information
shreyashguptas committed Nov 21, 2024
1 parent 974d1d1 commit 3317fbc
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 18 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ jobs:
with:
python-version: '3.11'

- name: Install dependencies
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: '3.11'

- name: Install book building dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
conda env create -f requirements-book.yml
conda activate jupyter-book
- name: Build the book
run: |
Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,28 @@ Remember: Everyone learns differently. If this approach doesn't click with you,
### (...)

### 2. Here is how this course is structured and intended to be used.
This is important because if you go how it is intended you'll get the maximum amount of value out of this course.
This is important because if you go how it is intended you'll get the maximum amount of value out of this course.

## Installation 📦

There are two ways to use this repository:

1. **To run the code examples locally:** ```bash
pip install -r requirements.txt ```
This will install all the necessary ML/DL libraries needed to run the example code.

2. **To build the book locally:** ```bash
# Create and activate conda environment with book-building dependencies
conda env create -f requirements-book.yml
conda activate jupyter-book

# Build the book
jupyter-book build . --all`

The separation provides several benefits:
1. Faster deployments since only necessary packages are installed
2. Clearer separation of concerns between book building and code running
3. Conda environment for book building helps avoid dependency conflicts
4. Users can choose to install only what they need

You might also want to add a `.gitignore` entry for the conda environment:
14 changes: 14 additions & 0 deletions requirements-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: jupyter-book
channels:
- conda-forge
dependencies:
- python=3.11
- jupyter-book>=0.13.0
- ghp-import
- sphinx>=4.0
- sphinx-book-theme
- myst-nb
- myst-parser
- nbformat
- nbconvert
- linkify-it-py
22 changes: 8 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
jupyter-book>=0.13.0
ghp-import
sphinx>=4.0
sphinx-book-theme
myst-nb
myst-parser
nbformat
nbconvert
linkify-it-py

python==3.11.10
matplotlib==3.9.2
# Core ML/DL libraries
torch==2.5.1
numpy==2.1.3
pandas==2.2.3
requests==2.32.3
torch==2.5.1

# Visualization
matplotlib==3.9.2

# Other utilities
requests==2.32.3

0 comments on commit 3317fbc

Please sign in to comment.