Merge ~cjwatson/launchpad:black-py38 into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 1f4fb3cd3a74b0c497467516f81f887d3cfee95f
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:black-py38
Merge into: launchpad:master
Diff against target: 483 lines (+44/-44)
22 files modified
lib/lp/archivepublisher/tests/test_publisher.py (+1/-1)
lib/lp/charms/tests/test_charmhubclient.py (+1/-1)
lib/lp/charms/tests/test_charmrecipe.py (+3/-3)
lib/lp/code/mail/branch.py (+1/-1)
lib/lp/code/xmlrpc/tests/test_git.py (+6/-6)
lib/lp/codehosting/vfs/tests/test_branchfs.py (+2/-2)
lib/lp/scripts/tests/test_garbo.py (+1/-1)
lib/lp/services/fields/__init__.py (+2/-2)
lib/lp/services/job/celeryjob.py (+1/-1)
lib/lp/services/macaroons/interfaces.py (+1/-1)
lib/lp/services/timeout.py (+1/-1)
lib/lp/services/webapp/servers.py (+1/-1)
lib/lp/snappy/tests/test_snap.py (+1/-1)
lib/lp/soyuz/adapters/tests/test_archivedependencies.py (+1/-1)
lib/lp/soyuz/mail/packageupload.py (+1/-1)
lib/lp/soyuz/tests/test_livefsbuildbehaviour.py (+1/-1)
lib/lp/soyuz/tests/test_packagecopyjob.py (+1/-1)
lib/lp/soyuz/tests/test_publishing.py (+2/-2)
lib/lp/testing/__init__.py (+1/-1)
lib/lp/testing/factory.py (+12/-12)
lib/lp/testing/views.py (+2/-2)
pyproject.toml (+1/-1)
Reviewer Review Type Date Requested Status
Simone Pelosi Approve
Review via email: mp+456431@code.launchpad.net

Commit message

Upgrade Black's target Python version to 3.8

To post a comment you must log in.
Revision history for this message
Simone Pelosi (pelpsi) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py
2index 99b2a61..0f3f9e0 100644
3--- a/lib/lp/archivepublisher/tests/test_publisher.py
4+++ b/lib/lp/archivepublisher/tests/test_publisher.py
5@@ -3120,7 +3120,7 @@ class TestUpdateByHash(TestPublisherBase):
6 def assertHasSuiteFiles(
7 self,
8 patterns: Sequence[str],
9- *properties: Tuple[str, Optional[int], Optional[int], Optional[int]]
10+ *properties: Tuple[str, Optional[int], Optional[int], Optional[int]],
11 ) -> None:
12 """Assert that the database records certain archive files.
13
14diff --git a/lib/lp/charms/tests/test_charmhubclient.py b/lib/lp/charms/tests/test_charmhubclient.py
15index 1d5c3bf..7ca8734 100644
16--- a/lib/lp/charms/tests/test_charmhubclient.py
17+++ b/lib/lp/charms/tests/test_charmhubclient.py
18@@ -78,7 +78,7 @@ class RequestMatches(MatchesAll):
19 auth=None,
20 json_data=None,
21 file_data=None,
22- **kwargs
23+ **kwargs,
24 ):
25 matchers = []
26 kwargs = dict(kwargs)
27diff --git a/lib/lp/charms/tests/test_charmrecipe.py b/lib/lp/charms/tests/test_charmrecipe.py
28index 5fad120..df6ba5a 100644
29--- a/lib/lp/charms/tests/test_charmrecipe.py
30+++ b/lib/lp/charms/tests/test_charmrecipe.py
31@@ -273,7 +273,7 @@ class TestCharmRecipe(TestCaseWithFactory):
32 processor=None,
33 supports_virtualized=True,
34 supports_nonvirtualized=True,
35- **kwargs
36+ **kwargs,
37 ):
38 if architecturetag is None:
39 architecturetag = self.factory.getUniqueUnicode("arch")
40@@ -1860,7 +1860,7 @@ class TestCharmRecipeWebservice(TestCaseWithFactory):
41 git_ref=None,
42 private=False,
43 webservice=None,
44- **kwargs
45+ **kwargs,
46 ):
47 if owner is None:
48 owner = self.person
49@@ -2365,7 +2365,7 @@ class TestCharmRecipeWebservice(TestCaseWithFactory):
50 processor=None,
51 supports_virtualized=True,
52 supports_nonvirtualized=True,
53- **kwargs
54+ **kwargs,
55 ):
56 if architecturetag is None:
57 architecturetag = self.factory.getUniqueUnicode("arch")
58diff --git a/lib/lp/code/mail/branch.py b/lib/lp/code/mail/branch.py
59index 7eaee76..c880ae5 100644
60--- a/lib/lp/code/mail/branch.py
61+++ b/lib/lp/code/mail/branch.py
62@@ -220,7 +220,7 @@ class BranchMailer(BaseMailer):
63 revno=None,
64 revision_id=None,
65 notification_type=None,
66- **kwargs
67+ **kwargs,
68 ):
69 super().__init__(
70 subject,
71diff --git a/lib/lp/code/xmlrpc/tests/test_git.py b/lib/lp/code/xmlrpc/tests/test_git.py
72index add6348..d309c5b 100644
73--- a/lib/lp/code/xmlrpc/tests/test_git.py
74+++ b/lib/lp/code/xmlrpc/tests/test_git.py
75@@ -198,7 +198,7 @@ class TestGitAPIMixin:
76 path,
77 permission="read",
78 can_authenticate=False,
79- **auth_kwargs
80+ **auth_kwargs,
81 ):
82 """Assert that the given path cannot be translated."""
83 auth_params = _make_auth_params(
84@@ -221,7 +221,7 @@ class TestGitAPIMixin:
85 message="Permission denied.",
86 permission="read",
87 can_authenticate=False,
88- **auth_kwargs
89+ **auth_kwargs,
90 ):
91 """Assert that looking at the given path returns PermissionDenied."""
92 auth_params = _make_auth_params(
93@@ -244,7 +244,7 @@ class TestGitAPIMixin:
94 message="Authorisation required.",
95 permission="read",
96 can_authenticate=False,
97- **auth_kwargs
98+ **auth_kwargs,
99 ):
100 """Assert that looking at the given path returns Unauthorized."""
101 auth_params = _make_auth_params(
102@@ -356,7 +356,7 @@ class TestGitAPIMixin:
103 writable=False,
104 trailing="",
105 private=False,
106- **auth_kwargs
107+ **auth_kwargs,
108 ):
109 auth_params = _make_auth_params(
110 requester, can_authenticate=can_authenticate, **auth_kwargs
111@@ -444,7 +444,7 @@ class TestGitAPIMixin:
112 requester,
113 git_repository,
114 can_authenticate=True,
115- **auth_kwargs
116+ **auth_kwargs,
117 ):
118 translated_path = git_repository.getInternalPath()
119 auth_params = _make_auth_params(
120@@ -499,7 +499,7 @@ class TestGitAPIMixin:
121 requester,
122 git_repository,
123 can_authenticate=True,
124- **auth_kwargs
125+ **auth_kwargs,
126 ):
127 translated_path = git_repository.getInternalPath()
128 auth_params = _make_auth_params(
129diff --git a/lib/lp/codehosting/vfs/tests/test_branchfs.py b/lib/lp/codehosting/vfs/tests/test_branchfs.py
130index c3185c0..5a7f958 100644
131--- a/lib/lp/codehosting/vfs/tests/test_branchfs.py
132+++ b/lib/lp/codehosting/vfs/tests/test_branchfs.py
133@@ -939,7 +939,7 @@ class TestBranchChangedNotification(TestCaseWithTransport):
134 branch_id,
135 stacked_on_url,
136 last_revision,
137- *format_strings
138+ *format_strings,
139 ):
140 self._branch_changed_log.append(
141 dict(
142@@ -1130,7 +1130,7 @@ class TestBranchChangedErrorHandling(TestCaseWithTransport, TestCase):
143 branch_id,
144 stacked_on_url,
145 last_revision,
146- *format_strings
147+ *format_strings,
148 ):
149 """Log an oops and raise an xmlrpc fault."""
150
151diff --git a/lib/lp/scripts/tests/test_garbo.py b/lib/lp/scripts/tests/test_garbo.py
152index 726ba55..eaa20e9 100644
153--- a/lib/lp/scripts/tests/test_garbo.py
154+++ b/lib/lp/scripts/tests/test_garbo.py
155@@ -1838,7 +1838,7 @@ class TestGarbo(FakeAdapterMixin, TestCaseWithFactory):
156 keep_binary_files_days=_default,
157 base_image=False,
158 expected_count=0,
159- **livefsbuild_kwargs
160+ **livefsbuild_kwargs,
161 ):
162 # Garbo should (or should not, if `expected_count=1`) remove LiveFS
163 # files of MIME type `content_type` that finished more than
164diff --git a/lib/lp/services/fields/__init__.py b/lib/lp/services/fields/__init__.py
165index 4c76094..63abc88 100644
166--- a/lib/lp/services/fields/__init__.py
167+++ b/lib/lp/services/fields/__init__.py
168@@ -621,7 +621,7 @@ class URIField(TextLine):
169 allow_query=True,
170 allow_fragment=True,
171 trailing_slash=None,
172- **kwargs
173+ **kwargs,
174 ):
175 super().__init__(**kwargs)
176 self.allowed_schemes = set(allowed_schemes)
177@@ -1019,7 +1019,7 @@ class SnapBuildChannelsField(Dict):
178 description_prefix=None,
179 description=None,
180 extra_snap_names=None,
181- **kwargs
182+ **kwargs,
183 ):
184 snap_names = list(self._core_snap_names)
185 if extra_snap_names is not None:
186diff --git a/lib/lp/services/job/celeryjob.py b/lib/lp/services/job/celeryjob.py
187index b9731f3..b240afa 100644
188--- a/lib/lp/services/job/celeryjob.py
189+++ b/lib/lp/services/job/celeryjob.py
190@@ -119,7 +119,7 @@ class PrefixedTask(Task):
191 link=None,
192 link_error=None,
193 shadow=None,
194- **options
195+ **options,
196 ):
197 """Create a task_id if none is specified.
198
199diff --git a/lib/lp/services/macaroons/interfaces.py b/lib/lp/services/macaroons/interfaces.py
200index 393370d..37db08d 100644
201--- a/lib/lp/services/macaroons/interfaces.py
202+++ b/lib/lp/services/macaroons/interfaces.py
203@@ -57,7 +57,7 @@ class IMacaroonIssuerPublic(Interface):
204 require_context=True,
205 errors=None,
206 user=None,
207- **kwargs
208+ **kwargs,
209 ):
210 """Verify that `macaroon` is valid for `context`.
211
212diff --git a/lib/lp/services/timeout.py b/lib/lp/services/timeout.py
213index 2c4c3fa..99a4847 100644
214--- a/lib/lp/services/timeout.py
215+++ b/lib/lp/services/timeout.py
216@@ -346,7 +346,7 @@ class URLFetcher:
217 allow_file=False,
218 output_file=None,
219 check_status=True,
220- **request_kwargs
221+ **request_kwargs,
222 ):
223 """Fetch the URL using a custom HTTP handler supporting timeout.
224
225diff --git a/lib/lp/services/webapp/servers.py b/lib/lp/services/webapp/servers.py
226index 53db3f4..1bed9ee 100644
227--- a/lib/lp/services/webapp/servers.py
228+++ b/lib/lp/services/webapp/servers.py
229@@ -977,7 +977,7 @@ class LaunchpadTestRequest(
230 outstream=None,
231 method="GET",
232 force_fresh_login_for_testing=False,
233- **kw
234+ **kw,
235 ):
236 # PEP 3333 requires environment variables to be native strings that
237 # contain only code points representable in ISO-8859-1. To support
238diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py
239index 3cc6d7f..167dfdb 100644
240--- a/lib/lp/snappy/tests/test_snap.py
241+++ b/lib/lp/snappy/tests/test_snap.py
242@@ -3771,7 +3771,7 @@ class TestSnapWebservice(TestCaseWithFactory):
243 private=False,
244 auto_build_archive=None,
245 auto_build_pocket=None,
246- **kwargs
247+ **kwargs,
248 ):
249 if owner is None:
250 owner = self.person
251diff --git a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py
252index f415d0e..c999a9c 100644
253--- a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py
254+++ b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py
255@@ -176,7 +176,7 @@ class TestSourcesList(TestCaseWithFactory):
256 self,
257 signing_key_name="ppa-sample@canonical.com",
258 publish_binary=False,
259- **kwargs
260+ **kwargs,
261 ):
262 try:
263 getattr(config, "in-process-key-server-fixture")
264diff --git a/lib/lp/soyuz/mail/packageupload.py b/lib/lp/soyuz/mail/packageupload.py
265index 1bcd8be..7d16641 100644
266--- a/lib/lp/soyuz/mail/packageupload.py
267+++ b/lib/lp/soyuz/mail/packageupload.py
268@@ -482,7 +482,7 @@ class PackageUploadMailer(BaseMailer):
269 announce_from_person=None,
270 previous_version=None,
271 logger=None,
272- **kwargs
273+ **kwargs,
274 ):
275 info = fetch_information(
276 spr, bprs, changes, previous_version=previous_version
277diff --git a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py
278index fabff3d..142e97c 100644
279--- a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py
280+++ b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py
281@@ -59,7 +59,7 @@ class TestLiveFSBuildBehaviourBase(TestCaseWithFactory):
282 archive=None,
283 pocket=PackagePublishingPocket.RELEASE,
284 with_builder=False,
285- **kwargs
286+ **kwargs,
287 ):
288 """Create a sample `ILiveFSBuildBehaviour`."""
289 if archive is None:
290diff --git a/lib/lp/soyuz/tests/test_packagecopyjob.py b/lib/lp/soyuz/tests/test_packagecopyjob.py
291index 3716d63..e414e11 100644
292--- a/lib/lp/soyuz/tests/test_packagecopyjob.py
293+++ b/lib/lp/soyuz/tests/test_packagecopyjob.py
294@@ -1133,7 +1133,7 @@ class PlainPackageCopyJobTests(TestCaseWithFactory, LocalTestHelper):
295 target_pocket=PackagePublishingPocket.RELEASE,
296 include_binaries=False,
297 requester=None,
298- **kwargs
299+ **kwargs,
300 ):
301 # Helper method to create a package copy job from an SPPH.
302 source = getUtility(IPlainPackageCopyJobSource)
303diff --git a/lib/lp/soyuz/tests/test_publishing.py b/lib/lp/soyuz/tests/test_publishing.py
304index 00ccd25..efcc4dd 100644
305--- a/lib/lp/soyuz/tests/test_publishing.py
306+++ b/lib/lp/soyuz/tests/test_publishing.py
307@@ -2207,7 +2207,7 @@ class TestChangeOverride(TestNativePublishingBase):
308 binary=False,
309 format=None,
310 ddeb=False,
311- **kwargs
312+ **kwargs,
313 ):
314 self.distroseries.status = status
315 get_pub_kwargs = {"pocket": pocket, "channel": channel}
316@@ -2230,7 +2230,7 @@ class TestChangeOverride(TestNativePublishingBase):
317 status=SeriesStatus.DEVELOPMENT,
318 pocket=PackagePublishingPocket.RELEASE,
319 channel=None,
320- **kwargs
321+ **kwargs,
322 ):
323 new_pub = self.setUpOverride(
324 status=status, pocket=pocket, channel=channel, **kwargs
325diff --git a/lib/lp/testing/__init__.py b/lib/lp/testing/__init__.py
326index 4e73ec9..4b6e0c6 100644
327--- a/lib/lp/testing/__init__.py
328+++ b/lib/lp/testing/__init__.py
329@@ -898,7 +898,7 @@ class TestCaseWithFactory(TestCase):
330 product=None,
331 db_branch=None,
332 format=None,
333- **kwargs
334+ **kwargs,
335 ):
336 """Create a database branch, bzr branch and bzr checkout.
337
338diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
339index cc882f1..841baea 100644
340--- a/lib/lp/testing/factory.py
341+++ b/lib/lp/testing/factory.py
342@@ -1265,7 +1265,7 @@ class LaunchpadObjectFactory(ObjectFactory):
343 sourcepackage=None,
344 reviewer=None,
345 target=None,
346- **optional_branch_args
347+ **optional_branch_args,
348 ):
349 """Create and return a new, arbitrary Branch of the given type.
350
351@@ -1399,7 +1399,7 @@ class LaunchpadObjectFactory(ObjectFactory):
352 distroseries=None,
353 sourcepackagename=None,
354 owner=None,
355- **kwargs
356+ **kwargs,
357 ):
358 """Make a package branch on an arbitrary package.
359
360@@ -2059,7 +2059,7 @@ class LaunchpadObjectFactory(ObjectFactory):
361 registrant=None,
362 name=None,
363 information_type=None,
364- **optional_repository_args
365+ **optional_repository_args,
366 ):
367 """Create and return a new, arbitrary GitRepository.
368
369@@ -2151,7 +2151,7 @@ class LaunchpadObjectFactory(ObjectFactory):
370 ref_pattern="refs/heads/*",
371 creator=None,
372 position=None,
373- **repository_kwargs
374+ **repository_kwargs,
375 ):
376 """Create a Git repository access rule."""
377 if repository is None:
378@@ -2171,7 +2171,7 @@ class LaunchpadObjectFactory(ObjectFactory):
379 can_create=False,
380 can_push=False,
381 can_force_push=False,
382- **rule_kwargs
383+ **rule_kwargs,
384 ):
385 """Create a Git repository access grant."""
386 if rule is None:
387@@ -3630,7 +3630,7 @@ class LaunchpadObjectFactory(ObjectFactory):
388 processor=None,
389 supports_virtualized=True,
390 supports_nonvirtualized=True,
391- **kwargs
392+ **kwargs,
393 ):
394 if architecturetag is None:
395 architecturetag = self.getUniqueUnicode("arch")
396@@ -5012,7 +5012,7 @@ class LaunchpadObjectFactory(ObjectFactory):
397 packageupload=None,
398 spr_creator=None,
399 channel=None,
400- **kwargs
401+ **kwargs,
402 ):
403 """Make a `SourcePackagePublishingHistory`.
404
405@@ -6091,7 +6091,7 @@ class LaunchpadObjectFactory(ObjectFactory):
406 status=BuildStatus.NEEDSBUILD,
407 builder=None,
408 duration=None,
409- **kwargs
410+ **kwargs,
411 ):
412 """Make a new LiveFSBuild."""
413 if requester is None:
414@@ -6331,7 +6331,7 @@ class LaunchpadObjectFactory(ObjectFactory):
415 builder=None,
416 duration=None,
417 target_architectures=None,
418- **kwargs
419+ **kwargs,
420 ):
421 """Make a new SnapBuild."""
422 if requester is None:
423@@ -6512,7 +6512,7 @@ class LaunchpadObjectFactory(ObjectFactory):
424 summary=None,
425 registrant=None,
426 oci_project=None,
427- **kwargs
428+ **kwargs,
429 ):
430 """Make a new OCIProjectSeries attached to an OCIProject."""
431 if name is None:
432@@ -6589,7 +6589,7 @@ class LaunchpadObjectFactory(ObjectFactory):
433 builder=None,
434 duration=None,
435 build_request=None,
436- **kwargs
437+ **kwargs,
438 ):
439 """Make a new OCIRecipeBuild."""
440 if requester is None:
441@@ -6810,7 +6810,7 @@ class LaunchpadObjectFactory(ObjectFactory):
442 status=BuildStatus.NEEDSBUILD,
443 builder=None,
444 duration=None,
445- **kwargs
446+ **kwargs,
447 ):
448 if recipe is None:
449 if registrant is None:
450diff --git a/lib/lp/testing/views.py b/lib/lp/testing/views.py
451index 123862c..03578ea 100644
452--- a/lib/lp/testing/views.py
453+++ b/lib/lp/testing/views.py
454@@ -37,7 +37,7 @@ def create_view(
455 path_info="/",
456 current_request=False,
457 rootsite=None,
458- **kwargs
459+ **kwargs,
460 ):
461 """Return a view based on the given arguments.
462
463@@ -106,7 +106,7 @@ def create_initialized_view(
464 path_info="/",
465 rootsite=None,
466 current_request=False,
467- **kwargs
468+ **kwargs,
469 ):
470 """Return a view that has already been initialized."""
471 if method is None:
472diff --git a/pyproject.toml b/pyproject.toml
473index c276370..2411fa8 100644
474--- a/pyproject.toml
475+++ b/pyproject.toml
476@@ -1,6 +1,6 @@
477 [tool.black]
478 line-length = 79
479-target-version = ['py35']
480+target-version = ['py38']
481
482 [tool.mypy]
483 python_version = "3.8"

Subscribers

People subscribed via source and target branches

to status/vote changes: