huggingface-hub 0.36.0rc0__py3-none-any.whl → 1.0.0__py3-none-any.whl
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.
Potentially problematic release.
This version of huggingface-hub might be problematic. Click here for more details.
- huggingface_hub/__init__.py +33 -45
- huggingface_hub/_commit_api.py +39 -43
- huggingface_hub/_commit_scheduler.py +11 -8
- huggingface_hub/_inference_endpoints.py +8 -8
- huggingface_hub/_jobs_api.py +20 -20
- huggingface_hub/_login.py +17 -43
- huggingface_hub/_oauth.py +8 -8
- huggingface_hub/_snapshot_download.py +135 -50
- huggingface_hub/_space_api.py +4 -4
- huggingface_hub/_tensorboard_logger.py +5 -5
- huggingface_hub/_upload_large_folder.py +18 -32
- huggingface_hub/_webhooks_payload.py +3 -3
- huggingface_hub/_webhooks_server.py +2 -2
- huggingface_hub/cli/__init__.py +0 -14
- huggingface_hub/cli/_cli_utils.py +143 -39
- huggingface_hub/cli/auth.py +105 -171
- huggingface_hub/cli/cache.py +594 -361
- huggingface_hub/cli/download.py +120 -112
- huggingface_hub/cli/hf.py +38 -41
- huggingface_hub/cli/jobs.py +689 -1017
- huggingface_hub/cli/lfs.py +120 -143
- huggingface_hub/cli/repo.py +282 -216
- huggingface_hub/cli/repo_files.py +50 -84
- huggingface_hub/cli/system.py +6 -25
- huggingface_hub/cli/upload.py +198 -220
- huggingface_hub/cli/upload_large_folder.py +91 -106
- huggingface_hub/community.py +5 -5
- huggingface_hub/constants.py +17 -52
- huggingface_hub/dataclasses.py +135 -21
- huggingface_hub/errors.py +47 -30
- huggingface_hub/fastai_utils.py +8 -9
- huggingface_hub/file_download.py +351 -303
- huggingface_hub/hf_api.py +398 -570
- huggingface_hub/hf_file_system.py +101 -66
- huggingface_hub/hub_mixin.py +32 -54
- huggingface_hub/inference/_client.py +177 -162
- huggingface_hub/inference/_common.py +38 -54
- huggingface_hub/inference/_generated/_async_client.py +218 -258
- huggingface_hub/inference/_generated/types/automatic_speech_recognition.py +3 -3
- huggingface_hub/inference/_generated/types/base.py +10 -7
- huggingface_hub/inference/_generated/types/chat_completion.py +16 -16
- huggingface_hub/inference/_generated/types/depth_estimation.py +2 -2
- huggingface_hub/inference/_generated/types/document_question_answering.py +2 -2
- huggingface_hub/inference/_generated/types/feature_extraction.py +2 -2
- huggingface_hub/inference/_generated/types/fill_mask.py +2 -2
- huggingface_hub/inference/_generated/types/sentence_similarity.py +3 -3
- huggingface_hub/inference/_generated/types/summarization.py +2 -2
- huggingface_hub/inference/_generated/types/table_question_answering.py +4 -4
- huggingface_hub/inference/_generated/types/text2text_generation.py +2 -2
- huggingface_hub/inference/_generated/types/text_generation.py +10 -10
- huggingface_hub/inference/_generated/types/text_to_video.py +2 -2
- huggingface_hub/inference/_generated/types/token_classification.py +2 -2
- huggingface_hub/inference/_generated/types/translation.py +2 -2
- huggingface_hub/inference/_generated/types/zero_shot_classification.py +2 -2
- huggingface_hub/inference/_generated/types/zero_shot_image_classification.py +2 -2
- huggingface_hub/inference/_generated/types/zero_shot_object_detection.py +1 -3
- huggingface_hub/inference/_mcp/agent.py +3 -3
- huggingface_hub/inference/_mcp/constants.py +1 -2
- huggingface_hub/inference/_mcp/mcp_client.py +33 -22
- huggingface_hub/inference/_mcp/types.py +10 -10
- huggingface_hub/inference/_mcp/utils.py +4 -4
- huggingface_hub/inference/_providers/__init__.py +12 -4
- huggingface_hub/inference/_providers/_common.py +62 -24
- huggingface_hub/inference/_providers/black_forest_labs.py +6 -6
- huggingface_hub/inference/_providers/cohere.py +3 -3
- huggingface_hub/inference/_providers/fal_ai.py +25 -25
- huggingface_hub/inference/_providers/featherless_ai.py +4 -4
- huggingface_hub/inference/_providers/fireworks_ai.py +3 -3
- huggingface_hub/inference/_providers/hf_inference.py +13 -13
- huggingface_hub/inference/_providers/hyperbolic.py +4 -4
- huggingface_hub/inference/_providers/nebius.py +10 -10
- huggingface_hub/inference/_providers/novita.py +5 -5
- huggingface_hub/inference/_providers/nscale.py +4 -4
- huggingface_hub/inference/_providers/replicate.py +15 -15
- huggingface_hub/inference/_providers/sambanova.py +6 -6
- huggingface_hub/inference/_providers/together.py +7 -7
- huggingface_hub/lfs.py +21 -94
- huggingface_hub/repocard.py +15 -16
- huggingface_hub/repocard_data.py +57 -57
- huggingface_hub/serialization/__init__.py +0 -1
- huggingface_hub/serialization/_base.py +9 -9
- huggingface_hub/serialization/_dduf.py +7 -7
- huggingface_hub/serialization/_torch.py +28 -28
- huggingface_hub/utils/__init__.py +11 -6
- huggingface_hub/utils/_auth.py +5 -5
- huggingface_hub/utils/_cache_manager.py +49 -74
- huggingface_hub/utils/_deprecation.py +1 -1
- huggingface_hub/utils/_dotenv.py +3 -3
- huggingface_hub/utils/_fixes.py +0 -10
- huggingface_hub/utils/_git_credential.py +3 -3
- huggingface_hub/utils/_headers.py +7 -29
- huggingface_hub/utils/_http.py +371 -208
- huggingface_hub/utils/_pagination.py +4 -4
- huggingface_hub/utils/_parsing.py +98 -0
- huggingface_hub/utils/_paths.py +5 -5
- huggingface_hub/utils/_runtime.py +59 -23
- huggingface_hub/utils/_safetensors.py +21 -21
- huggingface_hub/utils/_subprocess.py +9 -9
- huggingface_hub/utils/_telemetry.py +3 -3
- huggingface_hub/{commands/_cli_utils.py → utils/_terminal.py} +4 -9
- huggingface_hub/utils/_typing.py +3 -3
- huggingface_hub/utils/_validators.py +53 -72
- huggingface_hub/utils/_xet.py +16 -16
- huggingface_hub/utils/_xet_progress_reporting.py +1 -1
- huggingface_hub/utils/insecure_hashlib.py +3 -9
- huggingface_hub/utils/tqdm.py +3 -3
- {huggingface_hub-0.36.0rc0.dist-info → huggingface_hub-1.0.0.dist-info}/METADATA +16 -35
- huggingface_hub-1.0.0.dist-info/RECORD +152 -0
- {huggingface_hub-0.36.0rc0.dist-info → huggingface_hub-1.0.0.dist-info}/entry_points.txt +0 -1
- huggingface_hub/commands/__init__.py +0 -27
- huggingface_hub/commands/delete_cache.py +0 -476
- huggingface_hub/commands/download.py +0 -204
- huggingface_hub/commands/env.py +0 -39
- huggingface_hub/commands/huggingface_cli.py +0 -65
- huggingface_hub/commands/lfs.py +0 -200
- huggingface_hub/commands/repo.py +0 -151
- huggingface_hub/commands/repo_files.py +0 -132
- huggingface_hub/commands/scan_cache.py +0 -183
- huggingface_hub/commands/tag.py +0 -161
- huggingface_hub/commands/upload.py +0 -318
- huggingface_hub/commands/upload_large_folder.py +0 -131
- huggingface_hub/commands/user.py +0 -208
- huggingface_hub/commands/version.py +0 -40
- huggingface_hub/inference_api.py +0 -217
- huggingface_hub/keras_mixin.py +0 -497
- huggingface_hub/repository.py +0 -1471
- huggingface_hub/serialization/_tensorflow.py +0 -92
- huggingface_hub/utils/_hf_folder.py +0 -68
- huggingface_hub-0.36.0rc0.dist-info/RECORD +0 -170
- {huggingface_hub-0.36.0rc0.dist-info → huggingface_hub-1.0.0.dist-info}/LICENSE +0 -0
- {huggingface_hub-0.36.0rc0.dist-info → huggingface_hub-1.0.0.dist-info}/WHEEL +0 -0
- {huggingface_hub-0.36.0rc0.dist-info → huggingface_hub-1.0.0.dist-info}/top_level.txt +0 -0
huggingface_hub/cli/download.py
CHANGED
|
@@ -37,145 +37,153 @@ Usage:
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
import warnings
|
|
40
|
-
from
|
|
41
|
-
|
|
40
|
+
from typing import Annotated, Optional, Union
|
|
41
|
+
|
|
42
|
+
import typer
|
|
42
43
|
|
|
43
44
|
from huggingface_hub import logging
|
|
44
45
|
from huggingface_hub._snapshot_download import snapshot_download
|
|
45
|
-
from huggingface_hub.
|
|
46
|
-
from huggingface_hub.
|
|
47
|
-
|
|
46
|
+
from huggingface_hub.file_download import DryRunFileInfo, hf_hub_download
|
|
47
|
+
from huggingface_hub.utils import _format_size, disable_progress_bars, enable_progress_bars, tabulate
|
|
48
|
+
|
|
49
|
+
from ._cli_utils import RepoIdArg, RepoTypeOpt, RevisionOpt, TokenOpt
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
logger = logging.get_logger(__name__)
|
|
51
53
|
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
help="
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
),
|
|
91
|
-
)
|
|
92
|
-
download_parser.add_argument(
|
|
93
|
-
"--force-download",
|
|
94
|
-
action="store_true",
|
|
55
|
+
def download(
|
|
56
|
+
repo_id: RepoIdArg,
|
|
57
|
+
filenames: Annotated[
|
|
58
|
+
Optional[list[str]],
|
|
59
|
+
typer.Argument(
|
|
60
|
+
help="Files to download (e.g. `config.json`, `data/metadata.jsonl`).",
|
|
61
|
+
),
|
|
62
|
+
] = None,
|
|
63
|
+
repo_type: RepoTypeOpt = RepoTypeOpt.model,
|
|
64
|
+
revision: RevisionOpt = None,
|
|
65
|
+
include: Annotated[
|
|
66
|
+
Optional[list[str]],
|
|
67
|
+
typer.Option(
|
|
68
|
+
help="Glob patterns to include from files to download. eg: *.json",
|
|
69
|
+
),
|
|
70
|
+
] = None,
|
|
71
|
+
exclude: Annotated[
|
|
72
|
+
Optional[list[str]],
|
|
73
|
+
typer.Option(
|
|
74
|
+
help="Glob patterns to exclude from files to download.",
|
|
75
|
+
),
|
|
76
|
+
] = None,
|
|
77
|
+
cache_dir: Annotated[
|
|
78
|
+
Optional[str],
|
|
79
|
+
typer.Option(
|
|
80
|
+
help="Directory where to save files.",
|
|
81
|
+
),
|
|
82
|
+
] = None,
|
|
83
|
+
local_dir: Annotated[
|
|
84
|
+
Optional[str],
|
|
85
|
+
typer.Option(
|
|
86
|
+
help="If set, the downloaded file will be placed under this directory. Check out https://huggingface.co/docs/huggingface_hub/guides/download#download-files-to-local-folder for more details.",
|
|
87
|
+
),
|
|
88
|
+
] = None,
|
|
89
|
+
force_download: Annotated[
|
|
90
|
+
bool,
|
|
91
|
+
typer.Option(
|
|
95
92
|
help="If True, the files will be downloaded even if they are already cached.",
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
|
|
93
|
+
),
|
|
94
|
+
] = False,
|
|
95
|
+
dry_run: Annotated[
|
|
96
|
+
bool,
|
|
97
|
+
typer.Option(
|
|
98
|
+
help="If True, perform a dry run without actually downloading the file.",
|
|
99
|
+
),
|
|
100
|
+
] = False,
|
|
101
|
+
token: TokenOpt = None,
|
|
102
|
+
quiet: Annotated[
|
|
103
|
+
bool,
|
|
104
|
+
typer.Option(
|
|
103
105
|
help="If True, progress bars are disabled and only the path to the download files is printed.",
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
),
|
|
107
|
+
] = False,
|
|
108
|
+
max_workers: Annotated[
|
|
109
|
+
int,
|
|
110
|
+
typer.Option(
|
|
109
111
|
help="Maximum number of workers to use for downloading files. Default is 8.",
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
self.token = args.token
|
|
115
|
-
self.repo_id: str = args.repo_id
|
|
116
|
-
self.filenames: List[str] = args.filenames
|
|
117
|
-
self.repo_type: str = args.repo_type
|
|
118
|
-
self.revision: Optional[str] = args.revision
|
|
119
|
-
self.include: Optional[List[str]] = args.include
|
|
120
|
-
self.exclude: Optional[List[str]] = args.exclude
|
|
121
|
-
self.cache_dir: Optional[str] = args.cache_dir
|
|
122
|
-
self.local_dir: Optional[str] = args.local_dir
|
|
123
|
-
self.force_download: bool = args.force_download
|
|
124
|
-
self.quiet: bool = args.quiet
|
|
125
|
-
self.max_workers: int = args.max_workers
|
|
126
|
-
|
|
127
|
-
def run(self) -> None:
|
|
128
|
-
if self.quiet:
|
|
129
|
-
disable_progress_bars()
|
|
130
|
-
with warnings.catch_warnings():
|
|
131
|
-
warnings.simplefilter("ignore")
|
|
132
|
-
print(self._download()) # Print path to downloaded files
|
|
133
|
-
enable_progress_bars()
|
|
134
|
-
else:
|
|
135
|
-
logging.set_verbosity_info()
|
|
136
|
-
print(self._download()) # Print path to downloaded files
|
|
137
|
-
logging.set_verbosity_warning()
|
|
112
|
+
),
|
|
113
|
+
] = 8,
|
|
114
|
+
) -> None:
|
|
115
|
+
"""Download files from the Hub."""
|
|
138
116
|
|
|
139
|
-
def
|
|
117
|
+
def run_download() -> Union[str, DryRunFileInfo, list[DryRunFileInfo]]:
|
|
118
|
+
filenames_list = filenames if filenames is not None else []
|
|
140
119
|
# Warn user if patterns are ignored
|
|
141
|
-
if len(
|
|
142
|
-
if
|
|
120
|
+
if len(filenames_list) > 0:
|
|
121
|
+
if include is not None and len(include) > 0:
|
|
143
122
|
warnings.warn("Ignoring `--include` since filenames have being explicitly set.")
|
|
144
|
-
if
|
|
123
|
+
if exclude is not None and len(exclude) > 0:
|
|
145
124
|
warnings.warn("Ignoring `--exclude` since filenames have being explicitly set.")
|
|
146
125
|
|
|
147
126
|
# Single file to download: use `hf_hub_download`
|
|
148
|
-
if len(
|
|
127
|
+
if len(filenames_list) == 1:
|
|
149
128
|
return hf_hub_download(
|
|
150
|
-
repo_id=
|
|
151
|
-
repo_type=
|
|
152
|
-
revision=
|
|
153
|
-
filename=
|
|
154
|
-
cache_dir=
|
|
155
|
-
force_download=
|
|
156
|
-
token=
|
|
157
|
-
local_dir=
|
|
129
|
+
repo_id=repo_id,
|
|
130
|
+
repo_type=repo_type.value,
|
|
131
|
+
revision=revision,
|
|
132
|
+
filename=filenames_list[0],
|
|
133
|
+
cache_dir=cache_dir,
|
|
134
|
+
force_download=force_download,
|
|
135
|
+
token=token,
|
|
136
|
+
local_dir=local_dir,
|
|
158
137
|
library_name="huggingface-cli",
|
|
138
|
+
dry_run=dry_run,
|
|
159
139
|
)
|
|
160
140
|
|
|
161
141
|
# Otherwise: use `snapshot_download` to ensure all files comes from same revision
|
|
162
|
-
|
|
163
|
-
allow_patterns =
|
|
164
|
-
ignore_patterns =
|
|
142
|
+
if len(filenames_list) == 0:
|
|
143
|
+
allow_patterns = include
|
|
144
|
+
ignore_patterns = exclude
|
|
165
145
|
else:
|
|
166
|
-
allow_patterns =
|
|
146
|
+
allow_patterns = filenames_list
|
|
167
147
|
ignore_patterns = None
|
|
168
148
|
|
|
169
149
|
return snapshot_download(
|
|
170
|
-
repo_id=
|
|
171
|
-
repo_type=
|
|
172
|
-
revision=
|
|
150
|
+
repo_id=repo_id,
|
|
151
|
+
repo_type=repo_type.value,
|
|
152
|
+
revision=revision,
|
|
173
153
|
allow_patterns=allow_patterns,
|
|
174
154
|
ignore_patterns=ignore_patterns,
|
|
175
|
-
force_download=
|
|
176
|
-
cache_dir=
|
|
177
|
-
token=
|
|
178
|
-
local_dir=
|
|
155
|
+
force_download=force_download,
|
|
156
|
+
cache_dir=cache_dir,
|
|
157
|
+
token=token,
|
|
158
|
+
local_dir=local_dir,
|
|
179
159
|
library_name="huggingface-cli",
|
|
180
|
-
max_workers=
|
|
160
|
+
max_workers=max_workers,
|
|
161
|
+
dry_run=dry_run,
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
def _print_result(result: Union[str, DryRunFileInfo, list[DryRunFileInfo]]) -> None:
|
|
165
|
+
if isinstance(result, str):
|
|
166
|
+
print(result)
|
|
167
|
+
return
|
|
168
|
+
|
|
169
|
+
# Print dry run info
|
|
170
|
+
if isinstance(result, DryRunFileInfo):
|
|
171
|
+
result = [result]
|
|
172
|
+
print(
|
|
173
|
+
f"[dry-run] Will download {len([r for r in result if r.will_download])} files (out of {len(result)}) totalling {_format_size(sum(r.file_size for r in result if r.will_download))}."
|
|
181
174
|
)
|
|
175
|
+
columns = ["File", "Bytes to download"]
|
|
176
|
+
items: list[list[Union[str, int]]] = []
|
|
177
|
+
for info in sorted(result, key=lambda x: x.filename):
|
|
178
|
+
items.append([info.filename, _format_size(info.file_size) if info.will_download else "-"])
|
|
179
|
+
print(tabulate(items, headers=columns))
|
|
180
|
+
|
|
181
|
+
if quiet:
|
|
182
|
+
disable_progress_bars()
|
|
183
|
+
with warnings.catch_warnings():
|
|
184
|
+
warnings.simplefilter("ignore")
|
|
185
|
+
_print_result(run_download())
|
|
186
|
+
enable_progress_bars()
|
|
187
|
+
else:
|
|
188
|
+
_print_result(run_download())
|
|
189
|
+
logging.set_verbosity_warning()
|
huggingface_hub/cli/hf.py
CHANGED
|
@@ -12,51 +12,48 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from argparse import ArgumentParser
|
|
16
15
|
|
|
17
|
-
from huggingface_hub.cli.
|
|
18
|
-
from huggingface_hub.cli.
|
|
19
|
-
from huggingface_hub.cli.
|
|
20
|
-
from huggingface_hub.cli.
|
|
21
|
-
from huggingface_hub.cli.
|
|
22
|
-
from huggingface_hub.cli.
|
|
23
|
-
from huggingface_hub.cli.
|
|
24
|
-
from huggingface_hub.cli.
|
|
25
|
-
from huggingface_hub.cli.
|
|
26
|
-
|
|
16
|
+
from huggingface_hub.cli._cli_utils import check_cli_update, typer_factory
|
|
17
|
+
from huggingface_hub.cli.auth import auth_cli
|
|
18
|
+
from huggingface_hub.cli.cache import cache_cli
|
|
19
|
+
from huggingface_hub.cli.download import download
|
|
20
|
+
from huggingface_hub.cli.jobs import jobs_cli
|
|
21
|
+
from huggingface_hub.cli.lfs import lfs_enable_largefiles, lfs_multipart_upload
|
|
22
|
+
from huggingface_hub.cli.repo import repo_cli
|
|
23
|
+
from huggingface_hub.cli.repo_files import repo_files_cli
|
|
24
|
+
from huggingface_hub.cli.system import env, version
|
|
25
|
+
|
|
26
|
+
# from huggingface_hub.cli.jobs import jobs_app
|
|
27
|
+
from huggingface_hub.cli.upload import upload
|
|
28
|
+
from huggingface_hub.cli.upload_large_folder import upload_large_folder
|
|
29
|
+
from huggingface_hub.utils import logging
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
app = typer_factory(help="Hugging Face Hub CLI")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# top level single commands (defined in their respective files)
|
|
36
|
+
app.command(help="Download files from the Hub.")(download)
|
|
37
|
+
app.command(help="Upload a file or a folder to the Hub.")(upload)
|
|
38
|
+
app.command(help="Upload a large folder to the Hub. Recommended for resumable uploads.")(upload_large_folder)
|
|
39
|
+
app.command(name="env", help="Print information about the environment.")(env)
|
|
40
|
+
app.command(help="Print information about the hf version.")(version)
|
|
41
|
+
app.command(help="Configure your repository to enable upload of files > 5GB.", hidden=True)(lfs_enable_largefiles)
|
|
42
|
+
app.command(help="Upload large files to the Hub.", hidden=True)(lfs_multipart_upload)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# command groups
|
|
46
|
+
app.add_typer(auth_cli, name="auth")
|
|
47
|
+
app.add_typer(cache_cli, name="cache")
|
|
48
|
+
app.add_typer(repo_cli, name="repo")
|
|
49
|
+
app.add_typer(repo_files_cli, name="repo-files")
|
|
50
|
+
app.add_typer(jobs_cli, name="jobs")
|
|
27
51
|
|
|
28
52
|
|
|
29
53
|
def main():
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# Register commands
|
|
34
|
-
AuthCommands.register_subcommand(commands_parser)
|
|
35
|
-
CacheCommand.register_subcommand(commands_parser)
|
|
36
|
-
DownloadCommand.register_subcommand(commands_parser)
|
|
37
|
-
JobsCommands.register_subcommand(commands_parser)
|
|
38
|
-
RepoCommands.register_subcommand(commands_parser)
|
|
39
|
-
RepoFilesCommand.register_subcommand(commands_parser)
|
|
40
|
-
UploadCommand.register_subcommand(commands_parser)
|
|
41
|
-
UploadLargeFolderCommand.register_subcommand(commands_parser)
|
|
42
|
-
|
|
43
|
-
# System commands
|
|
44
|
-
EnvironmentCommand.register_subcommand(commands_parser)
|
|
45
|
-
VersionCommand.register_subcommand(commands_parser)
|
|
46
|
-
|
|
47
|
-
# LFS commands (hidden in --help)
|
|
48
|
-
LfsCommands.register_subcommand(commands_parser)
|
|
49
|
-
|
|
50
|
-
# Let's go
|
|
51
|
-
args = parser.parse_args()
|
|
52
|
-
if not hasattr(args, "func"):
|
|
53
|
-
parser.print_help()
|
|
54
|
-
exit(1)
|
|
55
|
-
|
|
56
|
-
# Run
|
|
57
|
-
service = args.func(args)
|
|
58
|
-
if service is not None:
|
|
59
|
-
service.run()
|
|
54
|
+
logging.set_verbosity_info()
|
|
55
|
+
check_cli_update()
|
|
56
|
+
app()
|
|
60
57
|
|
|
61
58
|
|
|
62
59
|
if __name__ == "__main__":
|