Skip to content

Commit fa49115

Browse files
fix: detect virtualenvs on Windows
1 parent cdbe078 commit fa49115

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rsconnect/bundle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,13 @@ def create_glob_set(directory, excludes):
815815

816816

817817
def is_environment_dir(directory):
818+
"""Detect whether `directory` is a virtualenv"""
819+
820+
# A virtualenv will have Python at ./bin/python
818821
python_path = join(directory, "bin", "python")
819-
return exists(python_path)
822+
# But on Windows, it's at Scripts\Python.exe
823+
win_path = join(directory, "Scripts", "Python.exe")
824+
return exists(python_path) or exists(win_path)
820825

821826

822827
def list_environment_dirs(directory):

0 commit comments

Comments
 (0)