Spaces:
Sleeping

dn commited on
Commit
6071728
·
1 Parent(s): 7bf563d

PYTHONPATH in build

Browse files
.github/scripts/build.py CHANGED
@@ -20,6 +20,7 @@ The exported files will be placed in the specified output directory (default: _s
20
  # ]
21
  # ///
22
 
 
23
  import subprocess
24
  from pathlib import Path
25
 
@@ -48,8 +49,7 @@ def _export_html_wasm(notebook_path: Path, output_dir: Path, as_app: bool = Fals
48
  output_path: Path = notebook_path.with_suffix(".html")
49
 
50
  # Base command for marimo export
51
- cmd: list[str] = ["uvx", "marimo", "export", "html-wasm", "--sandbox"]
52
-
53
  # Configure export mode based on whether it's an app or a notebook
54
  if as_app:
55
  logger.info(f"Exporting {notebook_path} to {output_path} as app")
@@ -68,7 +68,11 @@ def _export_html_wasm(notebook_path: Path, output_dir: Path, as_app: bool = Fals
68
 
69
  # Run marimo export command
70
  logger.debug(f"Running command: {cmd}")
71
- subprocess.run(cmd, capture_output=True, text=True, check=True)
 
 
 
 
72
  logger.info(f"Successfully exported {notebook_path}")
73
  return True
74
  except subprocess.CalledProcessError as e:
 
20
  # ]
21
  # ///
22
 
23
+ import os
24
  import subprocess
25
  from pathlib import Path
26
 
 
49
  output_path: Path = notebook_path.with_suffix(".html")
50
 
51
  # Base command for marimo export
52
+ cmd: list[str] = ["uv", "run", "marimo", "export", "html-wasm", "--sandbox"]
 
53
  # Configure export mode based on whether it's an app or a notebook
54
  if as_app:
55
  logger.info(f"Exporting {notebook_path} to {output_path} as app")
 
68
 
69
  # Run marimo export command
70
  logger.debug(f"Running command: {cmd}")
71
+ env = os.environ.copy()
72
+ env["PYTHONPATH"] = str(Path("src").resolve())
73
+
74
+ subprocess.run(cmd, capture_output=True, text=True, check=True, env=env)
75
+
76
  logger.info(f"Successfully exported {notebook_path}")
77
  return True
78
  except subprocess.CalledProcessError as e:
.github/workflows/deploy.yml CHANGED
@@ -34,8 +34,6 @@ jobs:
34
  # Install uv package manager for faster Python package installation
35
  - name: 🚀 Install uv
36
  uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
37
- - name: Install the project
38
- run: uv pip install -e .
39
  # Run the build script to export notebooks to WebAssembly
40
  - name: 🛠️ Export notebooks
41
  run: |
 
34
  # Install uv package manager for faster Python package installation
35
  - name: 🚀 Install uv
36
  uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
 
 
37
  # Run the build script to export notebooks to WebAssembly
38
  - name: 🛠️ Export notebooks
39
  run: |
pyproject.toml CHANGED
@@ -49,10 +49,3 @@ pythonpath = ["src"]
49
  [tool.pytest.ini_options]
50
  pythonpath = ["src"]
51
 
52
- [build-system]
53
- requires = ["setuptools>=61"]
54
- build-backend = "setuptools.build_meta"
55
-
56
- [tool.setuptools.packages.find]
57
- where = ["src"]
58
-
 
49
  [tool.pytest.ini_options]
50
  pythonpath = ["src"]
51