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

DX: workflows including MyST NB and precommit added #9

Merged
merged 22 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
32 changes: 32 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Documentation
on:
pull_request:
branches: [main]
push:
# Runs on pushes targeting the default branch
shenvitor marked this conversation as resolved.
Show resolved Hide resolved
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
- run: pixi run doc
- uses: actions/upload-pages-artifact@v3
with:
path: ./_build/html
shenvitor marked this conversation as resolved.
Show resolved Hide resolved

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: >-
github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v4
46 changes: 0 additions & 46 deletions .github/workflows/deploy.yml
shenvitor marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pixi environments
.pixi
*.egg-info
.ipynb_checkpoints/

.pixi
node_modules/
19 changes: 16 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
Expand All @@ -16,3 +16,16 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/redeboer/taplo-pre-commit
rev: v0.9.1rc1
hooks:
- id: taplo

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
12 changes: 12 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[formatting]
align_comments = false
align_entries = false
allowed_blank_lines = 1
array_auto_collapse = false
array_auto_expand = true
array_trailing_comma = true
column_width = 88
compact_inline_tables = true
indent_string = " "
reorder_arrays = true
reorder_keys = true
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.ipynb_checkpoints
_build
11 changes: 11 additions & 0 deletions docs/conf.py
shenvitor marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exclude_patterns = [
"**.ipynb_checkpoints",
".DS_Store",
".pixi",
"Thumbs.db",
"_build",
]
extensions = ["myst_nb"]
master_doc = "index"
nitpicky = True
project = "GlueX N-Star"
24 changes: 12 additions & 12 deletions Hello.ipynb → docs/hello.ipynb
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Starting document"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "086f6c1d-4e2d-4a97-85fb-c61cd55634d7",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello World!\n"
]
}
],
"outputs": [],
"source": [
"print(\"Hello World!\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f32a577e-5098-4070-b58b-274d4314cb07",
"id": "2",
"metadata": {},
"outputs": [],
"source": []
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MyST-NB Quickstart

```{toctree}
hello
```
Loading
Loading