Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Tutorial Notebook tutorials for samples 10.2.4 #64

Merged
merged 5 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
name: ci
---
name: Website
on:
push:
branches:
- master
- main
workflow_dispatch:
inputs:
deploy-gh-pages:
description: Deploy to GH Pages
required: true
type: boolean
default: true
pull_request:
permissions:
contents: write
jobs:
deploy:
build-or-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install requirements
run: pip install -r requirements.txt
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
- name: Set Cache ID
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Cache mkdocs-material
uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material mkdocs-jupyter
- run: mkdocs gh-deploy --force
- name: Build site (PR)
if: github.event_name == 'pull_request' || inputs.deploy-gh-pages == false
run: mkdocs build
- name: Deploy site to GH pages (Manual)
if: github.event_name == 'workflow_dispatch' && inputs.deploy-gh-pages == true
run: mkdocs gh-deploy --force
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# macOS
.DS_Store

# Jupyter
.ipynb_checkpoints

# Other
docs/advanced/Notebooks/logs.log
.cache
.cache
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
repos:
# We'll activate these two later once we merged kdic-tutorials
#- repo: https://github.com/psf/black-pre-commit-mirror
# rev: 24.8.0
# hooks:
#- id: black-jupyter
# language_version: python3
#- repo: https://github.com/lyz-code/yamlfix/
#rev: 1.17.0
#hooks:
#- id: yamlfix
#language: python
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
hooks:
- id: check-github-workflows
name: gh-workflows
args: [--verbose]
- id: check-github-actions
name: gh-actions
args: [--verbose]
- repo: local
hooks:
- id: notebook-clean
name: notebook-clean
entry: jupyter nbconvert --ClearMetadataPreprocessor.enabled=True --inplace
--log-level=ERROR
language: python
files: .*\.ipynb
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This is the technical repository for the Khiops documentation website.

## Setup
Install the website requirements
Install the development requirements

```bash
pip install -r requirements.txt
Expand All @@ -17,6 +17,21 @@ mkdocs serve
Then open in a web browser the indicated URL, usually http://127.0.0.1:8000/ . You don't need to
restart the server every time because the site will refresh itself when you modify files.

### pre-commit
The previous step will also install the `pre-commit` tool. This allows to automatize some tasks such
as formatting and cleaning of the notebooks.

To use it, it is necessary to install it locally:
```bash
pre-commit install
```

The configured tasks will run every time you make a commit. You may also run them at any time with
the line
```bash
pre-commit run --verbose --all-files
```


## Maintainance
To update various versions in the website, you only have to change the following attributes in the
Expand All @@ -29,4 +44,5 @@ To update various versions in the website, you only have to change the following


## Deploy to khiops.org
Once you have committed and pushed your changes. Use the `ci` workflow in the repo's actions.
Once you have committed and pushed your changes, go to the "Actions" tab on Github and execute the
`Website` workflow on the `main` branch.
Loading
Loading