depdelta-cli 0.3.0__tar.gz → 0.4.1__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 (43) hide show
  1. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/.github/workflows/release.yml +2 -0
  2. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/PKG-INFO +8 -14
  3. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/README.md +6 -12
  4. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/pyproject.toml +2 -2
  5. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/__init__.py +2 -2
  6. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/main.py +13 -6
  7. depdelta_cli-0.4.1/src/depdelta_cli/usage.py +931 -0
  8. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_git.py +1 -1
  9. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_main.py +13 -4
  10. depdelta_cli-0.4.1/tests/test_usage.py +829 -0
  11. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/uv.lock +1 -1
  12. depdelta_cli-0.3.0/src/depdelta_cli/usage.py +0 -391
  13. depdelta_cli-0.3.0/tests/test_usage.py +0 -310
  14. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/.dockerignore +0 -0
  15. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/.github/workflows/ci.yml +0 -0
  16. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/.gitignore +0 -0
  17. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/Dockerfile +0 -0
  18. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/LICENSE +0 -0
  19. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/Makefile +0 -0
  20. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/__main__.py +0 -0
  21. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/api.py +0 -0
  22. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/azure.py +0 -0
  23. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/bitbucket.py +0 -0
  24. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/check.py +0 -0
  25. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/env.py +0 -0
  26. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/forgejo.py +0 -0
  27. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/gerrit.py +0 -0
  28. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/git.py +0 -0
  29. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/gitlab.py +0 -0
  30. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/manifests.py +0 -0
  31. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/src/depdelta_cli/web.py +0 -0
  32. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/conftest.py +0 -0
  33. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/helpers.py +0 -0
  34. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_api.py +0 -0
  35. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_azure.py +0 -0
  36. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_bitbucket.py +0 -0
  37. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_check.py +0 -0
  38. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_env.py +0 -0
  39. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_forgejo.py +0 -0
  40. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_gerrit.py +0 -0
  41. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_gitlab.py +0 -0
  42. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_manifests.py +0 -0
  43. {depdelta_cli-0.3.0 → depdelta_cli-0.4.1}/tests/test_web.py +0 -0
@@ -12,6 +12,8 @@ permissions:
12
12
  jobs:
13
13
  check:
14
14
  name: Tag matches the version
15
+ # Releases publish from GitHub only; the Forgejo mirror runs this file too.
16
+ if: github.server_url == 'https://github.com'
15
17
  runs-on: ubuntu-latest
16
18
  steps:
17
19
  - uses: actions/checkout@v7
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: depdelta-cli
3
- Version: 0.3.0
4
- Summary: DepDelta for CI: review a change's dependency updates on Gerrit, GitLab, Forgejo or Gitea.
3
+ Version: 0.4.1
4
+ Summary: DepDelta for CI: review a change's dependency updates on Gerrit, GitLab, Forgejo, Gitea, Bitbucket or Azure DevOps.
5
5
  Project-URL: Homepage, https://depdelta.com
6
6
  Project-URL: Documentation, https://depdelta.com/ci
7
7
  Project-URL: Source, https://github.com/mbobiosio/depdelta-cli
@@ -48,8 +48,8 @@ On every change that touches a manifest or lockfile, `depdelta`:
48
48
 
49
49
  1. sends the changed manifests and lockfiles (both ends) to DepDelta. Source
50
50
  code is never sent;
51
- 2. gets back each update's verdict and, for npm and Maven, the declarations
52
- it removes or changes;
51
+ 2. gets back each update's verdict and, for npm, Maven, PyPI, Go, Composer,
52
+ NuGet, pub and RubyGems, the declarations it removes or changes;
53
53
  3. looks for those declarations in the checkout, and sends only the hits
54
54
  (path, line, symbol);
55
55
  4. posts the review: a Gerrit change message (no vote), or one GitLab merge
@@ -78,7 +78,7 @@ pip install depdelta-cli
78
78
 
79
79
  ## API key
80
80
 
81
- Sign in at [depdelta.com](https://depdelta.com) with GitHub or Google,
81
+ Sign in at [depdelta.com](https://depdelta.com) with GitHub, Google, GitLab or Codeberg,
82
82
  make a key in [Settings → API keys for CI](https://depdelta.com/settings),
83
83
  and store it in your CI's secrets as `DEPDELTA_API_KEY`. Each key gets 240
84
84
  reviews an hour, waiting on release notes included.
@@ -136,14 +136,6 @@ depdelta:
136
136
  image: ghcr.io/mbobiosio/depdelta-cli:latest
137
137
  rules:
138
138
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
139
- changes:
140
- - "**/package.json"
141
- - "**/package-lock.json"
142
- - "**/pom.xml"
143
- - "**/requirements*.txt"
144
- - "**/pyproject.toml"
145
- - "**/*.lock"
146
- - "**/go.mod"
147
139
  variables:
148
140
  GIT_DEPTH: 0
149
141
  script:
@@ -292,7 +284,7 @@ Pipelines aren't covered: use the GitHub app.
292
284
  ```
293
285
  depdelta [--repo .] [--base REV --head REV] [--print]
294
286
  [--format markdown|commonmark|text] [--wait 300]
295
- [--fail-on never|breaking|review|unknown|safe]
287
+ [--fail-on never|breaking|unknown|review|safe]
296
288
  [--api-url URL]
297
289
  ```
298
290
 
@@ -303,6 +295,8 @@ depdelta [--repo .] [--base REV --head REV] [--print]
303
295
  seen yet. After that the review posts as it stands, saying what is still
304
296
  being read.
305
297
  - `--fail-on breaking` exits 1 when an update is breaking, to fail the job.
298
+ `--fail-on X` fails on X or anything riskier, riskiest first: `breaking`,
299
+ `unknown` (some releases unread or without notes), `review`, `safe`.
306
300
 
307
301
  Exit status: 0 posted (or nothing to review), 1 the `--fail-on` verdict was
308
302
  met or `.depdelta.yml` blocks new install-time code, 2 it couldn't review or
@@ -26,8 +26,8 @@ On every change that touches a manifest or lockfile, `depdelta`:
26
26
 
27
27
  1. sends the changed manifests and lockfiles (both ends) to DepDelta. Source
28
28
  code is never sent;
29
- 2. gets back each update's verdict and, for npm and Maven, the declarations
30
- it removes or changes;
29
+ 2. gets back each update's verdict and, for npm, Maven, PyPI, Go, Composer,
30
+ NuGet, pub and RubyGems, the declarations it removes or changes;
31
31
  3. looks for those declarations in the checkout, and sends only the hits
32
32
  (path, line, symbol);
33
33
  4. posts the review: a Gerrit change message (no vote), or one GitLab merge
@@ -56,7 +56,7 @@ pip install depdelta-cli
56
56
 
57
57
  ## API key
58
58
 
59
- Sign in at [depdelta.com](https://depdelta.com) with GitHub or Google,
59
+ Sign in at [depdelta.com](https://depdelta.com) with GitHub, Google, GitLab or Codeberg,
60
60
  make a key in [Settings → API keys for CI](https://depdelta.com/settings),
61
61
  and store it in your CI's secrets as `DEPDELTA_API_KEY`. Each key gets 240
62
62
  reviews an hour, waiting on release notes included.
@@ -114,14 +114,6 @@ depdelta:
114
114
  image: ghcr.io/mbobiosio/depdelta-cli:latest
115
115
  rules:
116
116
  - if: $CI_PIPELINE_SOURCE == "merge_request_event"
117
- changes:
118
- - "**/package.json"
119
- - "**/package-lock.json"
120
- - "**/pom.xml"
121
- - "**/requirements*.txt"
122
- - "**/pyproject.toml"
123
- - "**/*.lock"
124
- - "**/go.mod"
125
117
  variables:
126
118
  GIT_DEPTH: 0
127
119
  script:
@@ -270,7 +262,7 @@ Pipelines aren't covered: use the GitHub app.
270
262
  ```
271
263
  depdelta [--repo .] [--base REV --head REV] [--print]
272
264
  [--format markdown|commonmark|text] [--wait 300]
273
- [--fail-on never|breaking|review|unknown|safe]
265
+ [--fail-on never|breaking|unknown|review|safe]
274
266
  [--api-url URL]
275
267
  ```
276
268
 
@@ -281,6 +273,8 @@ depdelta [--repo .] [--base REV --head REV] [--print]
281
273
  seen yet. After that the review posts as it stands, saying what is still
282
274
  being read.
283
275
  - `--fail-on breaking` exits 1 when an update is breaking, to fail the job.
276
+ `--fail-on X` fails on X or anything riskier, riskiest first: `breaking`,
277
+ `unknown` (some releases unread or without notes), `review`, `safe`.
284
278
 
285
279
  Exit status: 0 posted (or nothing to review), 1 the `--fail-on` verdict was
286
280
  met or `.depdelta.yml` blocks new install-time code, 2 it couldn't review or
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "depdelta-cli"
3
- version = "0.3.0"
4
- description = "DepDelta for CI: review a change's dependency updates on Gerrit, GitLab, Forgejo or Gitea."
3
+ version = "0.4.1"
4
+ description = "DepDelta for CI: review a change's dependency updates on Gerrit, GitLab, Forgejo, Gitea, Bitbucket or Azure DevOps."
5
5
  readme = "README.md"
6
6
  license = "MIT"
7
7
  license-files = ["LICENSE"]
@@ -1,4 +1,4 @@
1
1
  """DepDelta for CI: review a change's dependency updates on Gerrit, GitLab,
2
- Forgejo or Gitea."""
2
+ Forgejo, Gitea, Bitbucket or Azure DevOps."""
3
3
 
4
- __version__ = "0.3.0"
4
+ __version__ = "0.4.1"
@@ -6,8 +6,8 @@
6
6
  # Azure DevOps pull request thread).
7
7
  #
8
8
  # 1. The manifests and lockfiles the change touched go to DepDelta.
9
- # 2. DepDelta answers with each update's verdict and, for npm and Maven,
10
- # the declarations it removes or changes.
9
+ # 2. DepDelta answers with each update's verdict and, for every ecosystem
10
+ # but Cargo, the declarations it removes or changes.
11
11
  # 3. The command looks for those in the checkout and sends what it found;
12
12
  # the review then says where the code is hit.
13
13
  #
@@ -55,8 +55,10 @@ from depdelta_cli.git import (
55
55
 
56
56
  #: depdelta-api pull_diff MAX_FILES: manifests reviewed per change.
57
57
  MAX_FILES = 40
58
- #: Verdicts from riskiest; --fail-on X fails on X and anything riskier.
59
- VERDICTS = ("breaking", "review", "unknown", "safe")
58
+ #: Verdicts from riskiest, as DepDelta ranks them: unknown above review, since
59
+ #: a release nobody has read can't count as safe. --fail-on X fails on X and
60
+ #: anything riskier.
61
+ VERDICTS = ("breaking", "unknown", "review", "safe")
60
62
  #: Tried in turn for Forgejo and Gitea: Forgejo Actions sets the first,
61
63
  #: Gitea Actions' token is GITEA_TOKEN, both alias it as GITHUB_TOKEN.
62
64
  FORGEJO_TOKENS = ("FORGEJO_TOKEN", "GITEA_TOKEN", "GITHUB_TOKEN")
@@ -197,7 +199,7 @@ def _review(
197
199
  return review
198
200
  sources = source_files(args.repo, wanted)
199
201
  usage = check.usage(review.updates, sources)
200
- log(f"Usage check: {sum(u['total'] for u in usage)} uses found.")
202
+ log(f"Usage check: {count(sum(u['total'] for u in usage), 'use')} found.")
201
203
  return client.review(files, usage=usage, wait=args.wait, **options)
202
204
 
203
205
 
@@ -235,6 +237,11 @@ def failed(review: Review, fail_on: str) -> bool:
235
237
  )
236
238
 
237
239
 
240
+ def count(n: int, noun: str) -> str:
241
+ """``n`` and the noun, plural unless it is one: "1 use", "3 uses"."""
242
+ return f"{n} {noun}" if n == 1 else f"{n} {noun}s"
243
+
244
+
238
245
  def log(message: str) -> None:
239
246
  print(f"depdelta: {message}", file=sys.stderr)
240
247
 
@@ -263,7 +270,7 @@ def run(argv: Sequence[str] | None = None, env: Mapping[str, str] | None = None)
263
270
  source_url = change.source_url if change else None
264
271
  config = config_file(args.repo, head)
265
272
  review = _review(DepDelta(key, api_url), args, files, fmt, source_url, config)
266
- log(f"{review.label} ({len(review.updates)} updates).")
273
+ log(f"{review.label} ({count(len(review.updates), 'update')}).")
267
274
  for note in review.notes:
268
275
  log(f".depdelta.yml: {note}.")
269
276
  if change is None or args.print_only: