Skip to content

Commit 0c2708f

Browse files
authored
Merge pull request #358 from rstudio/bcwu-is-python-enabled
add is_python_enabled_on_server
2 parents c5e0d87 + 2609cac commit 0c2708f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

rsconnect/bundle.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,15 @@ def fake_module_file_from_directory(directory: str):
14321432
return join(directory, app_name + ".py")
14331433

14341434

1435+
def is_python_enabled_on_server(connect_details):
1436+
"""
1437+
Returns whether or not the Connect server has Python itself enabled.
1438+
1439+
:error: The Posit Connect server does not have Python enabled.
1440+
"""
1441+
return any(connect_details.get("python", {}).get("versions", []))
1442+
1443+
14351444
def are_apis_supported_on_server(connect_details):
14361445
"""
14371446
Returns whether or not the Connect server has Python itself enabled and its license allows

rsconnect/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from . import api, VERSION, validation
4141
from .api import RSConnectExecutor, RSConnectServer, RSConnectClient, filter_out_server_info
4242
from .bundle import (
43+
is_python_enabled_on_server,
4344
are_apis_supported_on_server,
4445
create_python_environment,
4546
default_title_from_manifest,
@@ -1306,7 +1307,7 @@ def deploy_app(
13061307
(
13071308
ce.validate_server()
13081309
.validate_app_mode(app_mode=app_mode)
1309-
.check_server_capabilities([are_apis_supported_on_server])
1310+
.check_server_capabilities([is_python_enabled_on_server, are_apis_supported_on_server])
13101311
.make_bundle(
13111312
make_api_bundle,
13121313
directory,

0 commit comments

Comments
 (0)