18 Commits

Author SHA1 Message Date
bobo.yang
ffeb632ec6 Fix regex match and decoding in install.py
- Changed the regex match to search for bytes instead of string.
- Added a condition to decode the pythonCmd only if no error occurred.
2023-08-10 08:31:11 +08:00
bobo.yang
fb29ea356c Added pathlib to handle file paths in install.py
- Imported pathlib module for handling file paths.
- Replaced the string replace method with pathlib's parent attribute to get the parent path of pythoncmd.
- Used os.path.join to construct the new pip_command_env path.
2023-08-09 19:49:02 +08:00
bobo.yang
7c3a0a4e7a Improved error handling in install.py
- Added import for 're' module for regular expressions.
- Changed return value from False to '' in get_pythoncmd_in_env function.
- Added a new function 'extract_actual_location' to extract the actual location from the text.
- Updated 'virtualenv_create_venv' function to handle errors more effectively and provide more detailed output.
2023-08-09 19:13:05 +08:00
bobo.yang
03f4e8344e fix python install error 2023-08-09 15:43:15 +08:00
bobo.yang
0a4826c66e Add function to get application data directory
- Added a new function `get_app_data_dir` in `install.py` to get the application data directory based on the operating system.
- This function checks if the directory exists, if not, it creates the directory.
- Updated the `venvdir` in the `main` function to use this new function, which will now point to the application data directory.
2023-08-09 08:15:49 +08:00
bobo.yang
e13e5685da Specify Python version in virtual environment creation
- Modified the virtual environment creation command to specify Python version as 3.11.4.
- This change affects the print statement and the subprocess.run command in the virtualenv_create_venv function.
2023-08-07 19:42:29 +08:00
bobo.yang
999edb5129 Change location of temporary file in pip_cmd_run function
- Imported tempfile module to create a temporary file.
- Replaced the creation of 'test.txt' in the current directory with a temporary file.
- The temporary file is automatically deleted when it is closed, eliminating the need for manual deletion.
2023-07-26 15:03:20 +08:00
bobo.yang
a3ccb0d45d Update pip command functions in install.py
- Changed the type hinting for the 'pipcmd' parameter in 'pip_cmd_run' and 'pip_cmd_with_retries' functions.
- The 'pipcmd' parameter now accepts any type, not just list of strings.
2023-07-26 11:25:40 +08:00
bobo.yang
3136283970 Update DevChat dependency check and configuration update
- Added version check for DevChat in checkDevChatDependency function.
- Updated configuration in both Global and Workspace scopes.
- Commented out the initial DevChat check in install.py and added --force flag to pip install command.
2023-07-19 16:06:45 +08:00
bobo.yang
116defdec7 Refactor install.py and statusBarViewBase.ts
- Added pip_cmd_run and pip_cmd_with_retries functions in install.py to handle pip command execution and retries.
- Simplified the installation of devchat and virtualenv in install.py using the new functions.
- Removed unnecessary checks in statusBarViewBase.ts.
2023-07-12 14:04:08 +08:00
bobo.yang
b4d21be26c update install 2023-07-12 09:02:00 +08:00
bobo.yang
7149ca0190 Modify DevChat installation command in install.py
- Changed the DevChat installation command to include the '--force' flag to ensure the installation proceeds even if DevChat is already installed.
2023-07-06 07:42:44 +08:00
bobo.yang
5de9d0f7ee update install for devchat 2023-07-06 07:42:44 +08:00
bobo.yang
8bc7f63c09 Add API key validation and pip installation check
- Added a check in commands.ts to validate the API key when setting it.
- If the API key is invalid, an error message is displayed to the user.
- Added a function in install.py to ensure pip is installed.
- This function attempts to install and upgrade pip using the ensurepip module.
- The function is called at the beginning of the main function in install.py.
2023-07-06 07:42:44 +08:00
bobo.yang
a947651d85 Update install.py to use sys.executable for pipx commands
- Replaced direct 'pipx' calls with 'sys.executable -m pipx' to ensure the same Python environment is used.
- Added a print statement to display the Python command being used.
2023-07-06 07:42:44 +08:00
bobo.yang
abba2c7df3 Add getValidPythonCommand function and improve dependency check
- Implement getValidPythonCommand in commandsBase.ts to detect Python 3.
- Update dependencyCheck in statusBarViewBase.ts to use getValidPythonCommand.
- Modify install.py to use sys.executable instead of hardcoded 'python3'.
2023-06-13 08:32:22 +08:00
bobo.yang
a9fa1c7abb Improve secretStorage usage and pipx installation
- Add await keyword to secretStorage.store call in extension.ts.
- Set statusBarItem.command to undefined instead of an empty string.
- Force pipx installation in install.py by adding --force flag.
2023-05-28 09:58:53 +08:00
bobo.yang
94413e6f1f install by pipx 2023-05-19 13:09:58 +08:00