vscode-offline 0.1.8__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/PKG-INFO +1 -1
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/_version.py +2 -2
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/app.py +58 -57
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/utils.py +66 -44
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/.editorconfig +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/.github/workflows/build.yml +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/.gitignore +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/.python-version +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/.vscode/extensions.json +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/.vscode/settings.json +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/LICENSE +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/README.md +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/lefthook.yml +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/pyproject.toml +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/pyrightconfig.json +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/__init__.py +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/download.py +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/install.py +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/loggers.py +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/src/vscode_offline/py.typed +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/tests/test_install.py +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/tests/test_utils.py +0 -0
- {vscode_offline-0.1.8 → vscode_offline-0.1.9}/uv.lock +0 -0
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '0.1.
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
31
|
+
__version__ = version = '0.1.9'
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 9)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -16,6 +16,9 @@ from vscode_offline.install import (
|
|
16
16
|
install_vscode_server,
|
17
17
|
)
|
18
18
|
from vscode_offline.utils import (
|
19
|
+
CLIENT_PLATFORMS,
|
20
|
+
EXTENSION_PLATFORMS,
|
21
|
+
SERVER_PLATFORMS,
|
19
22
|
get_client_platform,
|
20
23
|
get_default_code_version,
|
21
24
|
get_extension_platform,
|
@@ -23,7 +26,6 @@ from vscode_offline.utils import (
|
|
23
26
|
get_server_platform,
|
24
27
|
get_vscode_extensions_config,
|
25
28
|
get_vscode_version_from_server_installer,
|
26
|
-
validate_platform,
|
27
29
|
)
|
28
30
|
|
29
31
|
|
@@ -153,29 +155,28 @@ def cmd_version(args: Namespace) -> None:
|
|
153
155
|
|
154
156
|
def make_argparser() -> ArgumentParser:
|
155
157
|
parent_parser = ArgumentParser(add_help=False)
|
156
|
-
|
157
158
|
parent_parser.add_argument(
|
158
159
|
"--installer",
|
159
160
|
type=Path,
|
160
161
|
default="./vscode-offline-installer",
|
161
|
-
help="The output directory for downloaded files
|
162
|
+
help="The output directory for downloaded files, also used as the installer directory.",
|
162
163
|
)
|
163
164
|
|
164
|
-
|
165
|
-
subparsers =
|
165
|
+
main_parser = ArgumentParser(description="VS Code downloader and installer")
|
166
|
+
subparsers = main_parser.add_subparsers(required=True)
|
166
167
|
|
167
168
|
version_parser = subparsers.add_parser(
|
168
169
|
"version",
|
169
170
|
help="Show version information",
|
170
171
|
)
|
171
|
-
version_parser.set_defaults(
|
172
|
+
version_parser.set_defaults(command=cmd_version)
|
172
173
|
|
173
174
|
download_server_parser = subparsers.add_parser(
|
174
175
|
"download-server",
|
175
|
-
help="Download VS Code Server and extensions",
|
176
|
+
help="Download VS Code Server and its extensions",
|
176
177
|
parents=[parent_parser],
|
177
178
|
)
|
178
|
-
download_server_parser.set_defaults(
|
179
|
+
download_server_parser.set_defaults(command=cmd_download_server)
|
179
180
|
download_server_parser.add_argument(
|
180
181
|
"--code-version",
|
181
182
|
type=str,
|
@@ -183,7 +184,7 @@ def make_argparser() -> ArgumentParser:
|
|
183
184
|
)
|
184
185
|
download_server_parser.add_argument(
|
185
186
|
"--platform",
|
186
|
-
|
187
|
+
choices=SERVER_PLATFORMS,
|
187
188
|
required=True,
|
188
189
|
help="The target platform of the VS Code Server to download.",
|
189
190
|
)
|
@@ -194,68 +195,43 @@ def make_argparser() -> ArgumentParser:
|
|
194
195
|
help="Path to the extensions configuration file. Will search for extensions to download.",
|
195
196
|
)
|
196
197
|
|
197
|
-
|
198
|
-
"
|
199
|
-
help="
|
198
|
+
download_client_parser = subparsers.add_parser(
|
199
|
+
"download-client",
|
200
|
+
help="Download VS Code client and its extensions",
|
200
201
|
parents=[parent_parser],
|
201
202
|
)
|
202
|
-
|
203
|
-
|
203
|
+
download_client_parser.set_defaults(command=cmd_download_client)
|
204
|
+
download_client_parser.add_argument(
|
204
205
|
"--code-version",
|
205
206
|
type=str,
|
206
|
-
help="The version of the VS Code
|
207
|
-
)
|
208
|
-
|
209
|
-
download_extensions_parser = subparsers.add_parser(
|
210
|
-
"download-extensions",
|
211
|
-
help="Download VS Code Server and extensions",
|
212
|
-
parents=[parent_parser],
|
207
|
+
help="The version of the VS Code to download, must match the version of the VS Code Client.",
|
213
208
|
)
|
214
|
-
|
215
|
-
download_extensions_parser.add_argument(
|
209
|
+
download_client_parser.add_argument(
|
216
210
|
"--platform",
|
217
|
-
|
211
|
+
choices=CLIENT_PLATFORMS,
|
218
212
|
required=True,
|
219
|
-
help="The target platform of the VS Code
|
213
|
+
help="The target platform of the VS Code client to download.",
|
220
214
|
)
|
221
|
-
|
215
|
+
download_client_parser.add_argument(
|
222
216
|
"--extensions-config",
|
223
217
|
type=Path,
|
224
218
|
default=get_vscode_extensions_config(),
|
225
219
|
help="Path to the extensions configuration file. Will search for extensions to download.",
|
226
220
|
)
|
227
221
|
|
228
|
-
|
229
|
-
"
|
230
|
-
help="
|
231
|
-
parents=[parent_parser],
|
232
|
-
)
|
233
|
-
install_extensions_parser.set_defaults(func=cmd_install_extensions)
|
234
|
-
install_extensions_parser.add_argument(
|
235
|
-
"--code",
|
236
|
-
type=str,
|
237
|
-
default="code",
|
238
|
-
help="Path to the `code` binary.",
|
239
|
-
)
|
240
|
-
|
241
|
-
download_client_parser = subparsers.add_parser(
|
242
|
-
"download-client",
|
243
|
-
help="Download VS Code and extensions",
|
222
|
+
download_extensions_parser = subparsers.add_parser(
|
223
|
+
"download-extensions",
|
224
|
+
help="Download VS Code extensions only",
|
244
225
|
parents=[parent_parser],
|
245
226
|
)
|
246
|
-
|
247
|
-
|
248
|
-
"--code-version",
|
249
|
-
type=str,
|
250
|
-
help="The version of the VS Code to download, must match the version of the VS Code Client.",
|
251
|
-
)
|
252
|
-
download_client_parser.add_argument(
|
227
|
+
download_extensions_parser.set_defaults(command=cmd_download_extensions)
|
228
|
+
download_extensions_parser.add_argument(
|
253
229
|
"--platform",
|
254
|
-
|
230
|
+
choices=EXTENSION_PLATFORMS,
|
255
231
|
required=True,
|
256
|
-
help="The target platform of the VS Code to download.",
|
232
|
+
help="The target platform of the VS Code extensions to download.",
|
257
233
|
)
|
258
|
-
|
234
|
+
download_extensions_parser.add_argument(
|
259
235
|
"--extensions-config",
|
260
236
|
type=Path,
|
261
237
|
default=get_vscode_extensions_config(),
|
@@ -264,10 +240,10 @@ def make_argparser() -> ArgumentParser:
|
|
264
240
|
|
265
241
|
download_all_parser = subparsers.add_parser(
|
266
242
|
"download-all",
|
267
|
-
help="Download VS Code
|
243
|
+
help="Download VS Code Server, Client and its extensions, all in one command",
|
268
244
|
parents=[parent_parser],
|
269
245
|
)
|
270
|
-
download_all_parser.set_defaults(
|
246
|
+
download_all_parser.set_defaults(command=cmd_download_all)
|
271
247
|
download_all_parser.add_argument(
|
272
248
|
"--code-version",
|
273
249
|
type=str,
|
@@ -275,13 +251,13 @@ def make_argparser() -> ArgumentParser:
|
|
275
251
|
)
|
276
252
|
download_all_parser.add_argument(
|
277
253
|
"--server-platform",
|
278
|
-
|
254
|
+
choices=SERVER_PLATFORMS,
|
279
255
|
required=True,
|
280
256
|
help="The target platform of the VS Code Server to download, defaults to linux-x64.",
|
281
257
|
)
|
282
258
|
download_all_parser.add_argument(
|
283
259
|
"--client-platform",
|
284
|
-
|
260
|
+
choices=CLIENT_PLATFORMS,
|
285
261
|
required=True,
|
286
262
|
help="The target platform of the VS Code to download, defaults to win32-x64.",
|
287
263
|
)
|
@@ -292,7 +268,32 @@ def make_argparser() -> ArgumentParser:
|
|
292
268
|
help="Path to the extensions configuration file. Will search for extensions to download.",
|
293
269
|
)
|
294
270
|
|
295
|
-
|
271
|
+
install_server_parser = subparsers.add_parser(
|
272
|
+
"install-server",
|
273
|
+
help="Install VS Code Server and its extensions",
|
274
|
+
parents=[parent_parser],
|
275
|
+
)
|
276
|
+
install_server_parser.set_defaults(command=cmd_install_server)
|
277
|
+
install_server_parser.add_argument(
|
278
|
+
"--code-version",
|
279
|
+
type=str,
|
280
|
+
help="The version of the VS Code Server to install.",
|
281
|
+
)
|
282
|
+
|
283
|
+
install_extensions_parser = subparsers.add_parser(
|
284
|
+
"install-extensions",
|
285
|
+
help="Install VS Code extensions only",
|
286
|
+
parents=[parent_parser],
|
287
|
+
)
|
288
|
+
install_extensions_parser.set_defaults(command=cmd_install_extensions)
|
289
|
+
install_extensions_parser.add_argument(
|
290
|
+
"--code",
|
291
|
+
type=str,
|
292
|
+
default="code",
|
293
|
+
help="Path to the `code` binary.",
|
294
|
+
)
|
295
|
+
|
296
|
+
return main_parser
|
296
297
|
|
297
298
|
|
298
299
|
def main() -> None:
|
@@ -4,12 +4,11 @@ import os
|
|
4
4
|
import shutil
|
5
5
|
import subprocess
|
6
6
|
import sys
|
7
|
-
from argparse import ArgumentTypeError
|
8
7
|
from collections.abc import Mapping
|
9
8
|
from collections.abc import Set as AbstractSet
|
10
9
|
from email.parser import HeaderParser
|
11
10
|
from pathlib import Path
|
12
|
-
from typing import Final
|
11
|
+
from typing import Collection, Final
|
13
12
|
|
14
13
|
from vscode_offline.loggers import logger
|
15
14
|
|
@@ -84,11 +83,9 @@ def get_default_code_version() -> str | None:
|
|
84
83
|
# Mapping from other platforms to VS Code client platform used in download URLs
|
85
84
|
_client_platform_mapping: Final[Mapping[str, str]] = {
|
86
85
|
"linux-x64": "linux-x64",
|
87
|
-
"alpine-x64": "linux-x64",
|
88
86
|
"linux-deb-x64": "linux-deb-x64",
|
89
87
|
"linux-rpm-x64": "linux-rpm-x64",
|
90
88
|
"linux-arm64": "linux-arm64",
|
91
|
-
"alpine-arm64": "linux-arm64",
|
92
89
|
"linux-deb-arm64": "linux-deb-arm64",
|
93
90
|
"linux-rpm-arm64": "linux-rpm-arm64",
|
94
91
|
"linux-armhf": "linux-armhf",
|
@@ -100,19 +97,17 @@ _client_platform_mapping: Final[Mapping[str, str]] = {
|
|
100
97
|
"win32-arm64": "win32-arm64",
|
101
98
|
"win32-arm64-user": "win32-arm64-user",
|
102
99
|
"win32-arm64-archive": "win32-arm64-archive",
|
103
|
-
"darwin": "darwin",
|
104
100
|
"darwin-x64": "darwin",
|
105
101
|
"darwin-arm64": "darwin-arm64",
|
106
102
|
}
|
107
103
|
|
108
|
-
|
104
|
+
|
105
|
+
# Mapping from other platforms to VS Code Server platform used in download URLs
|
109
106
|
_server_platform_mapping: Final[Mapping[str, str]] = {
|
110
107
|
"linux-x64": "linux-x64",
|
111
|
-
"alpine-x64": "linux-x64",
|
112
108
|
"linux-deb-x64": "linux-x64",
|
113
109
|
"linux-rpm-x64": "linux-x64",
|
114
110
|
"linux-arm64": "linux-arm64",
|
115
|
-
"alpine-arm64": "linux-arm64",
|
116
111
|
"linux-deb-arm64": "linux-arm64",
|
117
112
|
"linux-rpm-arm64": "linux-arm64",
|
118
113
|
"linux-armhf": "linux-armhf",
|
@@ -124,7 +119,6 @@ _server_platform_mapping: Final[Mapping[str, str]] = {
|
|
124
119
|
"win32-arm64": "win32-arm64",
|
125
120
|
"win32-arm64-user": "win32-arm64",
|
126
121
|
"win32-arm64-archive": "win32-arm64",
|
127
|
-
"darwin": "darwin",
|
128
122
|
"darwin-x64": "darwin",
|
129
123
|
"darwin-arm64": "darwin-arm64",
|
130
124
|
}
|
@@ -133,11 +127,9 @@ _server_platform_mapping: Final[Mapping[str, str]] = {
|
|
133
127
|
# Mapping from other platforms to VS Code CLI platform used in download URLs
|
134
128
|
_cli_platform_mapping: Final[Mapping[str, str]] = {
|
135
129
|
"linux-x64": "alpine-x64",
|
136
|
-
"alpine-x64": "alpine-x64",
|
137
130
|
"linux-deb-x64": "alpine-x64",
|
138
131
|
"linux-rpm-x64": "alpine-x64",
|
139
132
|
"linux-arm64": "alpine-arm64",
|
140
|
-
"alpine-arm64": "alpine-arm64",
|
141
133
|
"linux-deb-arm64": "alpine-arm64",
|
142
134
|
"linux-rpm-arm64": "alpine-arm64",
|
143
135
|
"linux-armhf": "linux-armhf",
|
@@ -149,7 +141,6 @@ _cli_platform_mapping: Final[Mapping[str, str]] = {
|
|
149
141
|
"win32-arm64": "win32-arm64",
|
150
142
|
"win32-arm64-user": "win32-arm64",
|
151
143
|
"win32-arm64-archive": "win32-arm64",
|
152
|
-
"darwin": "darwin-x64",
|
153
144
|
"darwin-x64": "darwin-x64",
|
154
145
|
"darwin-arm64": "darwin-arm64",
|
155
146
|
}
|
@@ -158,11 +149,9 @@ _cli_platform_mapping: Final[Mapping[str, str]] = {
|
|
158
149
|
# Mapping from other platforms to extension target platform used in download URLs
|
159
150
|
_extension_platform_mapping: Final[Mapping[str, str]] = {
|
160
151
|
"linux-x64": "linux-x64",
|
161
|
-
"alpine-x64": "linux-x64",
|
162
152
|
"linux-deb-x64": "linux-x64",
|
163
153
|
"linux-rpm-x64": "linux-x64",
|
164
154
|
"linux-arm64": "linux-arm64",
|
165
|
-
"alpine-arm64": "linux-arm64",
|
166
155
|
"linux-deb-arm64": "linux-arm64",
|
167
156
|
"linux-rpm-arm64": "linux-arm64",
|
168
157
|
"linux-armhf": "linux-armhf",
|
@@ -174,44 +163,64 @@ _extension_platform_mapping: Final[Mapping[str, str]] = {
|
|
174
163
|
"win32-arm64": "win32-arm64",
|
175
164
|
"win32-arm64-user": "win32-arm64",
|
176
165
|
"win32-arm64-archive": "win32-arm64",
|
177
|
-
"darwin": "darwin-x64",
|
178
166
|
"darwin-x64": "darwin-x64",
|
179
167
|
"darwin-arm64": "darwin-arm64",
|
180
168
|
}
|
181
169
|
|
170
|
+
CLIENT_PLATFORMS: Final[Collection[str]] = {
|
171
|
+
"linux-x64": None,
|
172
|
+
"linux-deb-x64": None,
|
173
|
+
"linux-rpm-x64": None,
|
174
|
+
"linux-arm64": None,
|
175
|
+
"linux-deb-arm64": None,
|
176
|
+
"linux-rpm-arm64": None,
|
177
|
+
"linux-armhf": None,
|
178
|
+
"linux-deb-armhf": None,
|
179
|
+
"linux-rpm-armhf": None,
|
180
|
+
"win32-x64": None,
|
181
|
+
"win32-x64-user": None,
|
182
|
+
"win32-x64-archive": None,
|
183
|
+
"win32-arm64": None,
|
184
|
+
"win32-arm64-user": None,
|
185
|
+
"win32-arm64-archive": None,
|
186
|
+
"darwin-x64": None,
|
187
|
+
"darwin-arm64": None,
|
188
|
+
}
|
182
189
|
|
183
|
-
def get_client_platform(platform: str) -> str:
|
184
|
-
"""Get the VS Code platform for the given platform."""
|
185
|
-
return _client_platform_mapping.get(platform, platform)
|
186
|
-
|
187
|
-
|
188
|
-
def get_server_platform(platform: str) -> str:
|
189
|
-
"""Get the VS Code server platform for the given platform."""
|
190
|
-
return _server_platform_mapping.get(platform, platform)
|
191
|
-
|
192
|
-
|
193
|
-
def get_cli_platform(platform: str) -> str:
|
194
|
-
"""Get the VS Code CLI platform for the given platform."""
|
195
|
-
return _cli_platform_mapping.get(platform, platform)
|
196
190
|
|
191
|
+
SERVER_PLATFORMS: Final[Collection[str]] = {
|
192
|
+
"linux-x64": None,
|
193
|
+
"linux-arm64": None,
|
194
|
+
"linux-armhf": None,
|
195
|
+
"win32-x64": None,
|
196
|
+
"win32-arm64": None,
|
197
|
+
"darwin-x64": None,
|
198
|
+
"darwin-arm64": None,
|
199
|
+
}
|
197
200
|
|
198
|
-
def get_extension_platform(platform: str) -> str:
|
199
|
-
"""Get the VS Code extension target platform for the given platform."""
|
200
|
-
return _extension_platform_mapping.get(platform, platform)
|
201
201
|
|
202
|
+
EXTENSION_PLATFORMS: Final[Collection[str]] = {
|
203
|
+
"linux-x64": None,
|
204
|
+
"linux-arm64": None,
|
205
|
+
"linux-armhf": None,
|
206
|
+
"win32-x64": None,
|
207
|
+
"win32-arm64": None,
|
208
|
+
"darwin-x64": None,
|
209
|
+
"darwin-arm64": None,
|
210
|
+
}
|
202
211
|
|
203
212
|
_all_platforms: Final[AbstractSet[str]] = {
|
204
|
-
*
|
205
|
-
*
|
206
|
-
*
|
207
|
-
*_server_platform_mapping.values(),
|
208
|
-
*_cli_platform_mapping.keys(),
|
209
|
-
*_cli_platform_mapping.values(),
|
210
|
-
*_extension_platform_mapping.keys(),
|
211
|
-
*_extension_platform_mapping.values(),
|
213
|
+
*CLIENT_PLATFORMS,
|
214
|
+
*SERVER_PLATFORMS,
|
215
|
+
*EXTENSION_PLATFORMS,
|
212
216
|
}
|
213
217
|
|
214
218
|
|
219
|
+
assert set(SERVER_PLATFORMS).issubset(CLIENT_PLATFORMS)
|
220
|
+
assert set(EXTENSION_PLATFORMS).issubset(CLIENT_PLATFORMS)
|
221
|
+
assert SERVER_PLATFORMS == EXTENSION_PLATFORMS
|
222
|
+
|
223
|
+
|
215
224
|
assert (
|
216
225
|
_client_platform_mapping.keys()
|
217
226
|
== _server_platform_mapping.keys()
|
@@ -221,11 +230,24 @@ assert (
|
|
221
230
|
)
|
222
231
|
|
223
232
|
|
224
|
-
def
|
225
|
-
"""
|
226
|
-
|
227
|
-
|
228
|
-
|
233
|
+
def get_client_platform(platform: str) -> str:
|
234
|
+
"""Get the VS Code platform for the given platform."""
|
235
|
+
return _client_platform_mapping.get(platform, platform)
|
236
|
+
|
237
|
+
|
238
|
+
def get_server_platform(platform: str) -> str:
|
239
|
+
"""Get the VS Code Server platform for the given platform."""
|
240
|
+
return _server_platform_mapping.get(platform, platform)
|
241
|
+
|
242
|
+
|
243
|
+
def get_cli_platform(platform: str) -> str:
|
244
|
+
"""Get the VS Code CLI platform for the given platform."""
|
245
|
+
return _cli_platform_mapping.get(platform, platform)
|
246
|
+
|
247
|
+
|
248
|
+
def get_extension_platform(platform: str) -> str:
|
249
|
+
"""Get the VS Code extension target platform for the given platform."""
|
250
|
+
return _extension_platform_mapping.get(platform, platform)
|
229
251
|
|
230
252
|
|
231
253
|
def get_host_platform() -> str:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|