sphinx-examples-as-code 0.8.2__tar.gz → 0.8.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/.github/workflows/ci.yml +1 -1
  2. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/PKG-INFO +7 -8
  3. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/README.md +5 -5
  4. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/pyproject.toml +1 -2
  5. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code/__init__.py +5 -1
  6. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code/_version.py +3 -3
  7. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code.egg-info/PKG-INFO +7 -8
  8. sphinx_examples_as_code-0.8.3/sphinx_examples_as_code.egg-info/scm_version.json +8 -0
  9. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/test_sphinx_examples_as_code.py +10 -0
  10. sphinx_examples_as_code-0.8.2/sphinx_examples_as_code.egg-info/scm_version.json +0 -8
  11. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/.github/dependabot.yml +0 -0
  12. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/.github/release.yml +0 -0
  13. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/.gitignore +0 -0
  14. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/.pre-commit-config.yaml +0 -0
  15. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/LICENSE +0 -0
  16. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/setup.cfg +0 -0
  17. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code.egg-info/SOURCES.txt +0 -0
  18. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code.egg-info/dependency_links.txt +0 -0
  19. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code.egg-info/requires.txt +0 -0
  20. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code.egg-info/scm_file_list.json +0 -0
  21. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/sphinx_examples_as_code.egg-info/top_level.txt +0 -0
  22. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/gallery_fixture/conf.py +0 -0
  23. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/gallery_fixture/examples/GALLERY_HEADER.rst +0 -0
  24. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/gallery_fixture/examples/plot_minimal.py +0 -0
  25. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/gallery_fixture/index.rst +0 -0
  26. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/heading_level_fixture/conf.py +0 -0
  27. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/heading_level_fixture/examples/GALLERY_HEADER.rst +0 -0
  28. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/heading_level_fixture/examples/plot_reused_level.py +0 -0
  29. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/heading_level_fixture/examples/plot_three_levels.py +0 -0
  30. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/heading_level_fixture/index.rst +0 -0
  31. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/single_function_fixture/conf.py +0 -0
  32. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/single_function_fixture/index.rst +0 -0
  33. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/single_function_fixture/mymodule.py +0 -0
  34. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/test_gallery_downloads.py +0 -0
  35. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/test_heading_level_reuse.py +0 -0
  36. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/test_single_function_page.py +0 -0
  37. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/test_tinypages.py +0 -0
  38. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/tinypages/conf.py +0 -0
  39. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/tinypages/docstring_cases.py +0 -0
  40. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/tinypages/docstring_cases.rst +0 -0
  41. {sphinx_examples_as_code-0.8.2 → sphinx_examples_as_code-0.8.3}/tests/tinypages/index.rst +0 -0
@@ -37,7 +37,7 @@ jobs:
37
37
  strategy:
38
38
  fail-fast: false
39
39
  matrix:
40
- python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
40
+ python-version: ['3.11', '3.12', '3.13', '3.14']
41
41
  steps:
42
42
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43
43
  with:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sphinx-examples-as-code
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: Sphinx extension for converting docstring examples into downloadable code.
5
5
  Author-email: The PyVista Developers <info@pyvista.org>
6
6
  License-Expression: MIT
@@ -13,13 +13,12 @@ Classifier: Operating System :: MacOS
13
13
  Classifier: Operating System :: Microsoft :: Windows
14
14
  Classifier: Operating System :: POSIX :: Linux
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
20
19
  Classifier: Programming Language :: Python :: 3.14
21
20
  Classifier: Topic :: Scientific/Engineering :: Visualization
22
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
23
22
  Description-Content-Type: text/markdown
24
23
  License-File: LICENSE
25
24
  Requires-Dist: packaging>=22
@@ -151,8 +150,7 @@ imports, plus any `dependencies` set for its format, and says how to run it:
151
150
  needed, so the command works in bash, zsh, PowerShell and cmd. An argument containing
152
151
  `"`, `$`, a backtick, `\`, `%` or a `!` not followed by `=` is single-quoted instead,
153
152
  which cmd does not understand.
154
- - marimo notebooks start with the same `# /// script` block, which also lists `marimo`
155
- unless another dependency installs it,
153
+ - marimo notebooks start with the same `# /// script` block, which also lists `marimo`,
156
154
  followed by `# Open this notebook with: uvx marimo edit --sandbox <name>_marimo.py`.
157
155
  - Each run command is followed by a line linking to
158
156
  [uv's installation guide](https://docs.astral.sh/uv/getting-started/installation/).
@@ -161,9 +159,10 @@ Imports are read from the code, not run. Each imported top-level module maps to
161
159
  project that provides it in the environment building the docs; standard-library
162
160
  modules, relative imports and modules no single installed project provides are left
163
161
  out. Projects the code needs but never imports, such as an optional backend, go in
164
- `dependencies`. A dependency with no version or extras of its own is left out when another listed
165
- one already installs it on every platform, e.g. `numpy` and `marimo` next to
166
- `pyvista[marimo]`.
162
+ `dependencies`. In Python scripts and Jupyter notebooks, a dependency with no version or extras of
163
+ its own is left out when another listed one already installs it on every platform, e.g. `numpy`
164
+ next to `pyvista`. marimo notebooks list every dependency, since marimo's sandbox adds back any
165
+ it does not find by name.
167
166
 
168
167
  The project named by Sphinx's own `project` setting (e.g. `project = 'PyVista'`) gets
169
168
  extra treatment when an example imports it and it is installed: its dependency becomes
@@ -119,8 +119,7 @@ imports, plus any `dependencies` set for its format, and says how to run it:
119
119
  needed, so the command works in bash, zsh, PowerShell and cmd. An argument containing
120
120
  `"`, `$`, a backtick, `\`, `%` or a `!` not followed by `=` is single-quoted instead,
121
121
  which cmd does not understand.
122
- - marimo notebooks start with the same `# /// script` block, which also lists `marimo`
123
- unless another dependency installs it,
122
+ - marimo notebooks start with the same `# /// script` block, which also lists `marimo`,
124
123
  followed by `# Open this notebook with: uvx marimo edit --sandbox <name>_marimo.py`.
125
124
  - Each run command is followed by a line linking to
126
125
  [uv's installation guide](https://docs.astral.sh/uv/getting-started/installation/).
@@ -129,9 +128,10 @@ Imports are read from the code, not run. Each imported top-level module maps to
129
128
  project that provides it in the environment building the docs; standard-library
130
129
  modules, relative imports and modules no single installed project provides are left
131
130
  out. Projects the code needs but never imports, such as an optional backend, go in
132
- `dependencies`. A dependency with no version or extras of its own is left out when another listed
133
- one already installs it on every platform, e.g. `numpy` and `marimo` next to
134
- `pyvista[marimo]`.
131
+ `dependencies`. In Python scripts and Jupyter notebooks, a dependency with no version or extras of
132
+ its own is left out when another listed one already installs it on every platform, e.g. `numpy`
133
+ next to `pyvista`. marimo notebooks list every dependency, since marimo's sandbox adds back any
134
+ it does not find by name.
135
135
 
136
136
  The project named by Sphinx's own `project` setting (e.g. `project = 'PyVista'`) gets
137
137
  extra treatment when an example imports it and it is installed: its dependency becomes
@@ -25,7 +25,6 @@ classifiers = [
25
25
  'Operating System :: Microsoft :: Windows',
26
26
  'Operating System :: POSIX :: Linux',
27
27
  'Programming Language :: Python :: 3',
28
- 'Programming Language :: Python :: 3.10',
29
28
  'Programming Language :: Python :: 3.11',
30
29
  'Programming Language :: Python :: 3.12',
31
30
  'Programming Language :: Python :: 3.13',
@@ -39,7 +38,7 @@ keywords = ['download', 'examples', 'sphinx']
39
38
  license = 'MIT'
40
39
  name = 'sphinx-examples-as-code'
41
40
  readme = 'README.md'
42
- requires-python = '>=3.10'
41
+ requires-python = '>=3.11'
43
42
 
44
43
  [project.optional-dependencies]
45
44
  gallery = ['sphinx-gallery>=0.22,<0.23']
@@ -1378,7 +1378,11 @@ def _build_download_entries(
1378
1378
  cap = _python_upper_bound(deps[fmt], project.name if project else None)
1379
1379
  return _python_range(floor, cap)
1380
1380
 
1381
- shown = {fmt: _drop_covered(fmt_deps) for fmt, fmt_deps in deps.items()}
1381
+ # marimo's sandbox adds back any import or marimo itself that its header does not name.
1382
+ shown = {
1383
+ fmt: fmt_deps if fmt == _FMT_MARIMO else _drop_covered(fmt_deps)
1384
+ for fmt, fmt_deps in deps.items()
1385
+ }
1382
1386
 
1383
1387
  def header_for(fmt: str, run_line: str) -> str:
1384
1388
  if not deps:
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.8.2'
22
- __version_tuple__ = version_tuple = (0, 8, 2)
21
+ __version__ = version = '0.8.3'
22
+ __version_tuple__ = version_tuple = (0, 8, 3)
23
23
 
24
- __commit_id__ = commit_id = 'g69288337b'
24
+ __commit_id__ = commit_id = 'g1289062e0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sphinx-examples-as-code
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: Sphinx extension for converting docstring examples into downloadable code.
5
5
  Author-email: The PyVista Developers <info@pyvista.org>
6
6
  License-Expression: MIT
@@ -13,13 +13,12 @@ Classifier: Operating System :: MacOS
13
13
  Classifier: Operating System :: Microsoft :: Windows
14
14
  Classifier: Operating System :: POSIX :: Linux
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
20
19
  Classifier: Programming Language :: Python :: 3.14
21
20
  Classifier: Topic :: Scientific/Engineering :: Visualization
22
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
23
22
  Description-Content-Type: text/markdown
24
23
  License-File: LICENSE
25
24
  Requires-Dist: packaging>=22
@@ -151,8 +150,7 @@ imports, plus any `dependencies` set for its format, and says how to run it:
151
150
  needed, so the command works in bash, zsh, PowerShell and cmd. An argument containing
152
151
  `"`, `$`, a backtick, `\`, `%` or a `!` not followed by `=` is single-quoted instead,
153
152
  which cmd does not understand.
154
- - marimo notebooks start with the same `# /// script` block, which also lists `marimo`
155
- unless another dependency installs it,
153
+ - marimo notebooks start with the same `# /// script` block, which also lists `marimo`,
156
154
  followed by `# Open this notebook with: uvx marimo edit --sandbox <name>_marimo.py`.
157
155
  - Each run command is followed by a line linking to
158
156
  [uv's installation guide](https://docs.astral.sh/uv/getting-started/installation/).
@@ -161,9 +159,10 @@ Imports are read from the code, not run. Each imported top-level module maps to
161
159
  project that provides it in the environment building the docs; standard-library
162
160
  modules, relative imports and modules no single installed project provides are left
163
161
  out. Projects the code needs but never imports, such as an optional backend, go in
164
- `dependencies`. A dependency with no version or extras of its own is left out when another listed
165
- one already installs it on every platform, e.g. `numpy` and `marimo` next to
166
- `pyvista[marimo]`.
162
+ `dependencies`. In Python scripts and Jupyter notebooks, a dependency with no version or extras of
163
+ its own is left out when another listed one already installs it on every platform, e.g. `numpy`
164
+ next to `pyvista`. marimo notebooks list every dependency, since marimo's sandbox adds back any
165
+ it does not find by name.
167
166
 
168
167
  The project named by Sphinx's own `project` setting (e.g. `project = 'PyVista'`) gets
169
168
  extra treatment when an example imports it and it is installed: its dependency becomes
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.8.3",
3
+ "distance": 0,
4
+ "node": "g1289062e019a00bf142aa7e7389f8839220c7b39",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-02"
8
+ }
@@ -3086,6 +3086,16 @@ def test_script_metadata_marimo(tmp_path: Path):
3086
3086
  assert source.index('mo.md(') < source.index('import marimo as mo')
3087
3087
 
3088
3088
 
3089
+ @pytest.mark.parametrize(('fmt', 'listed'), [('jupyter', False), ('marimo', True)])
3090
+ def test_script_metadata_drops_covered_except_marimo(
3091
+ tmp_path: Path, fake_requires, fmt: str, listed: bool
3092
+ ):
3093
+ fake_requires({'ipywidgets': ['numpy'], 'marimo': ['numpy']})
3094
+ _name, source = _write_with_metadata(tmp_path, [fmt])
3095
+ header = source.split('///', 2)[1] if fmt == 'marimo' else json.loads(source)['cells'][0]
3096
+ assert ('numpy' in str(header)) is listed
3097
+
3098
+
3089
3099
  @pytest.mark.parametrize(
3090
3100
  ('codes', 'expected'),
3091
3101
  [
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.8.2",
3
- "distance": 0,
4
- "node": "g69288337b5a4907e168725fbd4dbc5e1ea9450f8",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-11-01"
8
- }