codecov-cli 0.7.6__tar.gz → 0.9.4__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.
Files changed (101) hide show
  1. {codecov-cli-0.7.6/codecov_cli.egg-info → codecov-cli-0.9.4}/PKG-INFO +10 -9
  2. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/README.md +9 -8
  3. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/upload.py +30 -0
  4. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/upload_process.py +43 -33
  5. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/config.py +1 -0
  6. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/request.py +9 -3
  7. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/plugins/__init__.py +20 -6
  8. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/plugins/gcov.py +13 -11
  9. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/plugins/xcode.py +5 -4
  10. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/commit/__init__.py +6 -6
  11. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/commit/base_picking.py +2 -2
  12. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/empty_upload/__init__.py +2 -2
  13. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/report/__init__.py +11 -10
  14. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload/__init__.py +23 -3
  15. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload/upload_collector.py +2 -0
  16. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload/upload_sender.py +3 -3
  17. {codecov-cli-0.7.6 → codecov-cli-0.9.4/codecov_cli.egg-info}/PKG-INFO +10 -9
  18. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/setup.py +1 -1
  19. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/LICENSE +0 -0
  20. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/MANIFEST.in +0 -0
  21. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/__init__.py +0 -0
  22. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/__init__.py +0 -0
  23. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/base_picking.py +0 -0
  24. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/commit.py +0 -0
  25. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/create_report_result.py +0 -0
  26. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/empty_upload.py +0 -0
  27. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/get_report_results.py +0 -0
  28. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/labelanalysis.py +0 -0
  29. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/process_test_results.py +0 -0
  30. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/report.py +0 -0
  31. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/send_notifications.py +0 -0
  32. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/commands/staticanalysis.py +0 -0
  33. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/fallbacks.py +0 -0
  34. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/__init__.py +0 -0
  35. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/args.py +0 -0
  36. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/__init__.py +0 -0
  37. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/appveyor_ci.py +0 -0
  38. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/azure_pipelines.py +0 -0
  39. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/base.py +0 -0
  40. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/bitbucket_ci.py +0 -0
  41. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/bitrise_ci.py +0 -0
  42. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/buildkite.py +0 -0
  43. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/circleci.py +0 -0
  44. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/cirrus_ci.py +0 -0
  45. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/cloudbuild.py +0 -0
  46. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/codebuild.py +0 -0
  47. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/droneci.py +0 -0
  48. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/github_actions.py +0 -0
  49. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/gitlab_ci.py +0 -0
  50. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/heroku.py +0 -0
  51. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/jenkins.py +0 -0
  52. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/local.py +0 -0
  53. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/teamcity.py +0 -0
  54. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/travis_ci.py +0 -0
  55. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/ci_adapters/woodpeckerci.py +0 -0
  56. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/encoder.py +0 -0
  57. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/folder_searcher.py +0 -0
  58. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/git.py +0 -0
  59. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/git_services/__init__.py +0 -0
  60. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/git_services/github.py +0 -0
  61. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/logging_utils.py +0 -0
  62. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/options.py +0 -0
  63. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/validators.py +0 -0
  64. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/helpers/versioning_systems.py +0 -0
  65. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/main.py +0 -0
  66. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/plugins/compress_pycoverage_contexts.py +0 -0
  67. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/plugins/pycoverage.py +0 -0
  68. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/plugins/types.py +0 -0
  69. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/runners/__init__.py +0 -0
  70. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/runners/dan_runner.py +0 -0
  71. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/runners/pytest_standard_runner.py +0 -0
  72. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/runners/types.py +0 -0
  73. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/__init__.py +0 -0
  74. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/__init__.py +0 -0
  75. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/analyzers/__init__.py +0 -0
  76. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/analyzers/general.py +0 -0
  77. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/analyzers/javascript_es6/__init__.py +0 -0
  78. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/analyzers/javascript_es6/node_wrappers.py +0 -0
  79. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/analyzers/python/__init__.py +0 -0
  80. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py +0 -0
  81. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/exceptions.py +0 -0
  82. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/finders.py +0 -0
  83. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/staticanalysis/types.py +0 -0
  84. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload/file_finder.py +0 -0
  85. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload/legacy_upload_sender.py +0 -0
  86. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload/network_finder.py +0 -0
  87. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/services/upload_completion/__init__.py +0 -0
  88. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli/types.py +0 -0
  89. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli.egg-info/SOURCES.txt +0 -0
  90. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli.egg-info/dependency_links.txt +0 -0
  91. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli.egg-info/entry_points.txt +0 -0
  92. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli.egg-info/requires.txt +0 -0
  93. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/codecov_cli.egg-info/top_level.txt +0 -0
  94. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/languages.c +0 -0
  95. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/treesitterjavascript/src/parser.c +0 -0
  96. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/treesitterjavascript/src/scanner.c +0 -0
  97. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/treesitterjavascript/src/tree_sitter/parser.h +0 -0
  98. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/treesitterpython/src/parser.c +0 -0
  99. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/treesitterpython/src/scanner.cc +0 -0
  100. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/languages/treesitterpython/src/tree_sitter/parser.h +0 -0
  101. {codecov-cli-0.7.6 → codecov-cli-0.9.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codecov-cli
3
- Version: 0.7.6
3
+ Version: 0.9.4
4
4
  Summary: Codecov Command Line Interface
5
5
  Author: Codecov
6
6
  Author-email: support@codecov.io
@@ -250,14 +250,15 @@ are ignored by codecov (including README and configuration files)
250
250
 
251
251
  `Usage: codecovcli empty-upload [OPTIONS]`
252
252
 
253
- | Options | Description | usage
254
- | :---: | :---: | :---: |
255
- | -C, --sha, --commit-sha TEXT |Commit SHA (with 40 chars) | Required
256
- | -t, --token TEXT |Codecov upload token |Required
257
- | -r, --slug TEXT | owner/repo slug used instead of the private repo token in Self-hosted | Optional
258
- | -Z, --fail-on-error | Exit with non-zero code in case of error|Optional
259
- | --git-service| Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional
260
- | -h, --help | Show this message and exit.|Optional
253
+ | Options | Description | usage |
254
+ | :--------------------------: | :----------------------------------------------------------------------------------------: | :------: |
255
+ | -C, --sha, --commit-sha TEXT | Commit SHA (with 40 chars) | Required |
256
+ | -t, --token TEXT | Codecov upload token | Required |
257
+ | -r, --slug TEXT | owner/repo slug used instead of the private repo token in Self-hosted | Optional |
258
+ | --force | Always emit passing checks regardless of changed files | Optional |
259
+ | -Z, --fail-on-error | Exit with non-zero code in case of error | Optional |
260
+ | --git-service | Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional |
261
+ | -h, --help | Show this message and exit. | Optional |
261
262
 
262
263
  # How to Use Local Upload
263
264
 
@@ -240,14 +240,15 @@ are ignored by codecov (including README and configuration files)
240
240
 
241
241
  `Usage: codecovcli empty-upload [OPTIONS]`
242
242
 
243
- | Options | Description | usage
244
- | :---: | :---: | :---: |
245
- | -C, --sha, --commit-sha TEXT |Commit SHA (with 40 chars) | Required
246
- | -t, --token TEXT |Codecov upload token |Required
247
- | -r, --slug TEXT | owner/repo slug used instead of the private repo token in Self-hosted | Optional
248
- | -Z, --fail-on-error | Exit with non-zero code in case of error|Optional
249
- | --git-service| Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional
250
- | -h, --help | Show this message and exit.|Optional
243
+ | Options | Description | usage |
244
+ | :--------------------------: | :----------------------------------------------------------------------------------------: | :------: |
245
+ | -C, --sha, --commit-sha TEXT | Commit SHA (with 40 chars) | Required |
246
+ | -t, --token TEXT | Codecov upload token | Required |
247
+ | -r, --slug TEXT | owner/repo slug used instead of the private repo token in Self-hosted | Optional |
248
+ | --force | Always emit passing checks regardless of changed files | Optional |
249
+ | -Z, --fail-on-error | Exit with non-zero code in case of error | Optional |
250
+ | --git-service | Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional |
251
+ | -h, --help | Show this message and exit. | Optional |
251
252
 
252
253
  # How to Use Local Upload
253
254
 
@@ -178,6 +178,26 @@ _global_upload_options = [
178
178
  "--network-prefix",
179
179
  help="Specify a prefix on files listed in the network section of the Codecov report. Useful to help resolve path fixing",
180
180
  ),
181
+ click.option(
182
+ "--gcov-args",
183
+ help="Extra arguments to pass to gcov",
184
+ ),
185
+ click.option(
186
+ "--gcov-ignore",
187
+ help="Paths to ignore during gcov gathering",
188
+ ),
189
+ click.option(
190
+ "--gcov-include",
191
+ help="Paths to include during gcov gathering",
192
+ ),
193
+ click.option(
194
+ "--gcov-executable",
195
+ help="gcov executable to run. Defaults to 'gcov'",
196
+ ),
197
+ click.option(
198
+ "--swift-project",
199
+ help="Specify the swift project",
200
+ ),
181
201
  ]
182
202
 
183
203
 
@@ -207,6 +227,10 @@ def do_upload(
207
227
  files_search_explicitly_listed_files: typing.List[pathlib.Path],
208
228
  files_search_root_folder: pathlib.Path,
209
229
  flags: typing.List[str],
230
+ gcov_args: typing.Optional[str],
231
+ gcov_executable: typing.Optional[str],
232
+ gcov_ignore: typing.Optional[str],
233
+ gcov_include: typing.Optional[str],
210
234
  git_service: typing.Optional[str],
211
235
  handle_no_reports_found: bool,
212
236
  job_code: typing.Optional[str],
@@ -218,6 +242,7 @@ def do_upload(
218
242
  pull_request_number: typing.Optional[str],
219
243
  report_type: str,
220
244
  slug: typing.Optional[str],
245
+ swift_project: typing.Optional[str],
221
246
  token: typing.Optional[str],
222
247
  use_legacy_uploader: bool,
223
248
  ):
@@ -251,6 +276,10 @@ def do_upload(
251
276
  files_search_explicitly_listed_files=list(files_search_explicitly_listed_files),
252
277
  files_search_root_folder=files_search_root_folder,
253
278
  flags=flags,
279
+ gcov_args=gcov_args,
280
+ gcov_executable=gcov_executable,
281
+ gcov_ignore=gcov_ignore,
282
+ gcov_include=gcov_include,
254
283
  git_service=git_service,
255
284
  handle_no_reports_found=handle_no_reports_found,
256
285
  job_code=job_code,
@@ -262,6 +291,7 @@ def do_upload(
262
291
  pull_request_number=pull_request_number,
263
292
  report_code=report_code,
264
293
  slug=slug,
294
+ swift_project=swift_project,
265
295
  token=token,
266
296
  upload_file_type=report_type,
267
297
  use_legacy_uploader=use_legacy_uploader,
@@ -25,34 +25,39 @@ logger = logging.getLogger("codecovcli")
25
25
  @click.pass_context
26
26
  def upload_process(
27
27
  ctx: CommandContext,
28
- commit_sha: str,
29
- report_code: str,
28
+ branch: typing.Optional[str],
30
29
  build_code: typing.Optional[str],
31
30
  build_url: typing.Optional[str],
32
- job_code: typing.Optional[str],
31
+ commit_sha: str,
32
+ disable_file_fixes: bool,
33
+ disable_search: bool,
34
+ dry_run: bool,
33
35
  env_vars: typing.Dict[str, str],
36
+ fail_on_error: bool,
37
+ files_search_exclude_folders: typing.List[pathlib.Path],
38
+ files_search_explicitly_listed_files: typing.List[pathlib.Path],
39
+ files_search_root_folder: pathlib.Path,
34
40
  flags: typing.List[str],
41
+ gcov_args: typing.Optional[str],
42
+ gcov_executable: typing.Optional[str],
43
+ gcov_ignore: typing.Optional[str],
44
+ gcov_include: typing.Optional[str],
45
+ git_service: typing.Optional[str],
46
+ handle_no_reports_found: bool,
47
+ job_code: typing.Optional[str],
35
48
  name: typing.Optional[str],
36
49
  network_filter: typing.Optional[str],
37
50
  network_prefix: typing.Optional[str],
38
51
  network_root_folder: pathlib.Path,
39
- files_search_root_folder: pathlib.Path,
40
- files_search_exclude_folders: typing.List[pathlib.Path],
41
- files_search_explicitly_listed_files: typing.List[pathlib.Path],
42
- disable_search: bool,
43
- disable_file_fixes: bool,
44
- token: typing.Optional[str],
52
+ parent_sha: typing.Optional[str],
45
53
  plugin_names: typing.List[str],
46
- branch: typing.Optional[str],
47
- slug: typing.Optional[str],
48
54
  pull_request_number: typing.Optional[str],
49
- use_legacy_uploader: bool,
50
- fail_on_error: bool,
51
- dry_run: bool,
52
- git_service: typing.Optional[str],
53
- parent_sha: typing.Optional[str],
54
- handle_no_reports_found: bool,
55
+ report_code: str,
55
56
  report_type: str,
57
+ slug: typing.Optional[str],
58
+ swift_project: typing.Optional[str],
59
+ token: typing.Optional[str],
60
+ use_legacy_uploader: bool,
56
61
  ):
57
62
  args = get_cli_args(ctx)
58
63
  logger.debug(
@@ -85,31 +90,36 @@ def upload_process(
85
90
  )
86
91
  ctx.invoke(
87
92
  do_upload,
88
- commit_sha=commit_sha,
89
- report_code=report_code,
93
+ branch=branch,
90
94
  build_code=build_code,
91
95
  build_url=build_url,
92
- job_code=job_code,
96
+ commit_sha=commit_sha,
97
+ disable_file_fixes=disable_file_fixes,
98
+ disable_search=disable_search,
99
+ dry_run=dry_run,
93
100
  env_vars=env_vars,
101
+ fail_on_error=fail_on_error,
102
+ files_search_exclude_folders=files_search_exclude_folders,
103
+ files_search_explicitly_listed_files=files_search_explicitly_listed_files,
104
+ files_search_root_folder=files_search_root_folder,
94
105
  flags=flags,
106
+ gcov_args=gcov_args,
107
+ gcov_executable=gcov_executable,
108
+ gcov_ignore=gcov_ignore,
109
+ gcov_include=gcov_include,
110
+ git_service=git_service,
111
+ handle_no_reports_found=handle_no_reports_found,
112
+ job_code=job_code,
95
113
  name=name,
96
114
  network_filter=network_filter,
97
115
  network_prefix=network_prefix,
98
116
  network_root_folder=network_root_folder,
99
- files_search_root_folder=files_search_root_folder,
100
- files_search_exclude_folders=files_search_exclude_folders,
101
- files_search_explicitly_listed_files=files_search_explicitly_listed_files,
102
- disable_search=disable_search,
103
- token=token,
104
117
  plugin_names=plugin_names,
105
- branch=branch,
106
- slug=slug,
107
118
  pull_request_number=pull_request_number,
108
- use_legacy_uploader=use_legacy_uploader,
109
- fail_on_error=fail_on_error,
110
- dry_run=dry_run,
111
- git_service=git_service,
112
- handle_no_reports_found=handle_no_reports_found,
113
- disable_file_fixes=disable_file_fixes,
119
+ report_code=report_code,
114
120
  report_type=report_type,
121
+ slug=slug,
122
+ swift_project=swift_project,
123
+ token=token,
124
+ use_legacy_uploader=use_legacy_uploader,
115
125
  )
@@ -9,6 +9,7 @@ from codecov_cli.helpers.versioning_systems import get_versioning_system
9
9
  logger = logging.getLogger("codecovcli")
10
10
 
11
11
  CODECOV_API_URL = "https://api.codecov.io"
12
+ CODECOV_INGEST_URL = "https://ingest.codecov.io"
12
13
  LEGACY_CODECOV_API_URL = "https://codecov.io"
13
14
 
14
15
  # Relative to the project root
@@ -102,7 +102,10 @@ def send_get_request(
102
102
  return request_result(get(url=url, headers=headers, params=params))
103
103
 
104
104
 
105
- def get_token_header_or_fail(token: str) -> dict:
105
+ def get_token_header_or_fail(token: Optional[str]) -> dict:
106
+ """
107
+ Rejects requests with no Authorization token. Prevents tokenless uploads.
108
+ """
106
109
  if token is None:
107
110
  raise click.ClickException(
108
111
  "Codecov token not found. Please provide Codecov token with -t flag."
@@ -110,7 +113,10 @@ def get_token_header_or_fail(token: str) -> dict:
110
113
  return {"Authorization": f"token {token}"}
111
114
 
112
115
 
113
- def get_token_header(token: str) -> Optional[dict]:
116
+ def get_token_header(token: Optional[str]) -> Optional[dict]:
117
+ """
118
+ Allows requests with no Authorization token.
119
+ """
114
120
  if token is None:
115
121
  return None
116
122
  return {"Authorization": f"token {token}"}
@@ -125,7 +131,7 @@ def send_put_request(
125
131
  return request_result(put(url=url, data=data, headers=headers))
126
132
 
127
133
 
128
- def request_result(resp):
134
+ def request_result(resp: requests.Response) -> RequestResult:
129
135
  if resp.status_code >= 400:
130
136
  return RequestResult(
131
137
  status_code=resp.status_code,
@@ -17,12 +17,17 @@ class NoopPlugin(object):
17
17
  pass
18
18
 
19
19
 
20
- def select_preparation_plugins(cli_config: typing.Dict, plugin_names: typing.List[str]):
21
- plugins = [_get_plugin(cli_config, p) for p in plugin_names]
20
+ def select_preparation_plugins(
21
+ cli_config: typing.Dict, plugin_names: typing.List[str], plugin_config: typing.Dict
22
+ ):
23
+ plugins = [_get_plugin(cli_config, p, plugin_config) for p in plugin_names]
22
24
  logger.debug(
23
25
  "Selected preparation plugins",
24
26
  extra=dict(
25
- extra_log_attributes=dict(selected_plugins=list(map(type, plugins)))
27
+ extra_log_attributes=dict(
28
+ selected_plugins=list(map(type, plugins)),
29
+ cli_config=cli_config,
30
+ )
26
31
  ),
27
32
  )
28
33
  return plugins
@@ -59,16 +64,25 @@ def _load_plugin_from_yaml(plugin_dict: typing.Dict):
59
64
  return NoopPlugin()
60
65
 
61
66
 
62
- def _get_plugin(cli_config, plugin_name):
67
+ def _get_plugin(cli_config, plugin_name, plugin_config):
63
68
  if plugin_name == "noop":
64
69
  return NoopPlugin()
65
70
  if plugin_name == "gcov":
66
- return GcovPlugin()
71
+ return GcovPlugin(
72
+ plugin_config.get("project_root", None),
73
+ plugin_config.get("folders_to_ignore", None),
74
+ plugin_config.get("gcov_executable", "gcov"),
75
+ plugin_config.get("gcov_include", None),
76
+ plugin_config.get("gcov_ignore", None),
77
+ plugin_config.get("gcov_args", None),
78
+ )
67
79
  if plugin_name == "pycoverage":
68
80
  config = cli_config.get("plugins", {}).get("pycoverage", {})
69
81
  return Pycoverage(config)
70
82
  if plugin_name == "xcode":
71
- return XcodePlugin()
83
+ return XcodePlugin(
84
+ plugin_config.get("swift_project", None),
85
+ )
72
86
  if plugin_name == "compress-pycoverage":
73
87
  config = cli_config.get("plugins", {}).get("compress-pycoverage", {})
74
88
  return CompressPycoverageContexts(config)
@@ -15,24 +15,26 @@ class GcovPlugin(object):
15
15
  def __init__(
16
16
  self,
17
17
  project_root: typing.Optional[pathlib.Path] = None,
18
+ folders_to_ignore: typing.Optional[typing.List[str]] = None,
19
+ executable: typing.Optional[str] = "gcov",
18
20
  patterns_to_include: typing.Optional[typing.List[str]] = None,
19
21
  patterns_to_ignore: typing.Optional[typing.List[str]] = None,
20
- folders_to_ignore: typing.Optional[typing.List[str]] = None,
21
22
  extra_arguments: typing.Optional[typing.List[str]] = None,
22
23
  ):
23
- self.project_root = project_root or pathlib.Path(os.getcwd())
24
- self.patterns_to_include = patterns_to_include or []
25
- self.patterns_to_ignore = patterns_to_ignore or []
26
- self.folders_to_ignore = folders_to_ignore or []
24
+ self.executable = executable or "gcov"
27
25
  self.extra_arguments = extra_arguments or []
26
+ self.folders_to_ignore = folders_to_ignore or []
27
+ self.patterns_to_ignore = patterns_to_ignore or []
28
+ self.patterns_to_include = patterns_to_include or []
29
+ self.project_root = project_root or pathlib.Path(os.getcwd())
28
30
 
29
31
  def run_preparation(self, collector) -> PreparationPluginReturn:
30
32
  logger.debug(
31
- "Running gcov plugin...",
33
+ f"Running {self.executable} plugin...",
32
34
  )
33
35
 
34
- if shutil.which("gcov") is None:
35
- logger.warning("gcov is not installed or can't be found.")
36
+ if shutil.which(self.executable) is None:
37
+ logger.warning(f"{self.executable} is not installed or can't be found.")
36
38
  return
37
39
 
38
40
  filename_include_regex = globs_to_regex(["*.gcno", *self.patterns_to_include])
@@ -49,15 +51,15 @@ class GcovPlugin(object):
49
51
  ]
50
52
 
51
53
  if not matched_paths:
52
- logger.warning("No gcov data found.")
54
+ logger.warning(f"No {self.executable} data found.")
53
55
  return
54
56
 
55
- logger.warning("Running gcov on the following list of files:")
57
+ logger.warning(f"Running {self.executable} on the following list of files:")
56
58
  for path in matched_paths:
57
59
  logger.warning(path)
58
60
 
59
61
  s = subprocess.run(
60
- ["gcov", "-pb", *self.extra_arguments, *matched_paths],
62
+ [self.executable, "-pb", *self.extra_arguments, *matched_paths],
61
63
  cwd=self.project_root,
62
64
  capture_output=True,
63
65
  )
@@ -16,12 +16,13 @@ logger = logging.getLogger("codecovcli")
16
16
  class XcodePlugin(object):
17
17
  def __init__(
18
18
  self,
19
+ app_name: typing.Optional[str] = None,
19
20
  derived_data_folder: typing.Optional[pathlib.Path] = None,
20
- app_name: typing.Optional[pathlib.Path] = None,
21
21
  ):
22
- self.derived_data_folder = pathlib.Path(
23
- derived_data_folder or "~/Library/Developer/Xcode/DerivedData"
24
- ).expanduser()
22
+ self.derived_data_folder = (
23
+ derived_data_folder
24
+ or pathlib.Path("~/Library/Developer/Xcode/DerivedData").expanduser()
25
+ )
25
26
 
26
27
  # this is to speed up processing and to build reports for the project being tested,
27
28
  # if empty the plugin will build reports for every xcode project it finds
@@ -2,10 +2,10 @@ import logging
2
2
  import os
3
3
  import typing
4
4
 
5
- from codecov_cli.helpers.config import CODECOV_API_URL
6
- from codecov_cli.helpers.encoder import decode_slug, encode_slug
5
+ from codecov_cli.helpers.config import CODECOV_INGEST_URL
6
+ from codecov_cli.helpers.encoder import encode_slug
7
7
  from codecov_cli.helpers.request import (
8
- get_token_header_or_fail,
8
+ get_token_header,
9
9
  log_warnings_and_errors_if_any,
10
10
  send_post_request,
11
11
  )
@@ -19,7 +19,7 @@ def create_commit_logic(
19
19
  pr: typing.Optional[str],
20
20
  branch: typing.Optional[str],
21
21
  slug: typing.Optional[str],
22
- token: str,
22
+ token: typing.Optional[str],
23
23
  service: typing.Optional[str],
24
24
  enterprise_url: typing.Optional[str] = None,
25
25
  fail_on_error: bool = False,
@@ -61,7 +61,7 @@ def send_commit_data(
61
61
  branch = tokenless # type: ignore
62
62
  logger.info("The PR is happening in a forked repo. Using tokenless upload.")
63
63
  else:
64
- headers = get_token_header_or_fail(token)
64
+ headers = get_token_header(token)
65
65
 
66
66
  data = {
67
67
  "branch": branch,
@@ -71,7 +71,7 @@ def send_commit_data(
71
71
  "pullid": pr,
72
72
  }
73
73
 
74
- upload_url = enterprise_url or CODECOV_API_URL
74
+ upload_url = enterprise_url or CODECOV_INGEST_URL
75
75
  url = f"{upload_url}/upload/{service}/{slug}/commits"
76
76
  return send_post_request(
77
77
  url=url,
@@ -2,7 +2,7 @@ import logging
2
2
 
3
3
  from codecov_cli.helpers.config import CODECOV_API_URL
4
4
  from codecov_cli.helpers.request import (
5
- get_token_header_or_fail,
5
+ get_token_header,
6
6
  log_warnings_and_errors_if_any,
7
7
  send_put_request,
8
8
  )
@@ -15,7 +15,7 @@ def base_picking_logic(base_sha, pr, slug, token, service, enterprise_url, args)
15
15
  "cli_args": args,
16
16
  "user_provided_base_sha": base_sha,
17
17
  }
18
- headers = get_token_header_or_fail(token)
18
+ headers = get_token_header(token)
19
19
  upload_url = enterprise_url or CODECOV_API_URL
20
20
  url = f"{upload_url}/api/v1/{service}/{slug}/pulls/{pr}"
21
21
  sending_result = send_put_request(url=url, data=data, headers=headers)
@@ -4,7 +4,7 @@ import logging
4
4
  from codecov_cli.helpers.config import CODECOV_API_URL
5
5
  from codecov_cli.helpers.encoder import encode_slug
6
6
  from codecov_cli.helpers.request import (
7
- get_token_header_or_fail,
7
+ get_token_header,
8
8
  log_warnings_and_errors_if_any,
9
9
  send_post_request,
10
10
  )
@@ -23,7 +23,7 @@ def empty_upload_logic(
23
23
  args,
24
24
  ):
25
25
  encoded_slug = encode_slug(slug)
26
- headers = get_token_header_or_fail(token)
26
+ headers = get_token_header(token)
27
27
  upload_url = enterprise_url or CODECOV_API_URL
28
28
  url = f"{upload_url}/upload/{git_service}/{encoded_slug}/commits/{commit_sha}/empty-upload"
29
29
  sending_result = send_post_request(
@@ -1,15 +1,15 @@
1
1
  import json
2
2
  import logging
3
3
  import time
4
+ import typing
4
5
 
5
6
  import requests
6
7
 
7
8
  from codecov_cli.helpers import request
8
- from codecov_cli.helpers.config import CODECOV_API_URL
9
- from codecov_cli.helpers.encoder import decode_slug, encode_slug
9
+ from codecov_cli.helpers.config import CODECOV_API_URL, CODECOV_INGEST_URL
10
+ from codecov_cli.helpers.encoder import encode_slug
10
11
  from codecov_cli.helpers.request import (
11
12
  get_token_header,
12
- get_token_header_or_fail,
13
13
  log_warnings_and_errors_if_any,
14
14
  request_result,
15
15
  send_post_request,
@@ -24,11 +24,11 @@ def create_report_logic(
24
24
  code: str,
25
25
  slug: str,
26
26
  service: str,
27
- token: str,
27
+ token: typing.Optional[str],
28
28
  enterprise_url: str,
29
29
  pull_request_number: int,
30
30
  fail_on_error: bool = False,
31
- args: dict = None,
31
+ args: typing.Union[dict, None] = None,
32
32
  ):
33
33
  encoded_slug = encode_slug(slug)
34
34
  sending_result = send_create_report_request(
@@ -60,7 +60,7 @@ def send_create_report_request(
60
60
  "code": code,
61
61
  }
62
62
  headers = get_token_header(token)
63
- upload_url = enterprise_url or CODECOV_API_URL
63
+ upload_url = enterprise_url or CODECOV_INGEST_URL
64
64
  url = f"{upload_url}/upload/{service}/{encoded_slug}/commits/{commit_sha}/reports"
65
65
  return send_post_request(url=url, headers=headers, data=data)
66
66
 
@@ -70,10 +70,10 @@ def create_report_results_logic(
70
70
  code: str,
71
71
  slug: str,
72
72
  service: str,
73
- token: str,
73
+ token: typing.Optional[str],
74
74
  enterprise_url: str,
75
75
  fail_on_error: bool = False,
76
- args: dict = None,
76
+ args: typing.Union[dict, None] = None,
77
77
  ):
78
78
  encoded_slug = encode_slug(slug)
79
79
  sending_result = send_reports_result_request(
@@ -83,6 +83,7 @@ def create_report_results_logic(
83
83
  service=service,
84
84
  token=token,
85
85
  enterprise_url=enterprise_url,
86
+ args=args,
86
87
  )
87
88
 
88
89
  log_warnings_and_errors_if_any(
@@ -103,7 +104,7 @@ def send_reports_result_request(
103
104
  data = {
104
105
  "cli_args": args,
105
106
  }
106
- headers = get_token_header_or_fail(token)
107
+ headers = get_token_header(token)
107
108
  upload_url = enterprise_url or CODECOV_API_URL
108
109
  url = f"{upload_url}/upload/{service}/{encoded_slug}/commits/{commit_sha}/reports/{report_code}/results"
109
110
  return send_post_request(url=url, data=data, headers=headers)
@@ -118,7 +119,7 @@ def send_reports_result_get_request(
118
119
  enterprise_url,
119
120
  fail_on_error=False,
120
121
  ):
121
- headers = get_token_header_or_fail(token)
122
+ headers = get_token_header(token)
122
123
  upload_url = enterprise_url or CODECOV_API_URL
123
124
  url = f"{upload_url}/upload/{service}/{encoded_slug}/commits/{commit_sha}/reports/{report_code}/results"
124
125
  number_tries = 0
@@ -40,6 +40,10 @@ def do_upload_logic(
40
40
  files_search_explicitly_listed_files: typing.List[Path],
41
41
  files_search_root_folder: Path,
42
42
  flags: typing.List[str],
43
+ gcov_args: typing.Optional[str],
44
+ gcov_executable: typing.Optional[str],
45
+ gcov_ignore: typing.Optional[str],
46
+ gcov_include: typing.Optional[str],
43
47
  git_service: typing.Optional[str],
44
48
  handle_no_reports_found: bool = False,
45
49
  job_code: typing.Optional[str],
@@ -51,12 +55,24 @@ def do_upload_logic(
51
55
  pull_request_number: typing.Optional[str],
52
56
  report_code: str,
53
57
  slug: typing.Optional[str],
54
- token: str,
58
+ swift_project: typing.Optional[str],
59
+ token: typing.Optional[str],
55
60
  upload_file_type: str = "coverage",
56
61
  use_legacy_uploader: bool = False,
57
62
  ):
63
+ plugin_config = {
64
+ "folders_to_ignore": files_search_exclude_folders,
65
+ "gcov_args": gcov_args,
66
+ "gcov_executable": gcov_executable,
67
+ "gcov_ignore": gcov_ignore,
68
+ "gcov_include": gcov_include,
69
+ "project_root": files_search_root_folder,
70
+ "swift_project": swift_project,
71
+ }
58
72
  if upload_file_type == "coverage":
59
- preparation_plugins = select_preparation_plugins(cli_config, plugin_names)
73
+ preparation_plugins = select_preparation_plugins(
74
+ cli_config, plugin_names, plugin_config
75
+ )
60
76
  elif upload_file_type == "test_results":
61
77
  preparation_plugins = []
62
78
  file_selector = select_file_finder(
@@ -73,7 +89,11 @@ def do_upload_logic(
73
89
  network_root_folder=network_root_folder,
74
90
  )
75
91
  collector = UploadCollector(
76
- preparation_plugins, network_finder, file_selector, disable_file_fixes
92
+ preparation_plugins,
93
+ network_finder,
94
+ file_selector,
95
+ disable_file_fixes,
96
+ plugin_config,
77
97
  )
78
98
  try:
79
99
  upload_data = collector.generate_upload_data(upload_file_type)
@@ -29,12 +29,14 @@ class UploadCollector(object):
29
29
  preparation_plugins: typing.List[PreparationPluginInterface],
30
30
  network_finder: NetworkFinder,
31
31
  file_finder: FileFinder,
32
+ plugin_config: dict,
32
33
  disable_file_fixes: bool = False,
33
34
  ):
34
35
  self.preparation_plugins = preparation_plugins
35
36
  self.network_finder = network_finder
36
37
  self.file_finder = file_finder
37
38
  self.disable_file_fixes = disable_file_fixes
39
+ self.plugin_config = plugin_config
38
40
 
39
41
  def _produce_file_fixes(
40
42
  self, files: typing.List[str]
@@ -6,7 +6,7 @@ import zlib
6
6
  from typing import Any, Dict
7
7
 
8
8
  from codecov_cli import __version__ as codecov_cli_version
9
- from codecov_cli.helpers.config import CODECOV_API_URL
9
+ from codecov_cli.helpers.config import CODECOV_INGEST_URL
10
10
  from codecov_cli.helpers.encoder import encode_slug
11
11
  from codecov_cli.helpers.request import (
12
12
  get_token_header,
@@ -27,7 +27,7 @@ class UploadSender(object):
27
27
  self,
28
28
  upload_data: UploadCollectionResult,
29
29
  commit_sha: str,
30
- token: str,
30
+ token: typing.Optional[str],
31
31
  env_vars: typing.Dict[str, str],
32
32
  report_code: str,
33
33
  upload_file_type: str = "coverage",
@@ -56,7 +56,7 @@ class UploadSender(object):
56
56
  }
57
57
  headers = get_token_header(token)
58
58
  encoded_slug = encode_slug(slug)
59
- upload_url = enterprise_url or CODECOV_API_URL
59
+ upload_url = enterprise_url or CODECOV_INGEST_URL
60
60
  url, data = self.get_url_and_possibly_update_data(
61
61
  data,
62
62
  upload_file_type,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codecov-cli
3
- Version: 0.7.6
3
+ Version: 0.9.4
4
4
  Summary: Codecov Command Line Interface
5
5
  Author: Codecov
6
6
  Author-email: support@codecov.io
@@ -250,14 +250,15 @@ are ignored by codecov (including README and configuration files)
250
250
 
251
251
  `Usage: codecovcli empty-upload [OPTIONS]`
252
252
 
253
- | Options | Description | usage
254
- | :---: | :---: | :---: |
255
- | -C, --sha, --commit-sha TEXT |Commit SHA (with 40 chars) | Required
256
- | -t, --token TEXT |Codecov upload token |Required
257
- | -r, --slug TEXT | owner/repo slug used instead of the private repo token in Self-hosted | Optional
258
- | -Z, --fail-on-error | Exit with non-zero code in case of error|Optional
259
- | --git-service| Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional
260
- | -h, --help | Show this message and exit.|Optional
253
+ | Options | Description | usage |
254
+ | :--------------------------: | :----------------------------------------------------------------------------------------: | :------: |
255
+ | -C, --sha, --commit-sha TEXT | Commit SHA (with 40 chars) | Required |
256
+ | -t, --token TEXT | Codecov upload token | Required |
257
+ | -r, --slug TEXT | owner/repo slug used instead of the private repo token in Self-hosted | Optional |
258
+ | --force | Always emit passing checks regardless of changed files | Optional |
259
+ | -Z, --fail-on-error | Exit with non-zero code in case of error | Optional |
260
+ | --git-service | Options: github, gitlab, bitbucket, github_enterprise, gitlab_enterprise, bitbucket_server | Optional |
261
+ | -h, --help | Show this message and exit. | Optional |
261
262
 
262
263
  # How to Use Local Upload
263
264
 
@@ -10,7 +10,7 @@ with open(path.join(here, "README.md"), encoding="utf-8") as f:
10
10
 
11
11
  setup(
12
12
  name="codecov-cli",
13
- version="0.7.6",
13
+ version="0.9.4",
14
14
  packages=find_packages(exclude=["contrib", "docs", "tests*"]),
15
15
  description="Codecov Command Line Interface",
16
16
  long_description=long_description,
File without changes
File without changes
File without changes