Skip to content

Commit 34d0126

Browse files
committed
add is_python_enabled_on_server
1 parent 94dbd28 commit 34d0126

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

rsconnect/bundle.py

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

10641064

1065+
def is_python_enabled_on_server(connect_details):
1066+
"""
1067+
Returns whether or not the Connect server has Python itself enabled.
1068+
1069+
:error: The Posit Connect server does not have Python enabled.
1070+
"""
1071+
return any(connect_details["python"]["versions"])
1072+
1073+
10651074
def are_apis_supported_on_server(connect_details):
10661075
"""
10671076
Returns whether or not the Connect server has Python itself enabled and its license allows

rsconnect/main.py

Lines changed: 2 additions & 0 deletions
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,
@@ -1202,6 +1203,7 @@ def deploy_app(
12021203
(
12031204
ce.validate_server()
12041205
.validate_app_mode(app_mode=app_mode)
1206+
.check_server_capabilities([is_python_enabled_on_server])
12051207
.check_server_capabilities([are_apis_supported_on_server])
12061208
.make_bundle(
12071209
make_api_bundle,

0 commit comments

Comments
 (0)