marimo-dev 0.4.3__tar.gz → 0.4.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: marimo-dev
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Build and publish python packages from marimo notebooks
5
5
  Author: Deufel
6
6
  Author-email: Deufel <MDeufel13@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "marimo-dev"
7
- version = "0.4.3"
7
+ version = "0.4.4"
8
8
  description = "Build and publish python packages from marimo notebooks"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -1,5 +1,5 @@
1
1
  """Build and publish python packages from marimo notebooks"""
2
- __version__ = '0.4.3'
2
+ __version__ = '0.4.4'
3
3
  __author__ = 'Deufel'
4
4
  from .types import rename, Config, Param, Return, Method, Import, Const, Setup, ExportKind, Export, ParsedFile, Module, Meta, Project
5
5
  from .parse import read_config, read_project
@@ -81,9 +81,12 @@ def _write_init(
81
81
  if all_exports:
82
82
  entries = '\n'.join(f' "{n}",' for n in sorted(all_exports))
83
83
  lines.append(f'__all__ = [\n{entries}\n]')
84
-
85
- if proj.init_extras:
86
- lines.append('\n'.join(s.src for s in proj.init_extras))
84
+
85
+ if proj.init_extras.consts:
86
+ lines.append('\n'.join(s.src for s in proj.init_extras.consts))
87
+
88
+ if proj.init_extras.setup:
89
+ lines.append('\n'.join(s.src for s in proj.init_extras.setup))
87
90
 
88
91
  _write(path, '\n'.join(lines))
89
92
 
@@ -232,10 +232,10 @@ def read_project(
232
232
  meta = _read_meta(root)
233
233
  nbs = Path(root) / cfg.nbs
234
234
 
235
- init_setup, modules = [], []
235
+ init_extras, modules = ParsedFile([], [], [], []), []
236
236
  for f in sorted(nbs.glob('*.py')):
237
237
  if f.name == cfg.init:
238
- init_setup = _parse_file(f, cfg).setup
238
+ init_extras = _parse_file(f, cfg)
239
239
  continue
240
240
  name = _module_name(f, cfg)
241
241
  if name is None: continue
@@ -249,4 +249,4 @@ def read_project(
249
249
  exports = parsed.exports,
250
250
  ))
251
251
 
252
- return Project(meta=meta, config=cfg, init_extras=init_setup, modules=modules)
252
+ return Project(meta=meta, config=cfg, init_extras=init_extras, modules=modules)
@@ -159,7 +159,7 @@ class Project:
159
159
  "A complete parsed marimo-dev project."
160
160
  meta: Meta
161
161
  config: Config
162
- init_extras: list[Setup] = field(default_factory=list)
162
+ init_extras: ParsedFile = field(default_factory=lambda: ParsedFile([], [], [], []))
163
163
  modules: list[Module] = field(default_factory=list)
164
164
 
165
165
  @property
File without changes