depdelta-cli 0.4.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 (41) hide show
  1. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/PKG-INFO +6 -12
  2. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/README.md +4 -10
  3. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/pyproject.toml +2 -2
  4. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/__init__.py +2 -2
  5. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/main.py +13 -6
  6. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_main.py +13 -4
  7. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/uv.lock +1 -1
  8. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/.dockerignore +0 -0
  9. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/.github/workflows/ci.yml +0 -0
  10. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/.github/workflows/release.yml +0 -0
  11. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/.gitignore +0 -0
  12. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/Dockerfile +0 -0
  13. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/LICENSE +0 -0
  14. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/Makefile +0 -0
  15. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/__main__.py +0 -0
  16. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/api.py +0 -0
  17. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/azure.py +0 -0
  18. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/bitbucket.py +0 -0
  19. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/check.py +0 -0
  20. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/env.py +0 -0
  21. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/forgejo.py +0 -0
  22. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/gerrit.py +0 -0
  23. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/git.py +0 -0
  24. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/gitlab.py +0 -0
  25. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/manifests.py +0 -0
  26. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/usage.py +0 -0
  27. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/src/depdelta_cli/web.py +0 -0
  28. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/conftest.py +0 -0
  29. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/helpers.py +0 -0
  30. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_api.py +0 -0
  31. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_azure.py +0 -0
  32. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_bitbucket.py +0 -0
  33. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_check.py +0 -0
  34. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_env.py +0 -0
  35. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_forgejo.py +0 -0
  36. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_gerrit.py +0 -0
  37. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_git.py +0 -0
  38. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_gitlab.py +0 -0
  39. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_manifests.py +0 -0
  40. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_usage.py +0 -0
  41. {depdelta_cli-0.4.0 → depdelta_cli-0.4.1}/tests/test_web.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: depdelta-cli
3
- Version: 0.4.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
@@ -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
@@ -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.4.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.4.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:
@@ -7,7 +7,7 @@ from helpers import CLI_ENGINE, FakeWeb, ok, review, update
7
7
 
8
8
  from depdelta_cli import forgejo, gitlab, main, web
9
9
  from depdelta_cli.api import DEFAULT_API_URL, _review
10
- from depdelta_cli.main import failed, run
10
+ from depdelta_cli.main import count, failed, run
11
11
 
12
12
  KEY = {"DEPDELTA_API_KEY": "dd_key"}
13
13
 
@@ -109,7 +109,7 @@ def test_run_gerrit_success(repo, change, monkeypatch, capsys):
109
109
  )
110
110
  assert posted["body"]["message"] == "DepDelta review: Breaking"
111
111
  err = capsys.readouterr().err
112
- assert "Usage check: 1 uses found." in err
112
+ assert "Usage check: 1 use found." in err
113
113
  assert "Posted the review on the Gerrit change." in err
114
114
 
115
115
 
@@ -141,7 +141,7 @@ def test_run_print_by_hand(repo, change, monkeypatch, capsys):
141
141
  assert code == 0
142
142
  out = capsys.readouterr()
143
143
  assert out.out == "### DepDelta review\n"
144
- assert "🔴 Breaking (1 updates)." in out.err
144
+ assert "🔴 Breaking (1 update)." in out.err
145
145
 
146
146
 
147
147
  def test_run_print_in_ci(repo, change, monkeypatch, capsys):
@@ -281,7 +281,8 @@ def test_run_unknown_target(repo, change, monkeypatch):
281
281
  (["review"], "breaking", False),
282
282
  (["breaking"], "breaking", True),
283
283
  (["safe", "review"], "review", True),
284
- (["unknown"], "review", False),
284
+ (["unknown"], "review", True),
285
+ (["review"], "unknown", False),
285
286
  ([None], "safe", False),
286
287
  ([], "safe", False),
287
288
  ],
@@ -606,3 +607,11 @@ def test_run_format_option_wins(repo, change, monkeypatch):
606
607
  m.setattr(main, "_merge_base", lambda change, env: base)
607
608
  assert run(["--repo", str(repo), "--format", "markdown"], env) == 0
608
609
  assert fake.calls[0]["body"]["format"] == "markdown"
610
+
611
+
612
+ @pytest.mark.parametrize(
613
+ ("n", "expected"),
614
+ [(0, "0 updates"), (1, "1 update"), (2, "2 updates")],
615
+ )
616
+ def test_count(n, expected):
617
+ assert count(n, "update") == expected
@@ -139,7 +139,7 @@ wheels = [
139
139
 
140
140
  [[package]]
141
141
  name = "depdelta-cli"
142
- version = "0.4.0"
142
+ version = "0.4.1"
143
143
  source = { editable = "." }
144
144
 
145
145
  [package.dev-dependencies]
File without changes
File without changes
File without changes
File without changes
File without changes