Skip to content

Commit 4dfe30e

Browse files
authored
Merge branch 'main' into hide-top-level-server-aliases
2 parents fcca923 + 933517d commit 4dfe30e

5 files changed

Lines changed: 40 additions & 4 deletions

File tree

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## [1.30.0] - 2026-07-16
11+
12+
- Fixed a bug where `rsconnect deploy notebook --static` failed with `Unable to
13+
include the file <version> in the bundle: No such file or directory`. The
14+
Python version string recorded for the manifest was passed to `nbconvert` as
15+
if it were the local interpreter path; the actual interpreter is now used.
1016
- Fixed a bug where `rsconnect deploy manifest manifest.json` (and other deploy
1117
commands given a bare filename) failed to detect git metadata. The directory
1218
passed to git detection was empty in that case, which caused detection to be

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = [{ name = "Posit, PBC", email = "rsconnect@posit.co" }]
66
license = { file = "LICENSE.md" }
77
readme = { file = "README.md", content-type = "text/markdown" }
88
requires-python = ">=3.8"
9-
version = "1.29.1.dev0"
9+
version = "1.30.1.dev1"
1010

1111
dependencies = [
1212
"typing-extensions>=4.8.0",

rsconnect/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,10 +1631,11 @@ def deploy_notebook(
16311631

16321632
ce.validate_server().validate_app_mode(app_mode=app_mode)
16331633
if app_mode == AppModes.STATIC:
1634+
assert environment.python_interpreter is not None
16341635
ce.make_bundle(
16351636
make_notebook_html_bundle,
16361637
file,
1637-
environment.python,
1638+
environment.python_interpreter,
16381639
hide_all_input,
16391640
hide_tagged_input,
16401641
)

tests/test_main.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import os
33
import re
44
import shutil
5+
import sys
56
from os.path import join
7+
from types import SimpleNamespace
68
from unittest import TestCase, mock
79

810
import click
@@ -13,7 +15,7 @@
1315
from rsconnect import VERSION
1416
from rsconnect.api import RSConnectClient, RSConnectServer
1517
from rsconnect.json_web_token import SECRET_KEY_ENV
16-
from rsconnect.main import cli, env_management_callback
18+
from rsconnect.main import cli, env_management_callback, make_notebook_html_bundle
1719

1820
from .utils import (
1921
apply_common_args,
@@ -303,6 +305,33 @@ def post_application_deploy_callback(request, uri, response_headers):
303305
if original_server_value:
304306
os.environ["CONNECT_SERVER"] = original_server_value
305307

308+
def test_deploy_notebook_static_passes_interpreter_not_version(self):
309+
# Regression test for #721: deploy_notebook must hand make_notebook_html_bundle
310+
# the local interpreter *path* (used to run nbconvert), not environment.python,
311+
# which is only a version string and made nbconvert fail with "No such file or
312+
# directory".
313+
fake_env = SimpleNamespace(python="3.12.1", python_interpreter=sys.executable)
314+
315+
with mock.patch("rsconnect.main.Environment.create_python_environment", return_value=fake_env), mock.patch(
316+
"rsconnect.main.RSConnectExecutor"
317+
) as MockExecutor:
318+
ce = MockExecutor.return_value
319+
320+
runner = CliRunner()
321+
args = apply_common_args(
322+
["deploy", "notebook", get_dir(join("pip1", "dummy.ipynb"))],
323+
server="http://fake_server",
324+
key="FAKE_API_KEY",
325+
)
326+
args += ["--static", "--no-verify"]
327+
result = runner.invoke(cli, args)
328+
329+
assert result.exit_code == 0, result.output
330+
# make_bundle(make_notebook_html_bundle, file, <python>, hide_all, hide_tagged)
331+
bundle_args = ce.make_bundle.call_args.args
332+
assert bundle_args[0] is make_notebook_html_bundle
333+
assert bundle_args[2] == sys.executable
334+
306335
@httpretty.activate(verbose=True, allow_net_connect=False)
307336
def test_deploy_verify_before_activate(self, caplog):
308337
# Without --draft or --no-verify, the default flow deploys the bundle as a

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)