дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
feat(python): install packages from version control or a local directory (#6601)
A + button in the Python Packages tool window offers Install from Version Control… and Install from Disk… (with Browse), both with Install as editable (-e). A plain https://, ssh://, git:// or git@host:path URL gets pip's git+ form; git+… and other vcs+ URLs pass as they are. sdk_python_pip takes an editable flag that adds -e (pip and uv pip); text starting with - is still refused, so no other pip option can be passed. Closes #6531 Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
1 джерело
3747a8a63f
коміт
ddea7e5ec5
15 files changed
+237
-14
No files matched your search
@@ -56,3 +56,14 @@ export function listRows(
|
||||
|
||||
/** `name==version`, or the bare name for the newest release. */
|
||||
export const requirementOf = (name: string, version: string | null) => (version ? `${name}==${version}` : name);
|
||||
|
||||
/**
|
||||
* What pip installs for a repository URL: `git+https://…` and other `vcs+` forms as they are, a
|
||||
* plain `https://`, `ssh://` or `git://` URL and scp-like `git@host:path` as Git.
|
||||
*/
|
||||
export function vcsRequirement(url: string) {
|
||||
const text = url.trim();
|
||||
if (/^(https?|ssh|git):\/\//i.test(text)) return `git+${text}`;
|
||||
const scp = /^([\w.-]+@[\w.-]+):(?!\/\/)(.+)$/.exec(text);
|
||||
return scp ? `git+ssh://${scp[1]}/${scp[2]}` : text;
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача