FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vscode-python/noxfile.py at main · zzalscv2/vscode-python · GitHub
zzalscv2
/
vscode-python
Public
forked from
microsoft/vscode-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
vscode-python
/
noxfile.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
106 lines (90 loc) · 3.03 KB
Breadcrumbs
vscode-python
/
noxfile.py
Copy path
File metadata and controls
106 lines (90 loc) · 3.03 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import
os
import
pathlib
import
nox
import
shutil
import
sysconfig
EXT_ROOT
=
pathlib
.
Path
(
__file__
).
parent
@
nox
.
session
()
def
install_python_libs
(
session
:
nox
.
Session
):
requirements
=
[
(
"./python_files/lib/python"
,
"./requirements.txt"
),
(
"./python_files/lib/jedilsp"
,
"./python_files/jedilsp_requirements/requirements.txt"
,
),
]
for
target
,
file
in
requirements
:
session
.
install
(
"-t"
,
target
,
"--no-cache-dir"
,
"--implementation"
,
"py"
,
"--no-deps"
,
"--require-hashes"
,
"--only-binary"
,
":all:"
,
"-r"
,
file
,
)
session
.
install
(
"packaging"
)
# Download get-pip script
session
.
run
(
"python"
,
"./python_files/download_get_pip.py"
,
env
=
{
"PYTHONPATH"
:
"./python_files/lib/temp"
},
)
if
pathlib
.
Path
(
"./python_files/lib/temp"
).
exists
():
shutil
.
rmtree
(
"./python_files/lib/temp"
)
@
nox
.
session
()
def
native_build
(
session
:
nox
.
Session
):
with
session
.
cd
(
"./native_locator"
):
if
not
pathlib
.
Path
(
pathlib
.
Path
.
cwd
()
/
"bin"
).
exists
():
pathlib
.
Path
(
pathlib
.
Path
.
cwd
()
/
"bin"
).
mkdir
()
if
not
pathlib
.
Path
(
pathlib
.
Path
.
cwd
()
/
"bin"
/
".gitignore"
).
exists
():
pathlib
.
Path
(
pathlib
.
Path
.
cwd
()
/
"bin"
/
".gitignore"
).
write_text
(
"*
\n
"
,
encoding
=
"utf-8"
)
ext
=
sysconfig
.
get_config_var
(
"EXE"
)
or
""
target
=
os
.
environ
.
get
(
"CARGO_TARGET"
,
None
)
session
.
run
(
"cargo"
,
"fetch"
,
external
=
True
)
if
target
:
session
.
run
(
"cargo"
,
"build"
,
"--frozen"
,
"--release"
,
"--target"
,
target
,
"--package"
,
"python-finder"
,
external
=
True
,
)
source
=
f"./target/
{
target
}
/release/python-finder
{
ext
}
"
dest
=
f"./bin/python-finder
{
ext
}
"
shutil
.
copy
(
source
,
dest
)
else
:
session
.
run
(
"cargo"
,
"build"
,
"--frozen"
,
"--release"
,
"--package"
,
"python-finder"
,
external
=
True
,
)
source
=
f"./target/release/python-finder
{
ext
}
"
dest
=
f"./bin/python-finder
{
ext
}
"
shutil
.
copy
(
source
,
dest
)
# Remove native_locator/bin exclusion from .vscodeignore
vscode_ignore
=
EXT_ROOT
/
".vscodeignore"
remove_patterns
=
(
"native_locator/bin/**"
,)
lines
=
vscode_ignore
.
read_text
(
encoding
=
"utf-8"
).
splitlines
()
filtered_lines
=
[
line
for
line
in
lines
if
not
line
.
startswith
(
remove_patterns
)]
vscode_ignore
.
write_text
(
"
\n
"
.
join
(
filtered_lines
)
+
"
\n
"
,
encoding
=
"utf-8"
)
@
nox
.
session
()
def
setup_repo
(
session
:
nox
.
Session
):
install_python_libs
(
session
)
native_build
(
session
)
Back
|
FazBrowse Home
|
New Git URL