Skip to content

Commit 48e188d

Browse files
authored
Merge branch 'master' into test-code-figures
2 parents 1c4f9f0 + 5e7acb3 commit 48e188d

175 files changed

Lines changed: 14097 additions & 5853 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python 3.8
1818
uses: actions/setup-python@v1
1919
with:
20-
python-version: 3.8
20+
python-version: 3.9
2121
- uses: pre-commit/action@v2.0.0
2222

2323
tests:
@@ -26,15 +26,18 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ubuntu-latest]
29-
python-version: [3.6, 3.7, 3.8, 3.9]
30-
sphinx: [">=3,<4", ">=4,<5"]
29+
python-version: ["3.7", "3.8", "3.9", "3.10"]
30+
sphinx: [">=5,<6"]
3131
include:
32-
- os: windows-latest
32+
- os: ubuntu-latest
3333
python-version: 3.7
34-
sphinx: ">=3,<4"
35-
- os: macos-latest
36-
python-version: 3.9
3734
sphinx: ">=4,<5"
35+
- os: windows-latest
36+
python-version: 3.8
37+
sphinx: ">=5,<6"
38+
- os: macos-latest
39+
python-version: 3.8
40+
sphinx: ">=5,<6"
3841

3942
runs-on: ${{ matrix.os }}
4043

@@ -59,12 +62,12 @@ jobs:
5962
# this is why we run `coverage xml` afterwards (required by codecov)
6063

6164
- name: Upload to Codecov
62-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7 && matrix.sphinx == '>=3,<4' && github.repository == 'executablebooks/MyST-NB'
63-
uses: codecov/codecov-action@v1
65+
if: github.repository == 'executablebooks/MyST-NB' && matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
66+
uses: codecov/codecov-action@v3
6467
with:
65-
name: myst-nb-pytests-py3.7
68+
name: myst-nb-pytests
6669
flags: pytests
67-
file: ./coverage.xml
70+
files: ./coverage.xml
6871
fail_ci_if_error: true
6972

7073
publish:
@@ -74,18 +77,18 @@ jobs:
7477
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
7578
runs-on: ubuntu-latest
7679
steps:
77-
- name: Checkout source
78-
uses: actions/checkout@v2
79-
- name: Set up Python
80-
uses: actions/setup-python@v1
81-
with:
82-
python-version: 3.8
83-
- name: Build package
84-
run: |
85-
pip install wheel
86-
python setup.py sdist bdist_wheel
87-
- name: Publish
88-
uses: pypa/gh-action-pypi-publish@v1.1.0
89-
with:
90-
user: __token__
91-
password: ${{ secrets.PYPI_KEY }}
80+
- name: Checkout source
81+
uses: actions/checkout@v2
82+
- name: Set up Python
83+
uses: actions/setup-python@v1
84+
with:
85+
python-version: 3.8
86+
- name: install flit
87+
run: |
88+
pip install flit~=3.4
89+
- name: Build and publish
90+
run: |
91+
flit publish
92+
env:
93+
FLIT_USERNAME: __token__
94+
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dist/
1414
downloads/
1515
eggs/
1616
.eggs/
17-
lib/
1817
lib64/
1918
parts/
2019
sdist/
@@ -130,9 +129,12 @@ dmypy.json
130129
.pyre/
131130

132131
# Jupyter Cache
133-
docs/.jupyter_cache
132+
.jupyter_cache
134133

135134
# OSX
136135
.DS_Store
137136

138137
.vscode/
138+
139+
todos.md
140+
_archive/

.pre-commit-config.yaml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,48 @@ exclude: >
1111
1212
repos:
1313

14-
- repo: git://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.0.1
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.4.0
1616
hooks:
1717
- id: check-json
1818
- id: check-yaml
1919
- id: end-of-file-fixer
2020
- id: trailing-whitespace
2121

22-
- repo: https://github.com/mgedmin/check-manifest
23-
rev: "0.47"
22+
- repo: https://github.com/asottile/pyupgrade
23+
rev: v3.3.1
2424
hooks:
25-
- id: check-manifest
26-
args: [--no-build-isolation]
27-
additional_dependencies: [setuptools>=46.4.0]
25+
- id: pyupgrade
26+
args: [--py37-plus]
2827

2928
- repo: https://github.com/PyCQA/isort
30-
rev: 5.9.3
29+
rev: 5.12.0
3130
hooks:
3231
- id: isort
3332

3433
- repo: https://github.com/psf/black
35-
rev: 21.9b0
34+
rev: 23.3.0
3635
hooks:
3736
- id: black
3837

3938
- repo: https://github.com/PyCQA/flake8
40-
rev: 4.0.1
39+
rev: 6.0.0
4140
hooks:
4241
- id: flake8
43-
additional_dependencies: [flake8-bugbear==21.3.1]
42+
additional_dependencies: [flake8-bugbear]
4443

4544
- repo: https://github.com/pre-commit/mirrors-mypy
46-
rev: v0.910-1
45+
rev: v1.2.0
4746
hooks:
4847
- id: mypy
49-
args: [--config-file=setup.cfg]
48+
args: [--config-file=pyproject.toml]
5049
additional_dependencies:
51-
- myst-parser~=0.14.0
50+
- importlib_metadata
51+
- myst-parser~=0.18.0
52+
- "sphinx~=5.0"
53+
- nbclient
54+
- types-PyYAML
5255
files: >
5356
(?x)^(
54-
myst_nb/parser.py|
57+
myst_nb/.+\.py|
5558
)$
56-
57-
# this is not used for now,
58-
# since it converts myst-nb to myst_nb and removes comments
59-
# - repo: https://github.com/asottile/setup-cfg-fmt
60-
# rev: v1.17.0
61-
# hooks:
62-
# - id: setup-cfg-fmt

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22

33
python:
4-
version: 3
4+
version: "3.8"
55
install:
66
- method: pip
77
path: .

CHANGELOG.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,208 @@
11
# Change Log
22

3+
## v0.17.1 - 2022-30-09
4+
5+
[Full changelog](https://github.com/executablebooks/MyST-NB/compare/v0.17.0...v0.17.1)
6+
7+
- 👌 IMPROVE: `hide-output` button (#450)
8+
This now uses the same margin color as the cell source and, when the cell source is present, is "connected" to that, to form a single element.
9+
See [Hide cell contents](docs/render/hiding.md) for more information.
10+
11+
## v0.17.0 - 2022-29-09
12+
13+
[Full changelog](https://github.com/executablebooks/MyST-NB/compare/v0.16.0...v0.17.0)
14+
15+
- 👌 IMPROVE: Replace sphinx-togglebutton with built-in functionality (#446)
16+
This allows for tighter integration with myst-nb:
17+
18+
- Nicer rendering of the hidden content buttons
19+
- Customisation of the hide/show prompts
20+
21+
See [Hide cell contents](docs/render/hiding.md) for more information.
22+
23+
- 🐛 FIX: Inline exec variables with multiple outputs (#440)
24+
Previously, it was assumed that a variable evaluation would only ever create 0 or 1 outputs.
25+
Multiple are now allowed.
26+
27+
- 👌 IMPROVE: cache bust changes to CSS (#447)
28+
- 👌 IMPROVE: Move CSS colors to variables (#448)
29+
30+
## v0.16.0 - 2022-06-13
31+
32+
[Full changelog](https://github.com/executablebooks/MyST-NB/compare/v0.15.0...v0.16.0)
33+
34+
- ⬆️ UPGRADE: Sphinx v5 and drop v3 (see [changelog](https://www.sphinx-doc.org/en/master/changes.html)), myst-parser v0.18 (see [changelog](https://myst-parser.readthedocs.io/en/latest/develop/_changelog.html))
35+
- ⬆️ UPGRADE: Add Python 3.10 support
36+
37+
## v0.15.0 - 2022-05-05
38+
39+
[Full changelog](https://github.com/executablebooks/MyST-NB/compare/v0.14.0...v0.15.0)
40+
41+
✨ NEW: Add `inline` execution mode and `eval` role/directive, for inserting code variables directly into the text flow of your documentation!
42+
See [Inline variable evaluation](docs/render/inline.md) for more information.
43+
44+
## v0.14.0 - 2022-04-27
45+
46+
[Full changelog](https://github.com/executablebooks/MyST-NB/compare/v0.13.2...v0.14.0)
47+
48+
This release encompasses a **major** rewrite of the entire library and its documentation, primarily in [#380](https://github.com/executablebooks/MyST-NB/pull/380) and [#405](https://github.com/executablebooks/MyST-NB/pull/405).
49+
50+
### Breaking Changes ‼️
51+
52+
#### Configuration
53+
54+
A number of configuration option names have been changed, such that they now share the `nb_` prefix.
55+
Most of the deprecated names will be auto-converted at the start of the build, emitting a warning such as:
56+
57+
```
58+
WARNING: 'jupyter_execute_notebooks' is deprecated for 'nb_execution_mode' [mystnb.config]
59+
```
60+
61+
`nb_render_priority` has been removed and replaced by `nb_mime_priority_overrides`, which has a different format and is more flexible. See [Outputs MIME priority](docs/render/format_code_cells.md) for more information.
62+
63+
As per the changes in [`myst_parser`](myst:develop/_changelog), the `dollarmath` syntax extension is no longer included by default.
64+
To re-add this extension, ensure that it is specified in your `conf.py`: `myst_enable_extensions = ["dollarmath"]`.
65+
66+
For cell-level configuration the top-level key `render` has now been deprecated for `mystnb`.
67+
For example, replace:
68+
69+
````markdown
70+
```{code-cell}
71+
---
72+
render:
73+
image:
74+
width: 200px
75+
---
76+
...
77+
```
78+
````
79+
80+
with:
81+
82+
````markdown
83+
```{code-cell}
84+
---
85+
mystnb:
86+
image:
87+
width: 200px
88+
---
89+
...
90+
```
91+
````
92+
93+
`render` will currently still be read, if present, and will issue a `[mystnb.cell_metadata_key]` warning.
94+
95+
The `jupyter_sphinx_require_url` and `jupyter_sphinx_embed_url` configuration options are no longer used by this package, and are replaced by `nb_ipywidgets_js`.
96+
97+
See the [configuration section](docs/configuration.md) for more details.
98+
99+
#### Dependencies
100+
101+
The [ipywidgets](https://ipywidgets.readthedocs.io) package has been removed from the requirements.
102+
If required, please install it specifically.
103+
104+
#### AST structure and rendering plugins
105+
106+
The structure of the docutils AST and nodes produced by MyST-NB has been fully changed, for compatibility with the new [docutils only functionality](docs/docutils.md).
107+
See [the API documentation](docs/reference/api.rst) for more details.
108+
109+
The renderer plugin system (used by the `myst_nb.renderers` entry point) has also been completely rewritten,
110+
so any current existing renderers will no longer work.
111+
There is also now a new `myst_nb.mime_renderers` entry point, to allow for targeted rendering of specific code-cell output MIME types.
112+
See [Customise the render process](docs/render/format_code_cells.md) for more information.
113+
114+
#### Glue functionality
115+
116+
By default, `glue` roles and directives now only work for keys within the same document.
117+
To reference glued content in a different document, the `glue:any` directive allows for a `doc` option and `glue:any`/`glue:text` roles allow the (relative) doc path to be added, for example:
118+
119+
````markdown
120+
```{glue:any} var_text
121+
:doc: other.ipynb
122+
```
123+
124+
{glue:text}`other.ipynb::var_float:.2E`
125+
````
126+
127+
This cross-document functionality is currently restricted to only `text/plain` and `text/html` output MIME types, not images.
128+
129+
See [Embedding outputs as variables](docs/render/glue.md) for more details.
130+
131+
### Dependency changes ⬆️
132+
133+
- Removed:
134+
- `ipywidgets`
135+
- `jupyter_sphinx`
136+
- `nbconvert`
137+
- Updated:
138+
- `Python`: `3.6+ -> 3.7+`
139+
- `myst_parser`: [`0.15 -> 0.17`](myst:develop/_changelog)
140+
- `jupyter-cache`: [`0.4 -> 0.5`](https://github.com/executablebooks/jupyter-cache/blob/master/CHANGELOG.md)
141+
- `sphinx-togglebutton`: [`0.1 -> 0.3`](https://sphinx-togglebutton.readthedocs.io/en/latest/changelog.html)
142+
143+
### New and improved ✨
144+
145+
The following is a non-exhaustive list of new features and improvements, see the rest of the documentation for all the changes.
146+
147+
- Multi-level configuration (global (`conf.py`) < notebook level metadata < cell level metadata)
148+
- Plus new config options including: `nb_number_source_lines`, `nb_remove_code_source`, `nb_remove_code_outputs`, `nb_render_error_lexer`, `nb_execution_raise_on_error`, `nb_kernel_rgx_aliases`
149+
- See the [configuration section](docs/configuration.md) for more details.
150+
151+
- Added `mystnb-quickstart` and `mystnb-to-jupyter` CLI commands.
152+
153+
- MyST text-based notebooks can now be specified by just:
154+
155+
```yaml
156+
---
157+
file_format: mystnb
158+
kernelspec:
159+
name: python3
160+
---
161+
```
162+
163+
as opposed to the alternative jupytext top-matter.
164+
See [Text-based Notebooks](docs/authoring/text-notebooks.md) for more details.
165+
166+
- docutils API/CLI with command line tools, e.g. `mystnb-docutils-html`
167+
- Includes `glue` roles and directives
168+
- See [single page builds](docs/docutils.md) for more details.
169+
170+
- Parallel friendly (e.g. `sphinx-build -j 4` can execute four notebooks in parallel)
171+
172+
- Page specific loading of ipywidgets JavaScript, i.e. only when ipywidgets are present in the notebook.
173+
174+
- Added raw cell rendering, with the `raw-cell` directive.
175+
See [Raw cells authoring](docs/authoring/jupyter-notebooks.md) for more details.
176+
177+
- Added MIME render plugins. See [Customise the render process](docs/render/format_code_cells.md) for more details.
178+
179+
- Better log info/warnings, with `type.subtype` specifiers for warning suppression.
180+
See [Warning suppression](docs/configuration.md) for more details.
181+
182+
- Reworked jupyter-cache integration to be easier to use (including parallel execution)
183+
184+
- Added image options to `glue:figure`
185+
186+
- New `glue:md` role/directive includes nested parsing of MyST Markdown.
187+
See [Embedding outputs as variables](docs/render/glue.md) for more details.
188+
189+
- Improved `nb-exec-table` directive (includes links to documents, etc)
190+
191+
### Additional Pull Requests
192+
193+
- 👌 IMPROVE: Update ANSI CSS colors by @saulshanabrook in [#384](https://github.com/executablebooks/MyST-NB/pull/384)
194+
- ✨ NEW: Add `nb_execution_raise_on_error` config by @chrisjsewell in [#404](https://github.com/executablebooks/MyST-NB/pull/404)
195+
- 👌 IMPROVE: Add image options to `glue:figure` by @chrisjsewell in [#403](https://github.com/executablebooks/MyST-NB/pull/403)
196+
197+
## v0.13.2 - 2022-02-10
198+
199+
This release improves for cell outputs and brings UI improvements for toggling cell inputs and outputs.
200+
It also includes several bugfixes.
201+
202+
- Add CSS support for 8-bit ANSI colours [#379](https://github.com/executablebooks/MyST-NB/pull/379) ([@thiippal](https://github.com/thiippal))
203+
- Use configured `nb_render_plugin` for glue nodes [#337](https://github.com/executablebooks/MyST-NB/pull/337) ([@bryanwweber](https://github.com/bryanwweber))
204+
- UPGRADE: sphinx-togglebutton v0.3.0 [#390](https://github.com/executablebooks/MyST-NB/pull/390) ([@choldgraf](https://github.com/choldgraf))
205+
3206
## 0.13.1 - 2021-10-04
4207

5208
✨ NEW: `nb_merge_streams` configuration [[PR #364](https://github.com/executablebooks/MyST-NB/pull/364)]

0 commit comments

Comments
 (0)