Skip to content

Commit 908c528

Browse files
Merge pull request #168 from coding-for-reproducible-research/update_requirements_pyproject
Update repo for pyproject.yml with requirements.txt
2 parents 0b05797 + 0e4c5a9 commit 908c528

File tree

5 files changed

+38
-16
lines changed

5 files changed

+38
-16
lines changed

.github/workflows/build-book.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,25 @@ jobs:
1818
with:
1919
python-version: 3.11
2020

21+
- name: Install Poetry
22+
run: |
23+
curl -sSL https://install.python-poetry.org | python3 -
24+
2125
- name: Install dependencies
2226
run: |
23-
pip install -r requirements.txt
27+
poetry install
2428
2529
# (optional) Cache your executed notebooks between runs
2630
- name: Cache executed notebooks
2731
uses: actions/cache@v4
2832
with:
2933
path: _build/.jupyter_cache
30-
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
34+
key: jupyter-book-cache-${{ hashFiles('pyproject.toml') }}
3135

3236
# Build the book
3337
- name: Build the book
3438
run: |
35-
jupyter-book build .
39+
poetry run jupyter-book build .
3640
3741
# Always upload logs, even if build succeeds
3842
- name: Upload error logs

.github/workflows/deploy-book.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,25 @@ jobs:
2525
with:
2626
python-version: 3.11
2727

28+
- name: Install Poetry
29+
run: |
30+
curl -sSL https://install.python-poetry.org | python3 -
31+
2832
- name: Install dependencies
2933
run: |
30-
pip install -r requirements.txt
34+
poetry install
3135
3236
# (optional) Cache your executed notebooks between runs
3337
- name: Cache executed notebooks
34-
uses: actions/cache@v3
38+
uses: actions/cache@v4
3539
with:
3640
path: _build/.jupyter_cache
37-
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
41+
key: jupyter-book-cache-${{ hashFiles('pyproject.toml') }}
3842

3943
# Build the book
4044
- name: Build the book
4145
run: |
42-
jupyter-book build .
46+
poetry run jupyter-book build .
4347
4448
# Upload the book's HTML as an artifact
4549
- name: Upload artifact

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ There are also several files within the root directory; these include:
3030
- **_toc.yml**: This file organizes the structure and overall navigation of the content of the Jupyter Book that is built.
3131
- **CITATION.cff**: Provides citation information for the CfRR website, and the course content aggregated throughout the website.
3232
- **references.bib**: Used to store bibliographic references throughout all of the content on the website.
33-
- **requirements.txt**: A file that specifies the dependencies of the Python kernel used in the website.
33+
- **pyproject.yml**: A file that specifies the dependencies of the Python kernel used in the website.
3434

3535
## Contributing
3636

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.poetry]
2+
name = "Coding for Reproducible Research Courses"
3+
version = "0.1.0"
4+
description = "Coding for Reproducible Research: Courses and Training Materials"
5+
authors = ["CfRR Contributors"]
6+
repository = "https://github.com/coding-for-reproducible-research/CfRR_Courses"
7+
homepage = "https://coding-for-reproducible-research.github.io/CfRR_Courses/home_page.html"
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.11" # or your desired Python version
11+
numpy = "^1.26.4"
12+
pandas = "*"
13+
jupyter-book = "*"
14+
ghp-import = "*"
15+
jupyterquiz = "*"
16+
matplotlib = "*"
17+
scikit-learn = "*"
18+
pyvis = "*"
19+
20+
[build-system]
21+
requires = ["poetry-core>=1.0.0"]
22+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)