Merge lp:~jelmer/brz-debian/isort into lp:brz-debian

Proposed by Jelmer Vernooij
Status: Needs review
Proposed branch: lp:~jelmer/brz-debian/isort
Merge into: lp:brz-debian
Diff against target: 2581 lines (+411/-1023)
63 files modified
__init__.py (+10/-19)
apt_repo.py (+1/-2)
auto_backport.py (+6/-18)
builder.py (+3/-8)
bzrtools_import.py (+6/-18)
cmds.py (+59/-180)
config.py (+4/-11)
dep3.py (+3/-7)
directory.py (+4/-5)
extract.py (+3/-9)
import_dsc.py (+18/-41)
import_uncommitted.py (+11/-24)
info.py (+2/-1)
launchpad.py (+1/-3)
merge_changelog.py (+1/-5)
merge_package.py (+6/-14)
merge_upstream.py (+5/-14)
move_orphaned.py (+6/-11)
new_upstream.py (+42/-107)
quilt_refresh.py (+3/-7)
release.py (+2/-6)
repack_tarball.py (+7/-12)
revspec.py (+6/-11)
source_distiller.py (+4/-10)
tests/__init__.py (+7/-15)
tests/blackbox/test_builddeb.py (+1/-1)
tests/blackbox/test_debrelease.py (+2/-2)
tests/blackbox/test_dep3.py (+2/-2)
tests/blackbox/test_do.py (+1/-5)
tests/blackbox/test_get_tar.py (+1/-4)
tests/blackbox/test_import_dsc.py (+0/-1)
tests/blackbox/test_import_upstream.py (+1/-1)
tests/blackbox/test_merge_package.py (+2/-5)
tests/blackbox/test_merge_upstream.py (+3/-12)
tests/test_apt_repo.py (+0/-2)
tests/test_builder.py (+1/-6)
tests/test_bzrtools_import.py (+3/-5)
tests/test_commit_message.py (+2/-2)
tests/test_config.py (+1/-5)
tests/test_dep3.py (+6/-20)
tests/test_directory.py (+2/-7)
tests/test_extract.py (+10/-17)
tests/test_hooks.py (+1/-1)
tests/test_import_dsc.py (+8/-24)
tests/test_merge_changelog.py (+3/-7)
tests/test_merge_package.py (+0/-1)
tests/test_merge_upstream.py (+2/-7)
tests/test_repack_tarball.py (+3/-11)
tests/test_repack_tarball_extra.py (+2/-6)
tests/test_revspec.py (+3/-9)
tests/test_source_distiller.py (+5/-15)
tests/test_tagging.py (+1/-3)
tests/test_upstream.py (+27/-59)
tests/test_upstream_uscan.py (+4/-10)
tests/test_util.py (+17/-47)
update_packaging.py (+5/-5)
upstream/__init__.py (+7/-18)
upstream/branch.py (+18/-39)
upstream/pristinetar.py (+22/-52)
upstream/tags.py (+2/-3)
upstream/uscan.py (+5/-4)
util.py (+15/-40)
vcs_up_to_date.py (+3/-7)
To merge this branch: bzr merge lp:~jelmer/brz-debian/isort
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+436634@code.launchpad.net

Commit message

Sort Python import definitions

Description of the change

Sort Python import definitions with isort

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Unmerged revisions

1597. By Jelmer Vernooij

Sort Python import definitions with isort

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '__init__.py'
2--- __init__.py 2023-01-22 22:56:44 +0000
3+++ __init__.py 2023-01-31 19:12:08 +0000
4@@ -26,22 +26,15 @@
5 import os
6
7 import breezy # noqa: F401
8+
9+from ... import trace
10 from ...commands import plugin_cmds
11+from ...directory_service import AliasDirectory, directories
12 from ...hooks import install_lazy_named_hook
13-from ... import trace
14-
15-from .info import ( # noqa: F401
16- brz_plugin_version as version_info,
17-)
18-
19-from ...directory_service import (
20- AliasDirectory,
21- directories,
22- )
23-
24 from ...i18n import load_plugin_translations
25+from ...revisionspec import revspec_registry
26 from ...tag import tag_sort_methods
27-from ...revisionspec import revspec_registry
28+from .info import brz_plugin_version as version_info # noqa: F401
29
30 translation = load_plugin_translations("brz-debian")
31 gettext = translation.gettext
32@@ -148,11 +141,9 @@
33
34 def tree_debian_tag_name(tree, branch, subpath='', vendor=None):
35 from .config import BUILD_TYPE_MERGE
36- from .import_dsc import (
37- DistributionBranch, DistributionBranchSet)
38- from .util import (
39- debuild_config, find_changelog, MissingChangelogError,
40- suite_to_distribution)
41+ from .import_dsc import DistributionBranch, DistributionBranchSet
42+ from .util import (MissingChangelogError, debuild_config, find_changelog,
43+ suite_to_distribution)
44 config = debuild_config(tree, subpath=subpath)
45 try:
46 (changelog, top_level) = find_changelog(
47@@ -181,10 +172,10 @@
48
49
50 def pre_merge_fix_ancestry(merger):
51+ from ...workingtree import WorkingTree
52 from .config import BUILD_TYPE_NATIVE
53+ from .merge_package import fix_ancestry_as_needed
54 from .util import debuild_config
55- from .merge_package import fix_ancestry_as_needed
56- from ...workingtree import WorkingTree
57 if not isinstance(merger.this_tree, WorkingTree):
58 return
59 if getattr(merger, "other_branch", None) is None:
60
61=== modified file 'apt_repo.py'
62--- apt_repo.py 2023-01-12 11:16:09 +0000
63+++ apt_repo.py 2023-01-31 19:12:08 +0000
64@@ -23,9 +23,8 @@
65 import tempfile
66 from typing import Optional
67
68-from debian.deb822 import Dsc, Deb822
69-
70 from breezy.errors import DependencyNotPresent
71+from debian.deb822 import Deb822, Dsc
72
73
74 class NoAptSources(Exception):
75
76=== modified file 'auto_backport.py'
77--- auto_backport.py 2023-01-12 11:16:09 +0000
78+++ auto_backport.py 2023-01-31 19:12:08 +0000
79@@ -15,8 +15,6 @@
80 # along with this program; if not, write to the Free Software
81 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
82
83-from distro_info import DebianDistroInfo
84-
85 import json
86 import logging
87 import os
88@@ -27,27 +25,17 @@
89
90 from breezy.branch import Branch
91 from breezy.plugins.debian.apt_repo import RemoteApt
92+from breezy.plugins.debian.changelog import debcommit
93 from breezy.plugins.debian.cmds import _build_helper
94-from breezy.plugins.debian.changelog import (
95- debcommit,
96-)
97-from breezy.plugins.debian.directory import (
98- source_package_vcs_url,
99-)
100-from breezy.plugins.debian.info import (
101- versions_dict,
102-)
103-from breezy.plugins.debian.util import (
104- dput_changes,
105- find_changelog,
106-)
107+from breezy.plugins.debian.directory import source_package_vcs_url
108+from breezy.plugins.debian.info import versions_dict
109+from breezy.plugins.debian.util import dput_changes, find_changelog
110+from breezy.workingtree import WorkingTree
111 from breezy.workspace import check_clean_tree
112-from breezy.workingtree import WorkingTree
113-
114 from debian.changelog import format_date, get_maintainer
115 from debmutate.changelog import ChangelogEditor, changeblock_add_line
116 from debmutate.reformatting import GeneratedFile
117-
118+from distro_info import DebianDistroInfo
119
120 DEFAULT_BUILDER = "sbuild --no-clean-source"
121
122
123=== modified file 'builder.py'
124--- builder.py 2023-01-12 11:16:09 +0000
125+++ builder.py 2023-01-31 19:12:08 +0000
126@@ -18,21 +18,16 @@
127 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
128 #
129
130+import os
131 import shutil
132 import subprocess
133-import os
134 import tempfile
135
136 from ...errors import BzrError
137 from ...trace import note
138-
139 from .hooks import run_hook
140-from .util import (
141- get_parent_dir,
142- subprocess_setup,
143- find_changes_files,
144- dget_changes,
145- )
146+from .util import (dget_changes, find_changes_files, get_parent_dir,
147+ subprocess_setup)
148
149
150 class ChangesFileMissing(BzrError):
151
152=== modified file 'bzrtools_import.py'
153--- bzrtools_import.py 2023-01-12 11:16:09 +0000
154+++ bzrtools_import.py 2023-01-31 19:12:08 +0000
155@@ -3,30 +3,18 @@
156
157 """Import upstream source into a branch"""
158
159+from contextlib import ExitStack
160 from io import BytesIO
161
162-from ...upstream_import import (
163- add_implied_parents,
164- common_directory,
165- do_directory,
166- names_of_files,
167- DirWrapper,
168- )
169 from ...bzr import generate_ids
170-
171-from contextlib import ExitStack
172-
173 from ...errors import BzrError
174-from ...osutils import (
175- file_iterator,
176- basename,
177- splitpath,
178- normpath,
179- is_inside_any,
180- )
181+from ...osutils import (basename, file_iterator, is_inside_any, normpath,
182+ splitpath)
183 from ...trace import warning
184+from ...transform import resolve_conflicts
185 from ...tree import Tree
186-from ...transform import resolve_conflicts
187+from ...upstream_import import (DirWrapper, add_implied_parents,
188+ common_directory, do_directory, names_of_files)
189
190
191 class UnknownType(BzrError):
192
193=== modified file 'cmds.py'
194--- cmds.py 2023-01-22 22:56:44 +0000
195+++ cmds.py 2023-01-31 19:12:08 +0000
196@@ -26,44 +26,19 @@
197 import tempfile
198 from typing import Optional
199
200-from ... import (
201- urlutils,
202-)
203+from ... import urlutils
204 from ...branch import Branch
205-from ...controldir import (
206- ControlDir,
207- NoColocatedBranchSupport,
208-)
209 from ...commands import Command
210-from ...errors import (
211- BzrCommandError,
212- NotBranchError,
213- NotLocalUrl,
214- NoWorkingTree,
215-)
216-from ...transport import (
217- FileExists,
218- NoSuchFile,
219-)
220+from ...controldir import ControlDir, NoColocatedBranchSupport
221+from ...errors import (BzrCommandError, NotBranchError, NotLocalUrl,
222+ NoWorkingTree)
223 from ...option import Option
224 from ...trace import mutter, note, warning
225-from ...transport import get_transport
226+from ...transport import FileExists, NoSuchFile, get_transport
227 from ...workingtree import WorkingTree
228-
229-from . import (
230- default_build_dir,
231- default_orig_dir,
232- default_result_dir,
233- gettext,
234-)
235-from .config import (
236- BUILD_TYPE_MERGE,
237- BUILD_TYPE_NATIVE,
238- BUILD_TYPE_SPLIT,
239-)
240-from .util import (
241- debuild_config,
242-)
243+from . import default_build_dir, default_orig_dir, default_result_dir, gettext
244+from .config import BUILD_TYPE_MERGE, BUILD_TYPE_NATIVE, BUILD_TYPE_SPLIT
245+from .util import debuild_config
246
247 dont_purge_opt = Option(
248 'dont-purge',
249@@ -137,12 +112,8 @@
250
251 def _get_changelog_info(tree, subpath, last_version=None, package=None,
252 distribution=None):
253- from .util import (
254- find_changelog,
255- find_last_distribution,
256- lookup_distribution,
257- MissingChangelogError,
258- )
259+ from .util import (MissingChangelogError, find_changelog,
260+ find_last_distribution, lookup_distribution)
261 DEFAULT_FALLBACK_DISTRIBUTION = "debian"
262 current_version = last_version
263 try:
264@@ -187,9 +158,7 @@
265 if guess_upstream_url is None:
266 return None
267 export_upstream = guess_upstream_url
268- from .upstream.branch import (
269- LazyUpstreamBranchSource,
270- )
271+ from .upstream.branch import LazyUpstreamBranchSource
272 upstream_revision_map = {}
273 if export_upstream_revision:
274 upstream_revision_map[version] = export_upstream_revision
275@@ -206,18 +175,9 @@
276 trust_package=True,
277 guess_upstream_branch_url=False,
278 apt=None):
279- from .upstream import (
280- AptSource,
281- SelfSplitSource,
282- DirectoryScanSource,
283- )
284- from .upstream.uscan import (
285- UScanSource,
286- NoWatchFile,
287- )
288- from .upstream.pristinetar import (
289- get_pristine_tar_source,
290- )
291+ from .upstream import AptSource, DirectoryScanSource, SelfSplitSource
292+ from .upstream.pristinetar import get_pristine_tar_source
293+ from .upstream.uscan import NoWatchFile, UScanSource
294 yield AptSource(apt=apt)
295 yield get_pristine_tar_source(local_tree, packaging_branch)
296 try:
297@@ -227,9 +187,7 @@
298
299 if guess_upstream_branch_url:
300 try:
301- from upstream_ontologist.guess import (
302- guess_upstream_metadata,
303- )
304+ from upstream_ontologist.guess import guess_upstream_metadata
305 except ModuleNotFoundError:
306 guess_upstream_url = None
307 else:
308@@ -261,18 +219,10 @@
309 export_upstream=None, export_upstream_revision=None,
310 guess_upstream_branch_url=False,
311 apt=None):
312- from .util import (
313- guess_build_type,
314- )
315- from .upstream import (
316- UpstreamProvider,
317- )
318- from .source_distiller import (
319- FullSourceDistiller,
320- MergeModeDistiller,
321- NativeSourceDistiller,
322- DebcargoDistiller,
323- )
324+ from .source_distiller import (DebcargoDistiller, FullSourceDistiller,
325+ MergeModeDistiller, NativeSourceDistiller)
326+ from .upstream import UpstreamProvider
327+ from .util import guess_build_type
328
329 if build_type is None:
330 build_type = config.build_type
331@@ -495,18 +445,14 @@
332 strict=False, guess_upstream_branch_url=False,
333 apt_repository=None, apt_repository_key=None):
334 from debian.changelog import ChangelogParseError
335+
336 from .builder import DebBuild
337 from .config import UpstreamMetadataSyntaxError
338 from .hooks import run_hook
339 from .source_distiller import DebcargoError
340- from .util import (
341- NoPreviousUpload,
342- dget_changes,
343- find_changelog,
344- find_previous_upload,
345- tree_contains_upstream_source,
346- find_changes_files,
347- )
348+ from .util import (NoPreviousUpload, dget_changes, find_changelog,
349+ find_changes_files, find_previous_upload,
350+ tree_contains_upstream_source)
351
352 location, build_options, source = self._branch_and_build_options(
353 branch_or_build_options_list, source)
354@@ -630,20 +576,10 @@
355
356 def run(self, directory='.', version=None, apt_repository=None,
357 apt_repository_key=None):
358- from .upstream import (
359- AptSource,
360- UpstreamProvider,
361- )
362- from .upstream.uscan import (
363- UScanSource,
364- NoWatchFile,
365- )
366- from .upstream.pristinetar import (
367- get_pristine_tar_source,
368- )
369- from .util import (
370- find_changelog,
371- )
372+ from .upstream import AptSource, UpstreamProvider
373+ from .upstream.pristinetar import get_pristine_tar_source
374+ from .upstream.uscan import NoWatchFile, UScanSource
375+ from .util import find_changelog
376 tree, subpath = WorkingTree.open_containing(directory)
377 config = debuild_config(tree, subpath)
378
379@@ -794,30 +730,14 @@
380 from debian.changelog import Version
381
382 from .hooks import run_hook
383- from .merge_upstream import (
384- changelog_add_new_version,
385- do_merge,
386- get_tarballs,
387- )
388- from .upstream import (
389- PackageVersionNotPresent,
390- TarfileSource,
391- )
392- from .upstream.branch import (
393- PreviousVersionTagMissing,
394- UpstreamBranchSource,
395- run_dist_command,
396- )
397- from .upstream.uscan import (
398- UScanSource,
399- NoWatchFile,
400- )
401- from .util import (
402- detect_version_kind,
403- guess_build_type,
404- get_files_excluded,
405- tree_contains_upstream_source,
406- )
407+ from .merge_upstream import (changelog_add_new_version, do_merge,
408+ get_tarballs)
409+ from .upstream import PackageVersionNotPresent, TarfileSource
410+ from .upstream.branch import (PreviousVersionTagMissing,
411+ UpstreamBranchSource, run_dist_command)
412+ from .upstream.uscan import NoWatchFile, UScanSource
413+ from .util import (detect_version_kind, get_files_excluded,
414+ guess_build_type, tree_contains_upstream_source)
415
416 tree, subpath = WorkingTree.open_containing(directory)
417 with tree.lock_write():
418@@ -883,9 +803,8 @@
419 upstream_branch = Branch.open(config.upstream_branch)
420 elif upstream_branch is None and guess_upstream_branch_url:
421 try:
422- from upstream_ontologist.guess import (
423- guess_upstream_metadata,
424- )
425+ from upstream_ontologist.guess import \
426+ guess_upstream_metadata
427 except ModuleNotFoundError:
428 warning(
429 'upstream-ontologist not available, '
430@@ -1076,13 +995,8 @@
431 takes_options = [filename_opt]
432
433 def import_many(self, db, files_list, orig_target):
434- from .import_dsc import (
435- DscCache,
436- DscComp,
437- )
438- from .util import (
439- open_file_via_transport,
440- )
441+ from .import_dsc import DscCache, DscComp
442+ from .util import open_file_via_transport
443 cache = DscCache()
444 files_list.sort(key=DscComp(cache).key)
445 if not os.path.exists(orig_target):
446@@ -1104,15 +1018,8 @@
447 db.import_package(os.path.join(orig_target, filename))
448
449 def run(self, files_list, file=None):
450- from .import_dsc import (
451- DistributionBranch,
452- DistributionBranchSet,
453- )
454- from .util import (
455- find_changelog,
456- open_file,
457- MissingChangelogError,
458- )
459+ from .import_dsc import DistributionBranch, DistributionBranchSet
460+ from .util import MissingChangelogError, find_changelog, open_file
461 try:
462 tree, subpath = WorkingTree.open_containing('.')
463 except NotBranchError as e:
464@@ -1221,13 +1128,10 @@
465 def run(self, version, location, upstream_branch=None, revision=None,
466 force_pristine_tar=False):
467 from debian.changelog import Version
468- from .import_dsc import (
469- DistributionBranch,
470- DistributionBranchSet,
471- )
472- from .util import (
473- md5sum_filename,
474- )
475+
476+ from .import_dsc import DistributionBranch, DistributionBranchSet
477+ from .util import md5sum_filename
478+
479 # TODO: search for similarity etc.
480 branch, subpath = Branch.open_containing('.')
481 if upstream_branch is None:
482@@ -1333,29 +1237,15 @@
483 def run(self, command_list=None, no_preparation=False,
484 apt_repository=None, apt_repository_key=None):
485 import subprocess
486- from .source_distiller import (
487- MergeModeDistiller,
488- )
489- from .builder import (
490- BuildFailedError,
491- DebBuild,
492- )
493- from .upstream import (
494- AptSource,
495- UpstreamProvider,
496- )
497- from .upstream.uscan import (
498- UScanSource,
499- )
500- from .upstream.pristinetar import (
501- get_pristine_tar_source,
502- )
503+
504+ from .builder import BuildFailedError, DebBuild
505 from .hooks import run_hook
506- from .util import (
507- find_changelog,
508- guess_build_type,
509- tree_contains_upstream_source,
510- )
511+ from .source_distiller import MergeModeDistiller
512+ from .upstream import AptSource, UpstreamProvider
513+ from .upstream.pristinetar import get_pristine_tar_source
514+ from .upstream.uscan import UScanSource
515+ from .util import (find_changelog, guess_build_type,
516+ tree_contains_upstream_source)
517 t, subpath = WorkingTree.open_containing('.')
518 self.add_cleanup(t.lock_read().unlock)
519 config = debuild_config(t, subpath)
520@@ -1490,13 +1380,9 @@
521
522 def run(self, location=".", directory=".", revision=None,
523 no_upstream_check=False):
524- from .dep3 import (
525- determine_applied_upstream,
526- determine_forwarded,
527- describe_origin,
528- gather_bugs_and_authors,
529- write_dep3_patch,
530- )
531+ from .dep3 import (describe_origin, determine_applied_upstream,
532+ determine_forwarded, gather_bugs_and_authors,
533+ write_dep3_patch)
534 (packaging_tree,
535 packaging_branch) = ControlDir.open_containing_tree_or_branch(
536 directory)[:2]
537@@ -1589,13 +1475,8 @@
538 local_tree, subpath, packaging_branch, target_dir, builder,
539 guess_upstream_branch_url=False, apt=None):
540 # TODO(jelmer): Integrate this with cmd_builddeb
541- from .builder import (
542- do_build,
543- )
544- from .util import (
545- find_changelog,
546- tree_contains_upstream_source,
547- )
548+ from .builder import do_build
549+ from .util import find_changelog, tree_contains_upstream_source
550
551 (changelog, top_level) = find_changelog(
552 local_tree, subpath, merge=False, max_blocks=2)
553@@ -1642,9 +1523,7 @@
554 builder=DEFAULT_BUILDER, apt_repository=None,
555 apt_repository_key=None):
556 from .release import release
557- from .util import (
558- dput_changes,
559- )
560+ from .util import dput_changes
561
562 branch, subpath = Branch.open_containing(location)
563
564
565=== modified file 'config.py'
566--- config.py 2023-01-12 11:16:09 +0000
567+++ config.py 2023-01-31 19:12:08 +0000
568@@ -19,18 +19,12 @@
569 #
570
571 import yaml
572+from breezy.transport import NoSuchFile
573
574-from ...config import (
575- configobj,
576- ConfigObj,
577- TreeConfig,
578-)
579+from ...config import ConfigObj, TreeConfig, configobj
580 from ...errors import BzrError
581 from ...trace import mutter, warning
582
583-from breezy.transport import NoSuchFile
584-
585-
586 BUILD_TYPE_NORMAL = "normal"
587 BUILD_TYPE_NATIVE = "native"
588 BUILD_TYPE_MERGE = "merge"
589@@ -187,9 +181,8 @@
590 try:
591 # Imported here, since not everybody will have bzr-svn
592 # installed
593- from ..svn.config import (
594- SubversionBuildPackageConfig,
595- NoSubversionBuildPackageConfig)
596+ from ..svn.config import (NoSubversionBuildPackageConfig,
597+ SubversionBuildPackageConfig)
598 try:
599 self._tree_config = SvnBuildPackageMappedConfig(
600 SubversionBuildPackageConfig(tree))
601
602=== modified file 'dep3.py'
603--- dep3.py 2023-01-12 11:16:09 +0000
604+++ dep3.py 2023-01-31 19:12:08 +0000
605@@ -20,17 +20,13 @@
606
607 """DEP-3 style patch formatting."""
608
609+import time
610 from email.message import Message
611+from io import BytesIO
612
613-from ... import (
614- diff,
615- errors,
616- )
617 from breezy.foreign import foreign_vcs_registry
618
619-from io import BytesIO
620-
621-import time
622+from ... import diff, errors
623
624
625 def write_dep3_bug_line(message, bug_url, status):
626
627=== modified file 'directory.py'
628--- directory.py 2023-01-12 11:16:09 +0000
629+++ directory.py 2023-01-31 19:12:08 +0000
630@@ -18,16 +18,15 @@
631 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
632 #
633
634+from debian.changelog import Version
635+from debian.deb822 import Deb822
636+from debmutate.vcs import source_package_vcs, split_vcs_url
637+
638 from ... import urlutils
639 from ...directory_service import directories
640 from ...errors import DependencyNotPresent
641 from ...trace import note, warning
642
643-from debian.deb822 import Deb822
644-from debian.changelog import Version
645-
646-from debmutate.vcs import source_package_vcs, split_vcs_url
647-
648
649 def fixup_broken_git_url(url):
650 """Attempt to fix up broken Git URLs.
651
652=== modified file 'extract.py'
653--- extract.py 2023-01-12 11:16:09 +0000
654+++ extract.py 2023-01-31 19:12:08 +0000
655@@ -19,23 +19,17 @@
656 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
657 #
658
659-from contextlib import ExitStack
660 import os
661 import subprocess
662 import tempfile
663+from contextlib import ExitStack
664
665 from debian.changelog import Version
666
667 from ... import osutils
668 from ...trace import mutter
669-
670-from .util import (
671- FORMAT_1_0,
672- FORMAT_3_0_QUILT,
673- FORMAT_3_0_NATIVE,
674- component_from_orig_tarball,
675- subprocess_setup,
676-)
677+from .util import (FORMAT_1_0, FORMAT_3_0_NATIVE, FORMAT_3_0_QUILT,
678+ component_from_orig_tarball, subprocess_setup)
679
680
681 class SourceExtractor:
682
683=== modified file 'import_dsc.py'
684--- import_dsc.py 2023-01-30 23:43:15 +0000
685+++ import_dsc.py 2023-01-31 19:12:08 +0000
686@@ -26,60 +26,37 @@
687 #
688
689 import calendar
690-from contextlib import contextmanager, ExitStack
691 import os
692 import stat
693+import tarfile
694 import tempfile
695-import tarfile
696+from contextlib import ExitStack, contextmanager
697 from typing import Optional
698
699+from debian.changelog import Changelog, Version, VersionError
700+from debmutate.versions import mangle_version_for_git
701+
702 from debian import deb822
703-from debian.changelog import Version, Changelog, VersionError
704-from debmutate.versions import mangle_version_for_git
705
706+from ... import controldir
707 from ...branch import Branch
708-from ... import (
709- controldir,
710-)
711 from ...config import ConfigObj
712-from ...errors import (
713- BzrError,
714- AlreadyBranchError,
715- NotBranchError,
716- NoRoundtrippingSupport,
717- NoSuchTag,
718- NoWorkingTree,
719- UnrelatedBranches,
720- )
721+from ...errors import (AlreadyBranchError, BzrError, NoRoundtrippingSupport,
722+ NoSuchTag, NotBranchError, NoWorkingTree,
723+ UnrelatedBranches)
724 from ...revision import NULL_REVISION, RevisionID
725-from ...trace import warning, mutter
726-from ...transport import (
727- get_transport,
728- )
729+from ...trace import mutter, warning
730+from ...transport import get_transport
731 from ...tree import Tree
732-
733 from .bzrtools_import import import_dir
734-from .errors import (
735- MultipleUpstreamTarballsNotSupported,
736- )
737+from .errors import MultipleUpstreamTarballsNotSupported
738 from .extract import extract
739-from .util import (
740- export_with_nested,
741- extract_orig_tarball,
742- get_commit_info_from_changelog,
743- md5sum_filename,
744- open_file_via_transport,
745- open_transport,
746- )
747-from .upstream import (
748- PackageVersionNotPresent,
749- )
750-from .upstream.branch import (
751- PreviousVersionTagMissing,
752- )
753-from .upstream.pristinetar import (
754- get_pristine_tar_source,
755- )
756+from .upstream import PackageVersionNotPresent
757+from .upstream.branch import PreviousVersionTagMissing
758+from .upstream.pristinetar import get_pristine_tar_source
759+from .util import (export_with_nested, extract_orig_tarball,
760+ get_commit_info_from_changelog, md5sum_filename,
761+ open_file_via_transport, open_transport)
762
763
764 class CorruptUpstreamSourceFile(BzrError):
765
766=== modified file 'import_uncommitted.py'
767--- import_uncommitted.py 2023-01-31 01:21:05 +0000
768+++ import_uncommitted.py 2023-01-31 19:12:08 +0000
769@@ -18,50 +18,37 @@
770 import contextlib
771 import errno
772 import json
773-from hashlib import sha1
774 import logging
775 import os
776 import subprocess
777 import tempfile
778+from hashlib import sha1
779 from typing import Optional
780-
781+from urllib.error import HTTPError, URLError
782 from urllib.request import urlopen
783-from urllib.error import HTTPError, URLError
784-
785-from debmutate.control import ControlEditor
786-from debmutate.changelog import ChangelogEditor, distribution_is_unreleased
787
788 import breezy.bzr # noqa: F401
789 import breezy.git # noqa: F401
790 from breezy import urlutils
791-from breezy.errors import (
792- NotBranchError, NoSuchTag, ConflictsInTree, NoSuchRevisionInTree)
793-from breezy.revision import RevisionID, NULL_REVISION
794+from breezy.errors import (ConflictsInTree, NoSuchRevisionInTree, NoSuchTag,
795+ NotBranchError)
796+from breezy.revision import NULL_REVISION, RevisionID
797 from breezy.trace import note, warning
798 from breezy.transform import MalformedTransform
799+from breezy.transport import NoSuchFile
800 from breezy.tree import Tree
801-
802-from breezy.transport import NoSuchFile
803 from breezy.workingtree import WorkingTree
804-
805 from debian.changelog import Changelog, Version
806+from debmutate.changelog import ChangelogEditor, distribution_is_unreleased
807+from debmutate.control import ControlEditor
808
809+from .apt_repo import Apt, AptSourceError, LocalApt, NoAptSources, RemoteApt
810 from .changelog import debcommit
811 from .directory import vcs_git_url_to_bzr_url
812+from .import_dsc import (DistributionBranch, DistributionBranchSet,
813+ VersionAlreadyImported)
814 from .info import versions_dict
815 from .upstream import PackageVersionNotPresent
816-from .import_dsc import (
817- DistributionBranch,
818- DistributionBranchSet,
819- VersionAlreadyImported,
820-)
821-from .apt_repo import (
822- Apt,
823- LocalApt,
824- RemoteApt,
825- NoAptSources,
826- AptSourceError,
827-)
828
829 BRANCH_NAME = "missing-commits"
830
831
832=== modified file 'info.py'
833--- info.py 2022-10-16 17:18:34 +0000
834+++ info.py 2023-01-31 19:12:08 +0000
835@@ -30,8 +30,9 @@
836
837 def versions_dict():
838 import breezy
839+ import debmutate
840+
841 import debian
842- import debmutate
843 return {
844 'python-debian': debian.__version__,
845 'debmutate': debmutate.version_string,
846
847=== modified file 'launchpad.py'
848--- launchpad.py 2022-10-16 17:18:34 +0000
849+++ launchpad.py 2023-01-31 19:12:08 +0000
850@@ -18,9 +18,7 @@
851 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
852 #
853
854-from ...trace import (
855- mutter,
856-)
857+from ...trace import mutter
858
859 try:
860 from launchpadlib.launchpad import Launchpad
861
862=== modified file 'merge_changelog.py'
863--- merge_changelog.py 2023-01-12 17:15:19 +0000
864+++ merge_changelog.py 2023-01-31 19:12:08 +0000
865@@ -22,11 +22,7 @@
866 import subprocess
867 import tempfile
868
869-from ... import (
870- merge,
871- osutils,
872- )
873-
874+from ... import merge, osutils
875
876 # A logger in the 'bzr' hierarchy. By default messages will be propagated to
877 # the standard bzr logger, but tests can easily intercept just this logger if
878
879=== modified file 'merge_package.py'
880--- merge_package.py 2023-01-22 22:56:44 +0000
881+++ merge_package.py 2023-01-31 19:12:08 +0000
882@@ -27,24 +27,15 @@
883 import re
884 import tempfile
885
886+from breezy.errors import (BzrError, ConflictsInTree, NoSuchTag,
887+ UnrelatedBranches)
888+from breezy.workingtree import PointlessMerge
889 from debian.changelog import Version
890 from debian.deb822 import Deb822
891
892-from breezy.errors import (
893- BzrError,
894- ConflictsInTree,
895- NoSuchTag,
896- UnrelatedBranches,
897- )
898-from breezy.workingtree import (
899- PointlessMerge,
900- )
901-
902 from .changelog import debcommit
903 from .directory import vcs_field_to_bzr_url_converters
904-from .errors import (
905- MultipleUpstreamTarballsNotSupported,
906-)
907+from .errors import MultipleUpstreamTarballsNotSupported
908 from .import_dsc import DistributionBranch
909 from .util import find_changelog
910
911@@ -214,10 +205,11 @@
912
913 def main(argv=None):
914 import argparse
915+
916 import breezy.bzr # noqa: F401
917 import breezy.git # noqa: F401
918+ from breezy.branch import Branch
919 from breezy.workingtree import WorkingTree
920- from breezy.branch import Branch
921
922 from .apt_repo import RemoteApt
923 from .directory import source_package_vcs_url
924
925=== modified file 'merge_upstream.py'
926--- merge_upstream.py 2023-01-22 22:56:44 +0000
927+++ merge_upstream.py 2023-01-31 19:12:08 +0000
928@@ -35,21 +35,12 @@
929 from ... import osutils
930 from ...revision import NULL_REVISION
931 from ...trace import note
932-
933-from .import_dsc import (
934- DistributionBranch,
935- DistributionBranchSet,
936- UpstreamAlreadyImported,
937-)
938+from .import_dsc import (DistributionBranch, DistributionBranchSet,
939+ UpstreamAlreadyImported)
940 from .repack_tarball import repack_tarball
941-from .util import (
942- component_from_orig_tarball,
943- tarball_name,
944- FORMAT_3_0_QUILT,
945- FORMAT_3_0_NATIVE,
946- tree_get_source_format,
947-)
948-
949+from .util import (FORMAT_3_0_NATIVE, FORMAT_3_0_QUILT,
950+ component_from_orig_tarball, tarball_name,
951+ tree_get_source_format)
952
953 TAG_PREFIX = "upstream-"
954
955
956=== modified file 'move_orphaned.py'
957--- move_orphaned.py 2023-01-27 18:04:21 +0000
958+++ move_orphaned.py 2023-01-31 19:12:08 +0000
959@@ -15,28 +15,24 @@
960 # along with this program; if not, write to the Free Software
961 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
962
963-from contextlib import ExitStack
964 import json
965 import logging
966 import os
967 import sys
968+from contextlib import ExitStack
969 from urllib.parse import urlparse
970
971 import breezy.bzr # noqa: F401
972 import breezy.git # noqa: F401
973-
974 from breezy import osutils
975 from breezy.branch import Branch
976+from breezy.plugins.debian.directory import vcs_git_url_to_bzr_url
977+from breezy.plugins.debian.info import versions_dict
978 from breezy.workingtree import WorkingTree
979-
980 from debmutate.changelog import ChangelogEditor
981 from debmutate.control import ControlEditor
982 from debmutate.deb822 import ChangeConflict
983-from debmutate.reformatting import GeneratedFile, FormattingUnpreservable
984-
985-from breezy.plugins.debian.info import versions_dict
986-from breezy.plugins.debian.directory import vcs_git_url_to_bzr_url
987-
988+from debmutate.reformatting import FormattingUnpreservable, GeneratedFile
989
990 BRANCH_NAME = "orphan"
991 QA_MAINTAINER = "Debian QA Group <packages@qa.debian.org>"
992@@ -45,10 +41,9 @@
993 def push_to_salsa(local_tree, orig_branch, user, name, dry_run=False):
994 from breezy import urlutils
995 from breezy.branch import Branch
996- from breezy.errors import PermissionDenied, AlreadyControlDirError
997+ from breezy.errors import AlreadyControlDirError, PermissionDenied
998+ from breezy.forge import ForgeLoginRequired, UnsupportedForge, get_forge
999 from breezy.plugins.gitlab.forge import GitLab
1000- from breezy.forge import UnsupportedForge, get_forge, ForgeLoginRequired
1001-
1002 from silver_platter import pick_additional_colocated_branches
1003 from silver_platter.proposal import push_changes
1004
1005
1006=== modified file 'new_upstream.py'
1007--- new_upstream.py 2023-01-22 22:56:44 +0000
1008+++ new_upstream.py 2023-01-31 19:12:08 +0000
1009@@ -25,115 +25,55 @@
1010 import ssl
1011 import tempfile
1012 import traceback
1013-from typing import Optional, Callable, Union
1014+from typing import Callable, Optional, Union
1015
1016-from breezy.bzr import LineEndingError
1017-from breezy.git.remote import RemoteGitError
1018 import breezy.plugins.launchpad # noqa: F401
1019-from breezy.workingtree import WorkingTree
1020-
1021-from debian.changelog import Version, ChangelogParseError
1022-
1023 from breezy import errors, urlutils
1024-
1025 from breezy.branch import Branch
1026+from breezy.bzr import LineEndingError
1027 from breezy.controldir import ControlDir
1028-from breezy.errors import (
1029- InvalidNormalization,
1030- NoCommits,
1031- InvalidHttpResponse,
1032- NoRoundtrippingSupport,
1033- UncommittedChanges,
1034-)
1035-from breezy.transport import (
1036- FileExists,
1037- NoSuchFile,
1038- UnsupportedProtocol,
1039-)
1040-
1041-from breezy.workingtree import PointlessMerge
1042-from breezy.transport import (
1043- Transport,
1044- UnusableRedirect,
1045- get_transport,
1046- )
1047-from .config import UpstreamMetadataSyntaxError
1048-from .info import versions_dict
1049-from .util import (
1050- InconsistentSourceFormatError,
1051-)
1052-from .import_dsc import (
1053- UpstreamAlreadyImported,
1054- UpstreamBranchAlreadyMerged,
1055- CorruptUpstreamSourceFile,
1056-)
1057-from .changelog import debcommit
1058-
1059+from breezy.errors import (InvalidHttpResponse, InvalidNormalization,
1060+ NoCommits, NoRoundtrippingSupport,
1061+ UncommittedChanges)
1062+from breezy.git.remote import RemoteGitError
1063 from breezy.transform import MalformedTransform
1064-
1065-from .merge_upstream import (
1066- get_upstream_branch_location,
1067- do_import,
1068- do_merge,
1069- get_existing_imported_upstream_revids,
1070- get_tarballs,
1071-)
1072-from .repack_tarball import (
1073- UnsupportedRepackFormat,
1074-)
1075-
1076-from .upstream.pristinetar import (
1077- PristineTarError,
1078- get_pristine_tar_source,
1079-)
1080-
1081-from .util import (
1082- debuild_config,
1083- guess_build_type,
1084- get_files_excluded,
1085- tree_contains_upstream_source,
1086- BUILD_TYPE_MERGE,
1087- BUILD_TYPE_NATIVE,
1088- find_changelog,
1089- MissingChangelogError,
1090- control_files_in_root,
1091- full_branch_url,
1092-)
1093-
1094-from .upstream import (
1095- TarfileSource,
1096- MissingUpstreamTarball,
1097- PackageVersionNotPresent,
1098-)
1099-from .upstream.uscan import (
1100- UScanSource,
1101- UScanError,
1102- NoWatchFile,
1103- WatchLineWithoutMatches,
1104- WatchLineWithoutMatchingHrefs,
1105-)
1106-from .upstream.branch import (
1107- UpstreamBranchSource,
1108- DistCommandFailed,
1109- run_dist_command,
1110- PreviousVersionTagMissing,
1111-)
1112-
1113+from breezy.transport import (FileExists, NoSuchFile, Transport,
1114+ UnsupportedProtocol, UnusableRedirect,
1115+ get_transport)
1116+from breezy.tree import MissingNestedTree, Tree
1117+from breezy.workingtree import PointlessMerge, WorkingTree
1118+from debian.changelog import ChangelogParseError, Version
1119 from debmutate.changelog import ChangelogEditor, upstream_merge_changelog_line
1120 from debmutate.reformatting import GeneratedFile
1121-from debmutate.versions import (
1122- add_dfsg_suffix,
1123- strip_dfsg_suffix,
1124- matches_release,
1125- new_upstream_package_version,
1126- initial_debian_revision,
1127- debianize_upstream_version,
1128- )
1129-
1130 from debmutate.vcs import split_vcs_url
1131+from debmutate.versions import (add_dfsg_suffix, debianize_upstream_version,
1132+ initial_debian_revision, matches_release,
1133+ new_upstream_package_version,
1134+ strip_dfsg_suffix)
1135 from debmutate.watch import WatchSyntaxError
1136
1137-from breezy.tree import Tree, MissingNestedTree
1138+from .changelog import debcommit
1139+from .config import UpstreamMetadataSyntaxError
1140+from .import_dsc import (CorruptUpstreamSourceFile, UpstreamAlreadyImported,
1141+ UpstreamBranchAlreadyMerged)
1142+from .info import versions_dict
1143+from .merge_upstream import (do_import, do_merge,
1144+ get_existing_imported_upstream_revids,
1145+ get_tarballs, get_upstream_branch_location)
1146+from .repack_tarball import UnsupportedRepackFormat
1147+from .upstream import (MissingUpstreamTarball, PackageVersionNotPresent,
1148+ TarfileSource)
1149+from .upstream.branch import (DistCommandFailed, PreviousVersionTagMissing,
1150+ UpstreamBranchSource, run_dist_command)
1151+from .upstream.pristinetar import PristineTarError, get_pristine_tar_source
1152+from .upstream.uscan import (NoWatchFile, UScanError, UScanSource,
1153+ WatchLineWithoutMatches,
1154+ WatchLineWithoutMatchingHrefs)
1155+from .util import (BUILD_TYPE_MERGE, BUILD_TYPE_NATIVE,
1156+ InconsistentSourceFormatError, MissingChangelogError,
1157+ control_files_in_root, debuild_config, find_changelog,
1158+ full_branch_url, get_files_excluded, guess_build_type,
1159+ tree_contains_upstream_source)
1160
1161
1162 class BigVersionJump(Exception):
1163@@ -1574,9 +1514,7 @@
1164 )
1165
1166 if args.update_packaging:
1167- from .update_packaging import (
1168- update_packaging,
1169- )
1170+ from .update_packaging import update_packaging
1171 old_tree = local_tree.branch.repository.revision_tree(
1172 result.old_revision
1173 )
1174@@ -1589,12 +1527,9 @@
1175 patch_series_path = os.path.join(subpath, "debian/patches/series")
1176 if args.refresh_patches and local_tree.has_filename(
1177 patch_series_path):
1178- from .quilt_refresh import (
1179- QuiltError,
1180- QuiltPatchPushFailure,
1181- QuiltPatchDoesNotApply,
1182- refresh_quilt_patches,
1183- )
1184+ from .quilt_refresh import (QuiltError, QuiltPatchDoesNotApply,
1185+ QuiltPatchPushFailure,
1186+ refresh_quilt_patches)
1187 logging.info("Refresh quilt patches.")
1188 try:
1189 refresh_quilt_patches(
1190
1191=== modified file 'quilt_refresh.py'
1192--- quilt_refresh.py 2022-10-30 19:51:53 +0000
1193+++ quilt_refresh.py 2023-01-31 19:12:08 +0000
1194@@ -21,15 +21,11 @@
1195 import re
1196 from typing import Optional
1197
1198-from debmutate.changelog import ChangelogEditor
1199+from breezy.commit import PointlessCommit
1200 from breezy.plugins.debian.changelog import debcommit
1201-from breezy.commit import PointlessCommit
1202+from breezy.plugins.quilt.quilt import QuiltError, QuiltPatches
1203 from breezy.tree import Tree
1204-
1205-from breezy.plugins.quilt.quilt import (
1206- QuiltError,
1207- QuiltPatches,
1208-)
1209+from debmutate.changelog import ChangelogEditor
1210
1211
1212 class QuiltPatchPushFailure(Exception):
1213
1214=== modified file 'release.py'
1215--- release.py 2022-10-16 17:18:34 +0000
1216+++ release.py 2023-01-31 19:12:08 +0000
1217@@ -20,14 +20,10 @@
1218
1219 import os
1220
1221-from debmutate.changelog import (
1222- release as mark_for_release,
1223- ChangelogEditor,
1224- distribution_is_unreleased
1225-)
1226+from debmutate.changelog import ChangelogEditor, distribution_is_unreleased
1227+from debmutate.changelog import release as mark_for_release
1228
1229 from .changelog import debcommit_release
1230-
1231 from .util import find_changelog
1232
1233
1234
1235=== modified file 'repack_tarball.py'
1236--- repack_tarball.py 2023-01-12 11:16:09 +0000
1237+++ repack_tarball.py 2023-01-31 19:12:08 +0000
1238@@ -18,23 +18,18 @@
1239 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1240 #
1241
1242+import bz2
1243 import gzip
1244+import hashlib
1245 import os
1246-from io import BytesIO
1247+import shutil
1248 import tarfile
1249-import bz2
1250-import hashlib
1251-
1252-import shutil
1253 import time
1254 import zipfile
1255-
1256-from ...errors import (
1257- BzrError,
1258- DependencyNotPresent,
1259-)
1260-from ...transport import get_transport, FileExists
1261-
1262+from io import BytesIO
1263+
1264+from ...errors import BzrError, DependencyNotPresent
1265+from ...transport import FileExists, get_transport
1266 from .util import open_file, open_file_via_transport
1267
1268
1269
1270=== modified file 'revspec.py'
1271--- revspec.py 2023-01-22 22:56:44 +0000
1272+++ revspec.py 2023-01-31 19:12:08 +0000
1273@@ -18,11 +18,8 @@
1274 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1275 #
1276
1277-from ...errors import (
1278- NoSuchTag,
1279- BzrError,
1280- )
1281-from ...revisionspec import RevisionSpec, RevisionInfo, InvalidRevisionSpec
1282+from ...errors import BzrError, NoSuchTag
1283+from ...revisionspec import InvalidRevisionSpec, RevisionInfo, RevisionSpec
1284
1285
1286 class UnknownVersion(BzrError):
1287@@ -77,14 +74,12 @@
1288 prefix = 'upstream:'
1289
1290 def _match_on(self, branch, revs=None):
1291+ from debian.changelog import Version
1292+
1293 from ...workingtree import WorkingTree
1294- from .util import (
1295- find_changelog,
1296- MissingChangelogError,
1297- )
1298+ from .upstream import StackedUpstreamSource
1299 from .upstream.pristinetar import get_pristine_tar_source
1300- from .upstream import StackedUpstreamSource
1301- from debian.changelog import Version
1302+ from .util import MissingChangelogError, find_changelog
1303 tree, subpath = WorkingTree.open_containing('.')
1304 try:
1305 (cl, top_level) = find_changelog(tree, subpath, merge=False)
1306
1307=== modified file 'source_distiller.py'
1308--- source_distiller.py 2023-01-12 11:16:09 +0000
1309+++ source_distiller.py 2023-01-31 19:12:08 +0000
1310@@ -17,23 +17,17 @@
1311 # along with bzr-builddeb; if not, write to the Free Software
1312 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1313
1314-from debian.changelog import Changelog
1315-
1316 import os
1317 import shutil
1318 import subprocess
1319 import tempfile
1320
1321+from debian.changelog import Changelog
1322+
1323 from ... import errors as bzr_errors
1324 from ...trace import note
1325-
1326-from ...transport import NoSuchFile, FileExists
1327-
1328-from .util import (
1329- export_with_nested,
1330- extract_orig_tarballs,
1331- get_parent_dir,
1332- )
1333+from ...transport import FileExists, NoSuchFile
1334+from .util import export_with_nested, extract_orig_tarballs, get_parent_dir
1335
1336
1337 class SourceDistiller:
1338
1339=== modified file 'tests/__init__.py'
1340--- tests/__init__.py 2023-01-12 11:16:09 +0000
1341+++ tests/__init__.py 2023-01-31 19:12:08 +0000
1342@@ -18,28 +18,20 @@
1343 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1344 #
1345
1346+import doctest
1347+import os
1348 import shutil
1349 import subprocess
1350 import tarfile
1351 import zipfile
1352
1353-import doctest
1354-import os
1355+from debian.changelog import Changelog, Version
1356
1357 from .... import tests
1358-
1359-from debian.changelog import Version, Changelog
1360-
1361-from ....tests import ( # noqa: F401
1362- multiply_tests,
1363- TestCaseWithTransport,
1364- TestCaseInTempDir,
1365- )
1366-from ....tests.features import ( # noqa: F401
1367- ExecutableFeature,
1368- ModuleAvailableFeature,
1369- UnicodeFilenameFeature,
1370- )
1371+from ....tests import (TestCaseInTempDir, TestCaseWithTransport, # noqa: F401
1372+ multiply_tests)
1373+from ....tests.features import (ExecutableFeature, # noqa: F401
1374+ ModuleAvailableFeature, UnicodeFilenameFeature)
1375
1376
1377 def make_new_upstream_dir(source, dest):
1378
1379=== modified file 'tests/blackbox/test_builddeb.py'
1380--- tests/blackbox/test_builddeb.py 2023-01-12 11:16:09 +0000
1381+++ tests/blackbox/test_builddeb.py 2023-01-31 19:12:08 +0000
1382@@ -175,8 +175,8 @@
1383 self.assertInBuildDir(['pre-build', 'post-build'])
1384
1385 def test_utf8_changelog(self):
1386+ from .....msgeditor import hooks
1387 from ... import debian_changelog_commit
1388- from .....msgeditor import hooks
1389 hooks.install_named_hook(
1390 "set_commit_message",
1391 debian_changelog_commit, "Test builddeb set commit msg hook")
1392
1393=== modified file 'tests/blackbox/test_debrelease.py'
1394--- tests/blackbox/test_debrelease.py 2023-01-12 11:16:09 +0000
1395+++ tests/blackbox/test_debrelease.py 2023-01-31 19:12:08 +0000
1396@@ -21,10 +21,10 @@
1397
1398 """Blackbox tests for "bzr debrelease"."""
1399
1400+import os
1401+
1402 from .....tests.blackbox import ExternalBase
1403
1404-import os
1405-
1406
1407 class TestDebrelease(ExternalBase):
1408
1409
1410=== modified file 'tests/blackbox/test_dep3.py'
1411--- tests/blackbox/test_dep3.py 2023-01-12 11:16:09 +0000
1412+++ tests/blackbox/test_dep3.py 2023-01-31 19:12:08 +0000
1413@@ -21,10 +21,10 @@
1414
1415 """Blackbox tests for "bzr dep3-patch"."""
1416
1417+import os
1418+
1419 from .....tests.blackbox import ExternalBase
1420
1421-import os
1422-
1423
1424 class TestDep3Patch(ExternalBase):
1425
1426
1427=== modified file 'tests/blackbox/test_do.py'
1428--- tests/blackbox/test_do.py 2022-10-20 22:55:28 +0000
1429+++ tests/blackbox/test_do.py 2023-01-31 19:12:08 +0000
1430@@ -21,15 +21,11 @@
1431 import os
1432 import tarfile
1433
1434-from debian.changelog import (Changelog,
1435- Version,
1436- )
1437+from debian.changelog import Changelog, Version
1438 from debian.deb822 import Deb822
1439
1440-
1441 from .....tests.blackbox import ExternalBase
1442
1443-
1444 TRIVIAL_PATCH = """--- /dev/null 2012-01-02 01:09:10.986490031 +0100
1445 +++ base/afile 2012-01-02 20:03:59.710666215 +0100
1446 @@ -0,0 +1 @@
1447
1448=== modified file 'tests/blackbox/test_get_tar.py'
1449--- tests/blackbox/test_get_tar.py 2022-10-20 22:55:28 +0000
1450+++ tests/blackbox/test_get_tar.py 2023-01-31 19:12:08 +0000
1451@@ -20,10 +20,7 @@
1452
1453 import os
1454
1455-from debian.changelog import (Changelog,
1456- Version,
1457- )
1458-
1459+from debian.changelog import Changelog, Version
1460
1461 from .. import BuilddebTestCase
1462
1463
1464=== modified file 'tests/blackbox/test_import_dsc.py'
1465--- tests/blackbox/test_import_dsc.py 2023-01-12 11:16:09 +0000
1466+++ tests/blackbox/test_import_dsc.py 2023-01-31 19:12:08 +0000
1467@@ -24,7 +24,6 @@
1468 import tarfile
1469
1470 from .....transport import get_transport
1471-
1472 from .. import BuilddebTestCase, Version
1473 from ..test_import_dsc import PristineTarFeature
1474
1475
1476=== modified file 'tests/blackbox/test_import_upstream.py'
1477--- tests/blackbox/test_import_upstream.py 2023-01-12 11:16:09 +0000
1478+++ tests/blackbox/test_import_upstream.py 2023-01-31 19:12:08 +0000
1479@@ -21,8 +21,8 @@
1480
1481 from debian.changelog import Version
1482
1483+from ..test_import_dsc import PristineTarFeature
1484 from .test_import_dsc import TestBaseImportDsc
1485-from ..test_import_dsc import PristineTarFeature
1486
1487
1488 class TestImportUpstream(TestBaseImportDsc):
1489
1490=== modified file 'tests/blackbox/test_merge_package.py'
1491--- tests/blackbox/test_merge_package.py 2023-01-12 11:16:09 +0000
1492+++ tests/blackbox/test_merge_package.py 2023-01-31 19:12:08 +0000
1493@@ -18,18 +18,15 @@
1494 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1495 #
1496
1497-from .....merge import Merger
1498 import os
1499 import string
1500
1501-from ..... import (
1502- errors,
1503- )
1504+from ..... import errors
1505+from .....merge import Merger
1506 from .....tests import TestNotApplicable
1507 from ... import pre_merge_fix_ancestry
1508 from .. import BuilddebTestCase
1509
1510-
1511 _Debian_changelog = '''\
1512 ipsec-tools (%s) unstable; urgency=high
1513
1514
1515=== modified file 'tests/blackbox/test_merge_upstream.py'
1516--- tests/blackbox/test_merge_upstream.py 2023-01-22 22:56:44 +0000
1517+++ tests/blackbox/test_merge_upstream.py 2023-01-31 19:12:08 +0000
1518@@ -21,18 +21,9 @@
1519 import os.path
1520
1521 from ..... import export
1522-
1523-from .. import (
1524- BuilddebTestCase,
1525- SourcePackageBuilder,
1526- )
1527-from ...import_dsc import (
1528- DistributionBranch,
1529- DistributionBranchSet,
1530- )
1531-from ...util import (
1532- md5sum_filename,
1533- )
1534+from ...import_dsc import DistributionBranch, DistributionBranchSet
1535+from ...util import md5sum_filename
1536+from .. import BuilddebTestCase, SourcePackageBuilder
1537
1538
1539 class Fixture:
1540
1541=== modified file 'tests/test_apt_repo.py'
1542--- tests/test_apt_repo.py 2023-01-12 11:16:09 +0000
1543+++ tests/test_apt_repo.py 2023-01-31 19:12:08 +0000
1544@@ -19,10 +19,8 @@
1545 #
1546
1547 from breezy.tests import TestCase
1548-
1549 from debian.deb822 import Dsc
1550
1551-
1552 from ..apt_repo import LocalApt, NoAptSources
1553
1554
1555
1556=== modified file 'tests/test_builder.py'
1557--- tests/test_builder.py 2023-01-12 11:16:09 +0000
1558+++ tests/test_builder.py 2023-01-31 19:12:08 +0000
1559@@ -21,12 +21,7 @@
1560 import os
1561
1562 from ....tests import TestCaseInTempDir
1563-
1564-from ..builder import (
1565- DebBuild,
1566- BuildFailedError,
1567- NoSourceDirError,
1568- )
1569+from ..builder import BuildFailedError, DebBuild, NoSourceDirError
1570
1571
1572 class TestDebBuild(TestCaseInTempDir):
1573
1574=== modified file 'tests/test_bzrtools_import.py'
1575--- tests/test_bzrtools_import.py 2023-01-12 11:16:09 +0000
1576+++ tests/test_bzrtools_import.py 2023-01-31 19:12:08 +0000
1577@@ -18,13 +18,11 @@
1578 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1579 #
1580
1581-from breezy.tests.scenarios import (
1582- load_tests_apply_scenarios,
1583- multiply_scenarios,
1584- )
1585+from breezy.tests.scenarios import (load_tests_apply_scenarios,
1586+ multiply_scenarios)
1587
1588+from .. import tests
1589 from ..bzrtools_import import import_dir
1590-from .. import tests
1591
1592 load_tests = load_tests_apply_scenarios
1593
1594
1595=== modified file 'tests/test_commit_message.py'
1596--- tests/test_commit_message.py 2023-01-12 11:16:09 +0000
1597+++ tests/test_commit_message.py 2023-01-31 19:12:08 +0000
1598@@ -17,9 +17,9 @@
1599 # along with bzr-builddeb; if not, write to the Free Software
1600 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1601
1602-from .. import debian_changelog_commit_message, debian_changelog_commit
1603+from ....tests.features import Feature
1604+from .. import debian_changelog_commit, debian_changelog_commit_message
1605 from . import TestCaseWithTransport
1606-from ....tests.features import Feature
1607
1608
1609 class _LaunchpadConnectionFeature(Feature):
1610
1611=== modified file 'tests/test_config.py'
1612--- tests/test_config.py 2023-01-22 22:56:44 +0000
1613+++ tests/test_config.py 2023-01-31 19:12:08 +0000
1614@@ -19,11 +19,7 @@
1615 #
1616
1617 from ....branch import Branch
1618-
1619-from ..config import (
1620- BUILD_TYPE_MERGE,
1621- DebBuildConfig,
1622- )
1623+from ..config import BUILD_TYPE_MERGE, DebBuildConfig
1624 from . import TestCaseWithTransport
1625
1626
1627
1628=== modified file 'tests/test_dep3.py'
1629--- tests/test_dep3.py 2023-01-12 11:16:09 +0000
1630+++ tests/test_dep3.py 2023-01-31 19:12:08 +0000
1631@@ -20,28 +20,14 @@
1632
1633 from email.message import Message
1634 from email.parser import Parser
1635-
1636-from ....revision import (
1637- NULL_REVISION,
1638- )
1639 from io import StringIO
1640
1641-from ....tests import (
1642- TestCase,
1643- )
1644-
1645-from ..dep3 import (
1646- describe_origin,
1647- determine_applied_upstream,
1648- gather_bugs_and_authors,
1649- write_dep3_bug_line,
1650- write_dep3_patch,
1651- write_dep3_patch_header,
1652- )
1653-
1654-from . import (
1655- TestCaseWithTransport,
1656- )
1657+from ....revision import NULL_REVISION
1658+from ....tests import TestCase
1659+from ..dep3 import (describe_origin, determine_applied_upstream,
1660+ gather_bugs_and_authors, write_dep3_bug_line,
1661+ write_dep3_patch, write_dep3_patch_header)
1662+from . import TestCaseWithTransport
1663
1664
1665 class Dep3HeaderTests(TestCase):
1666
1667=== modified file 'tests/test_directory.py'
1668--- tests/test_directory.py 2023-01-12 11:16:09 +0000
1669+++ tests/test_directory.py 2023-01-31 19:12:08 +0000
1670@@ -19,13 +19,8 @@
1671 #
1672
1673 from ....tests import TestCase
1674-
1675-from ..directory import (
1676- fixup_broken_git_url,
1677- vcs_git_url_to_bzr_url,
1678- vcs_hg_url_to_bzr_url,
1679- vcs_cvs_url_to_bzr_url,
1680- )
1681+from ..directory import (fixup_broken_git_url, vcs_cvs_url_to_bzr_url,
1682+ vcs_git_url_to_bzr_url, vcs_hg_url_to_bzr_url)
1683
1684
1685 class VcsGitUrlToBzrUrlTests(TestCase):
1686
1687=== modified file 'tests/test_extract.py'
1688--- tests/test_extract.py 2023-01-12 11:16:09 +0000
1689+++ tests/test_extract.py 2023-01-31 19:12:08 +0000
1690@@ -19,24 +19,17 @@
1691 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1692 #
1693
1694+import os
1695+
1696+from debian.changelog import Version
1697+
1698 from debian import deb822
1699-from debian.changelog import Version
1700-import os
1701-
1702-from ..extract import (
1703- OneZeroSourceExtractor,
1704- SOURCE_EXTRACTORS,
1705- ThreeDotZeroNativeSourceExtractor,
1706- ThreeDotZeroQuiltSourceExtractor,
1707- )
1708-
1709-from .... import (
1710- tests,
1711- )
1712-
1713-from . import (
1714- SourcePackageBuilder,
1715- )
1716+
1717+from .... import tests
1718+from ..extract import (SOURCE_EXTRACTORS, OneZeroSourceExtractor,
1719+ ThreeDotZeroNativeSourceExtractor,
1720+ ThreeDotZeroQuiltSourceExtractor)
1721+from . import SourcePackageBuilder
1722
1723
1724 class OneZeroSourceExtractorTests(tests.TestCaseInTempDir):
1725
1726=== modified file 'tests/test_hooks.py'
1727--- tests/test_hooks.py 2022-10-20 22:55:28 +0000
1728+++ tests/test_hooks.py 2023-01-31 19:12:08 +0000
1729@@ -21,7 +21,7 @@
1730 import os
1731
1732 from ..config import DebBuildConfig
1733-from ..hooks import run_hook, HookFailedError
1734+from ..hooks import HookFailedError, run_hook
1735 from . import TestCaseInTempDir
1736
1737
1738
1739=== modified file 'tests/test_import_dsc.py'
1740--- tests/test_import_dsc.py 2023-01-22 22:56:44 +0000
1741+++ tests/test_import_dsc.py 2023-01-31 19:12:08 +0000
1742@@ -25,30 +25,14 @@
1743
1744 from debian.changelog import Version
1745
1746-from .... import (
1747- revision as _mod_revision,
1748- tests,
1749- )
1750-from ....tests.features import (
1751- Feature,
1752- SymlinkFeature,
1753- )
1754-
1755-from . import make_new_upstream_tarball_xz
1756-
1757-from ..import_dsc import (
1758- DistributionBranch,
1759- DistributionBranchSet,
1760- get_changelog_from_source,
1761-)
1762-from ..upstream.pristinetar import (
1763- PristineTarDeltaTooLarge,
1764- )
1765-from . import (
1766- BuilddebTestCase,
1767- LzmaFeature,
1768- SourcePackageBuilder,
1769- )
1770+from .... import revision as _mod_revision
1771+from .... import tests
1772+from ....tests.features import Feature, SymlinkFeature
1773+from ..import_dsc import (DistributionBranch, DistributionBranchSet,
1774+ get_changelog_from_source)
1775+from ..upstream.pristinetar import PristineTarDeltaTooLarge
1776+from . import (BuilddebTestCase, LzmaFeature, SourcePackageBuilder,
1777+ make_new_upstream_tarball_xz)
1778
1779
1780 class _PristineTarFeature(Feature):
1781
1782=== modified file 'tests/test_merge_changelog.py'
1783--- tests/test_merge_changelog.py 2023-01-12 11:16:09 +0000
1784+++ tests/test_merge_changelog.py 2023-01-31 19:12:08 +0000
1785@@ -21,17 +21,13 @@
1786
1787 import logging
1788
1789+from testtools.content import Content
1790 from testtools.content_type import ContentType
1791-from testtools.content import Content
1792
1793-from .... import (
1794- merge,
1795- tests,
1796-)
1797+from .... import merge, tests
1798+from ....tests.features import ExecutableFeature
1799 from ... import debian
1800 from .. import merge_changelog
1801-from ....tests.features import ExecutableFeature
1802-
1803
1804 dpkg_mergechangelogs_feature = ExecutableFeature('dpkg-mergechangelogs')
1805
1806
1807=== modified file 'tests/test_merge_package.py'
1808--- tests/test_merge_package.py 2023-01-12 11:16:09 +0000
1809+++ tests/test_merge_package.py 2023-01-31 19:12:08 +0000
1810@@ -24,7 +24,6 @@
1811
1812 from .. import merge_package as MP
1813 from ..import_dsc import DistributionBranch
1814-
1815 from . import TestCaseWithTransport
1816
1817 _Debian_changelog = '''\
1818
1819=== modified file 'tests/test_merge_upstream.py'
1820--- tests/test_merge_upstream.py 2023-01-12 11:16:09 +0000
1821+++ tests/test_merge_upstream.py 2023-01-31 19:12:08 +0000
1822@@ -20,13 +20,8 @@
1823
1824 from debian.changelog import Changelog, Version
1825
1826-from ....tests import (
1827- TestCaseWithTransport,
1828- )
1829-
1830-from ..merge_upstream import (
1831- changelog_add_new_version,
1832- )
1833+from ....tests import TestCaseWithTransport
1834+from ..merge_upstream import changelog_add_new_version
1835
1836
1837 class ChangelogAddNewVersionTests(TestCaseWithTransport):
1838
1839=== modified file 'tests/test_repack_tarball.py'
1840--- tests/test_repack_tarball.py 2022-10-15 11:55:16 +0000
1841+++ tests/test_repack_tarball.py 2023-01-31 19:12:08 +0000
1842@@ -22,17 +22,9 @@
1843 import shutil
1844 import tarfile
1845
1846-from ....transport import (
1847- NoSuchFile,
1848- FileExists,
1849- )
1850-
1851-from ..repack_tarball import (
1852- repack_tarball,
1853- get_filetype,
1854- get_repacker_class,
1855- UnsupportedRepackFormat,
1856- )
1857+from ....transport import FileExists, NoSuchFile
1858+from ..repack_tarball import (UnsupportedRepackFormat, get_filetype,
1859+ get_repacker_class, repack_tarball)
1860 from . import TestCaseInTempDir
1861
1862
1863
1864=== modified file 'tests/test_repack_tarball_extra.py'
1865--- tests/test_repack_tarball_extra.py 2022-10-15 11:55:16 +0000
1866+++ tests/test_repack_tarball_extra.py 2023-01-31 19:12:08 +0000
1867@@ -22,13 +22,9 @@
1868 import shutil
1869 import tarfile
1870
1871-from ..repack_tarball import (
1872- repack_tarball,
1873- UnsupportedRepackFormat,
1874- )
1875-
1876+from ....tests import TestCaseInTempDir
1877 from ....transport import FileExists
1878-from ....tests import TestCaseInTempDir
1879+from ..repack_tarball import UnsupportedRepackFormat, repack_tarball
1880
1881
1882 def touch(filename):
1883
1884=== modified file 'tests/test_revspec.py'
1885--- tests/test_revspec.py 2023-01-12 11:16:09 +0000
1886+++ tests/test_revspec.py 2023-01-31 19:12:08 +0000
1887@@ -21,16 +21,10 @@
1888 import os
1889
1890 from ....revisionspec import InvalidRevisionSpec, RevisionSpec
1891-
1892 from ....tests.test_revisionspec import TestRevisionSpec
1893-
1894-from . import Version, Changelog
1895-from ..revspec import (
1896- UnknownVersion,
1897- VersionNotSpecified,
1898- RevisionSpec_package,
1899- RevisionSpec_upstream,
1900- )
1901+from ..revspec import (RevisionSpec_package, RevisionSpec_upstream,
1902+ UnknownVersion, VersionNotSpecified)
1903+from . import Changelog, Version
1904
1905
1906 class TestRevisionSpec_package(TestRevisionSpec):
1907
1908=== modified file 'tests/test_source_distiller.py'
1909--- tests/test_source_distiller.py 2023-01-12 11:16:09 +0000
1910+++ tests/test_source_distiller.py 2023-01-31 19:12:08 +0000
1911@@ -22,22 +22,12 @@
1912 from debian.changelog import Version
1913
1914 from ....transport import FileExists
1915-
1916+from ..source_distiller import (FullSourceDistiller, MergeModeDistiller,
1917+ NativeSourceDistiller)
1918 from ..upstream import MissingUpstreamTarball
1919-from ..source_distiller import (
1920- FullSourceDistiller,
1921- MergeModeDistiller,
1922- NativeSourceDistiller,
1923- )
1924-from . import (
1925- SourcePackageBuilder,
1926- TestCaseWithTransport,
1927- )
1928-from .test_upstream import (
1929- _MissingUpstreamProvider,
1930- _SimpleUpstreamProvider,
1931- _TouchUpstreamProvider,
1932- )
1933+from . import SourcePackageBuilder, TestCaseWithTransport
1934+from .test_upstream import (_MissingUpstreamProvider, _SimpleUpstreamProvider,
1935+ _TouchUpstreamProvider)
1936
1937
1938 class NativeSourceDistillerTests(TestCaseWithTransport):
1939
1940=== modified file 'tests/test_tagging.py'
1941--- tests/test_tagging.py 2023-01-12 11:16:09 +0000
1942+++ tests/test_tagging.py 2023-01-31 19:12:08 +0000
1943@@ -19,10 +19,8 @@
1944
1945 """Tests for builddeb.tagging."""
1946
1947+from ....tests import TestCase
1948 from .. import tagging
1949-from ....tests import (
1950- TestCase,
1951- )
1952
1953
1954 class TestDebVersionSort(TestCase):
1955
1956=== modified file 'tests/test_upstream.py'
1957--- tests/test_upstream.py 2023-01-22 22:56:44 +0000
1958+++ tests/test_upstream.py 2023-01-31 19:12:08 +0000
1959@@ -22,72 +22,40 @@
1960
1961 """Tests for the upstream module."""
1962
1963-from base64 import standard_b64encode
1964-
1965 import bz2
1966 import os
1967 import tarfile
1968 import zipfile
1969+from base64 import standard_b64encode
1970+from unittest import expectedFailure
1971
1972 from debian.deb822 import Dsc
1973-from unittest import expectedFailure
1974-
1975-from ....revision import (
1976- NULL_REVISION,
1977- Revision,
1978- )
1979-from ....tests import (
1980- TestCase,
1981- )
1982-from ....tests.features import (
1983- ModuleAvailableFeature,
1984-)
1985-from ..config import (
1986- DebBuildConfig,
1987-)
1988-
1989-from . import (
1990- LzmaFeature,
1991- XzFeature,
1992- make_new_upstream_tarball_xz,
1993- TestCaseWithTransport,
1994- )
1995+
1996+from ....revision import NULL_REVISION, Revision
1997+from ....tests import TestCase
1998+from ....tests.features import ModuleAvailableFeature
1999 from ..apt_repo import Apt, AptSourceError
2000-from ..upstream import (
2001- MissingUpstreamTarball,
2002- PackageVersionNotPresent,
2003- AptSource,
2004- StackedUpstreamSource,
2005- TarfileSource,
2006- UpstreamProvider,
2007- UpstreamSource,
2008- extract_tarball_version,
2009- gather_orig_files,
2010- new_tarball_name,
2011- )
2012-from ..util import (
2013- component_from_orig_tarball,
2014- )
2015-from ..upstream.branch import (
2016- guess_upstream_revspec,
2017- get_export_upstream_revision,
2018- get_snapshot_revision,
2019- LazyUpstreamBranchSource,
2020- UpstreamBranchSource,
2021- _upstream_branch_version,
2022- upstream_tag_to_version,
2023- upstream_version_add_revision,
2024- PreviousVersionTagMissing,
2025- )
2026-from ..upstream.pristinetar import (
2027- is_upstream_tag,
2028- revision_pristine_tar_format,
2029- revision_pristine_tar_delta,
2030- upstream_tag_version,
2031- GitPristineTarSource,
2032- BzrPristineTarSource,
2033- )
2034-
2035+from ..config import DebBuildConfig
2036+from ..upstream import (AptSource, MissingUpstreamTarball,
2037+ PackageVersionNotPresent, StackedUpstreamSource,
2038+ TarfileSource, UpstreamProvider, UpstreamSource,
2039+ extract_tarball_version, gather_orig_files,
2040+ new_tarball_name)
2041+from ..upstream.branch import (LazyUpstreamBranchSource,
2042+ PreviousVersionTagMissing, UpstreamBranchSource,
2043+ _upstream_branch_version,
2044+ get_export_upstream_revision,
2045+ get_snapshot_revision, guess_upstream_revspec,
2046+ upstream_tag_to_version,
2047+ upstream_version_add_revision)
2048+from ..upstream.pristinetar import (BzrPristineTarSource, GitPristineTarSource,
2049+ is_upstream_tag,
2050+ revision_pristine_tar_delta,
2051+ revision_pristine_tar_format,
2052+ upstream_tag_version)
2053+from ..util import component_from_orig_tarball
2054+from . import (LzmaFeature, TestCaseWithTransport, XzFeature,
2055+ make_new_upstream_tarball_xz)
2056
2057 svn_plugin = ModuleAvailableFeature('breezy.plugins.svn.mapping')
2058 dulwich = ModuleAvailableFeature('dulwich')
2059
2060=== modified file 'tests/test_upstream_uscan.py'
2061--- tests/test_upstream_uscan.py 2023-01-12 11:16:09 +0000
2062+++ tests/test_upstream_uscan.py 2023-01-31 19:12:08 +0000
2063@@ -21,17 +21,11 @@
2064
2065 import tempfile
2066
2067+from ....tests import TestCase, TestCaseWithTransport
2068 from ....transport import NoSuchFile
2069-from ....tests import (
2070- TestCase,
2071- TestCaseWithTransport,
2072- )
2073-from ..upstream.uscan import (
2074- UScanSource,
2075- UScanError,
2076- _xml_report_extract_upstream_version,
2077- _xml_report_extract_warnings,
2078- )
2079+from ..upstream.uscan import (UScanError, UScanSource,
2080+ _xml_report_extract_upstream_version,
2081+ _xml_report_extract_warnings)
2082
2083
2084 class UScanSourceTests(TestCaseWithTransport):
2085
2086=== modified file 'tests/test_util.py'
2087--- tests/test_util.py 2023-01-12 11:16:09 +0000
2088+++ tests/test_util.py 2023-01-31 19:12:08 +0000
2089@@ -28,54 +28,24 @@
2090 from debian.changelog import Changelog, Version
2091 from debmutate.changelog import strip_changelog_message
2092
2093-from ..config import (
2094- BUILD_TYPE_MERGE,
2095- BUILD_TYPE_NATIVE,
2096- BUILD_TYPE_NORMAL,
2097- )
2098-from . import (
2099- LzmaFeature,
2100- SourcePackageBuilder,
2101- TestCaseInTempDir,
2102- TestCaseWithTransport,
2103- )
2104-from ..util import (
2105- AddChangelogError,
2106- InconsistentSourceFormatError,
2107- NoPreviousUpload,
2108- NoSuchFile,
2109- changelog_find_previous_upload,
2110- component_from_orig_tarball,
2111- dget,
2112- dget_changes,
2113- extract_orig_tarballs,
2114- find_bugs_fixed,
2115- find_changelog,
2116- find_extra_authors,
2117- find_thanks,
2118- get_files_excluded,
2119- get_commit_info_from_changelog,
2120- guess_build_type,
2121- lookup_distribution,
2122- move_file_if_different,
2123- get_parent_dir,
2124- recursive_copy,
2125- suite_to_distribution,
2126- tarball_name,
2127- tree_contains_upstream_source,
2128- tree_get_source_format,
2129- write_if_different,
2130- MissingChangelogError,
2131- )
2132-
2133 from .... import errors as bzr_errors
2134-from ....tests import (
2135- TestCase,
2136- )
2137-from ....tests.features import (
2138- SymlinkFeature,
2139- ModuleAvailableFeature,
2140- )
2141+from ....tests import TestCase
2142+from ....tests.features import ModuleAvailableFeature, SymlinkFeature
2143+from ..config import BUILD_TYPE_MERGE, BUILD_TYPE_NATIVE, BUILD_TYPE_NORMAL
2144+from ..util import (AddChangelogError, InconsistentSourceFormatError,
2145+ MissingChangelogError, NoPreviousUpload, NoSuchFile,
2146+ changelog_find_previous_upload,
2147+ component_from_orig_tarball, dget, dget_changes,
2148+ extract_orig_tarballs, find_bugs_fixed, find_changelog,
2149+ find_extra_authors, find_thanks,
2150+ get_commit_info_from_changelog, get_files_excluded,
2151+ get_parent_dir, guess_build_type, lookup_distribution,
2152+ move_file_if_different, recursive_copy,
2153+ suite_to_distribution, tarball_name,
2154+ tree_contains_upstream_source, tree_get_source_format,
2155+ write_if_different)
2156+from . import (LzmaFeature, SourcePackageBuilder, TestCaseInTempDir,
2157+ TestCaseWithTransport)
2158
2159
2160 class RecursiveCopyTests(TestCaseInTempDir):
2161
2162=== modified file 'update_packaging.py'
2163--- update_packaging.py 2023-01-12 11:16:09 +0000
2164+++ update_packaging.py 2023-01-31 19:12:08 +0000
2165@@ -17,15 +17,15 @@
2166
2167 """Refresh packaging."""
2168
2169-from email.utils import parseaddr
2170 import logging
2171 import os
2172+from email.utils import parseaddr
2173 from typing import Optional
2174
2175+from breezy.plugins.debian.changelog import debcommit
2176+from breezy.tree import Tree
2177 from debian.changelog import get_maintainer
2178 from debmutate.changelog import ChangelogEditor
2179-from breezy.plugins.debian.changelog import debcommit
2180-from breezy.tree import Tree
2181
2182
2183 def override_dh_autoreconf_add_arguments(basedir: str, args):
2184@@ -104,11 +104,11 @@
2185
2186 def main():
2187 import argparse
2188- from breezy.workingtree import WorkingTree
2189- from breezy.revisionspec import RevisionSpec
2190
2191 import breezy.bzr # noqa: F401
2192 import breezy.git # noqa: F401
2193+ from breezy.revisionspec import RevisionSpec
2194+ from breezy.workingtree import WorkingTree
2195
2196 parser = argparse.ArgumentParser('deb-update-packaging')
2197 parser.add_argument(
2198
2199=== modified file 'upstream/__init__.py'
2200--- upstream/__init__.py 2023-01-22 22:56:44 +0000
2201+++ upstream/__init__.py 2023-01-31 19:12:08 +0000
2202@@ -27,22 +27,13 @@
2203
2204 from debmutate.versions import debianize_upstream_version
2205
2206+from .... import osutils
2207 from ....errors import BzrError, DependencyNotPresent
2208-from .... import osutils
2209 from ....revision import RevisionID
2210-from ....trace import (
2211- note,
2212- warning,
2213- )
2214-from ..repack_tarball import (
2215- get_filetype,
2216- repack_tarball,
2217- )
2218-from ..util import (
2219- component_from_orig_tarball,
2220- export_with_nested,
2221- tarball_name,
2222- )
2223+from ....trace import note, warning
2224+from ..repack_tarball import get_filetype, repack_tarball
2225+from ..util import (component_from_orig_tarball, export_with_nested,
2226+ tarball_name)
2227
2228
2229 class PackageVersionNotPresent(BzrError):
2230@@ -157,7 +148,7 @@
2231 def fetch_tarballs(self, package, upstream_version, target_dir,
2232 components=None):
2233 with self.apt:
2234- from ..apt_repo import NoAptSources, AptSourceError
2235+ from ..apt_repo import AptSourceError, NoAptSources
2236 source_name = package
2237 try:
2238 for source in self.apt.iter_source_by_name(package):
2239@@ -464,9 +455,7 @@
2240 :param package: Package name
2241 :return: A `LaunchpadReleaseFileSource`
2242 """
2243- from ...launchpad import (
2244- get_upstream_projectseries_for_package,
2245- )
2246+ from ...launchpad import get_upstream_projectseries_for_package
2247 project_series = get_upstream_projectseries_for_package(
2248 package, distribution_name, distroseries_name)
2249 if project_series is None:
2250
2251=== modified file 'upstream/branch.py'
2252--- upstream/branch.py 2023-01-22 22:56:44 +0000
2253+++ upstream/branch.py 2023-01-31 19:12:08 +0000
2254@@ -18,59 +18,38 @@
2255 # along with bzr-builddeb; if not, write to the Free Software
2256 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2257
2258-from contextlib import ExitStack
2259-from datetime import date
2260 import os
2261 import re
2262 import subprocess
2263 import tempfile
2264+from collections.abc import Iterable
2265+from contextlib import ExitStack
2266+from datetime import date
2267 from typing import Optional
2268-from collections.abc import Iterable
2269
2270 from debian.changelog import Version
2271-from debmutate.versions import (
2272- git_snapshot_data_from_version,
2273- get_snapshot_revision as _get_snapshot_revision,
2274- debianize_upstream_version,
2275- upstream_version_add_revision as _upstream_version_add_revision,
2276- )
2277+from debmutate.versions import debianize_upstream_version
2278+from debmutate.versions import get_snapshot_revision as _get_snapshot_revision
2279+from debmutate.versions import git_snapshot_data_from_version
2280+from debmutate.versions import \
2281+ upstream_version_add_revision as _upstream_version_add_revision
2282
2283 from .... import osutils
2284-from ....branch import (
2285- Branch,
2286- )
2287-from ....errors import (
2288- BzrError,
2289- GhostRevisionsHaveNoRevno,
2290- InvalidRevisionId,
2291- NoSuchRevision,
2292- NoSuchTag,
2293- NotBranchError,
2294- RevisionNotPresent,
2295- UnsupportedOperation,
2296- )
2297+from ....branch import Branch
2298+from ....errors import (BzrError, GhostRevisionsHaveNoRevno, InvalidRevisionId,
2299+ NoSuchRevision, NoSuchTag, NotBranchError,
2300+ RevisionNotPresent, UnsupportedOperation)
2301 from ....memorybranch import MemoryBranch
2302-from ..repack_tarball import get_filetype, repack_tarball
2303 from ....revision import NULL_REVISION, RevisionID
2304-from ....revisionspec import RevisionSpec
2305-from ....trace import note, mutter, warning
2306+from ....revisionspec import InvalidRevisionSpec, RevisionSpec
2307+from ....trace import mutter, note, warning
2308 from ....tree import Tree
2309-
2310-from ....revisionspec import InvalidRevisionSpec
2311-
2312-from ..errors import (
2313- MultipleUpstreamTarballsNotSupported,
2314- )
2315+from ....workingtree import WorkingTree
2316 from .. import gettext
2317+from ..errors import MultipleUpstreamTarballsNotSupported
2318+from ..repack_tarball import get_filetype, repack_tarball
2319 from ..util import export_with_nested
2320-from . import (
2321- UpstreamSource,
2322- PackageVersionNotPresent,
2323- new_tarball_name,
2324- )
2325-from ....workingtree import (
2326- WorkingTree,
2327- )
2328+from . import PackageVersionNotPresent, UpstreamSource, new_tarball_name
2329
2330
2331 class PreviousVersionTagMissing(BzrError):
2332
2333=== modified file 'upstream/pristinetar.py'
2334--- upstream/pristinetar.py 2023-01-22 22:56:44 +0000
2335+++ upstream/pristinetar.py 2023-01-31 19:12:08 +0000
2336@@ -18,68 +18,38 @@
2337 # along with bzr-builddeb; if not, write to the Free Software
2338 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2339
2340-from typing import Optional
2341-
2342-from base64 import (
2343- standard_b64decode,
2344- standard_b64encode,
2345- )
2346 import configparser
2347-from debian.copyright import globs_to_re
2348 import errno
2349-from io import BytesIO
2350 import os
2351 import re
2352 import subprocess
2353+import tempfile
2354+from base64 import standard_b64decode, standard_b64encode
2355+from io import BytesIO
2356 from tarfile import TarFile
2357-import tempfile
2358-
2359-from .... import debug
2360-from . import (
2361- PackageVersionNotPresent,
2362- UpstreamSource,
2363- )
2364-from ..util import (
2365- export_with_nested,
2366- subprocess_setup,
2367- )
2368-
2369-from .... import (
2370- config as _mod_config,
2371- osutils,
2372- revision as _mod_revision,
2373- )
2374+from typing import Optional
2375+
2376+from debian.copyright import globs_to_re
2377+from debmutate.vcs import gbp_expand_tag_name
2378+from debmutate.versions import mangle_version_for_git
2379+
2380+from .... import config as _mod_config
2381+from .... import debug, osutils
2382+from .... import revision as _mod_revision
2383 from ....branch import Branch
2384 from ....commit import NullCommitReporter
2385-from ....errors import (
2386- BzrError,
2387- DivergedBranches,
2388- NoSuchRevision,
2389- NoSuchTag,
2390- NotBranchError,
2391- )
2392+from ....errors import (BzrError, DivergedBranches, NoSuchRevision, NoSuchTag,
2393+ NotBranchError)
2394 from ....revision import NULL_REVISION, RevisionID
2395-from ....trace import (
2396- mutter,
2397- note,
2398- warning,
2399- )
2400+from ....trace import mutter, note, warning
2401 from ....transport import NoSuchFile
2402-
2403-from .branch import (
2404- git_snapshot_data_from_version,
2405- InvalidRevisionSpec,
2406- RevisionSpec,
2407- )
2408-from .tags import (
2409- is_upstream_tag,
2410- possible_upstream_tag_names,
2411- search_for_upstream_version,
2412- upstream_version_tag_start_revids,
2413- upstream_tag_version,
2414- )
2415-from debmutate.vcs import gbp_expand_tag_name
2416-from debmutate.versions import mangle_version_for_git
2417+from ..util import export_with_nested, subprocess_setup
2418+from . import PackageVersionNotPresent, UpstreamSource
2419+from .branch import (InvalidRevisionSpec, RevisionSpec,
2420+ git_snapshot_data_from_version)
2421+from .tags import (is_upstream_tag, possible_upstream_tag_names,
2422+ search_for_upstream_version, upstream_tag_version,
2423+ upstream_version_tag_start_revids)
2424
2425
2426 class PristineTarError(BzrError):
2427
2428=== modified file 'upstream/tags.py'
2429--- upstream/tags.py 2023-01-12 11:16:09 +0000
2430+++ upstream/tags.py 2023-01-31 19:12:08 +0000
2431@@ -20,13 +20,12 @@
2432 from itertools import islice
2433 from typing import Optional
2434
2435+from debmutate.versions import mangle_version_for_git
2436+
2437 from ....repository import Repository
2438 from ....revision import Revision
2439
2440
2441-from debmutate.versions import mangle_version_for_git
2442-
2443-
2444 def possible_upstream_tag_names(package: Optional[str], version: str,
2445 component: Optional[str] = None,
2446 try_hard=True):
2447
2448=== modified file 'upstream/uscan.py'
2449--- upstream/uscan.py 2023-01-12 11:16:09 +0000
2450+++ upstream/uscan.py 2023-01-31 19:12:08 +0000
2451@@ -20,19 +20,19 @@
2452
2453 import os
2454 import re
2455+import shutil
2456 import subprocess
2457-import shutil
2458 import sys
2459 import tempfile
2460
2461 from debmutate.watch import parse_watch_file
2462
2463+from .... import osutils
2464 from ....errors import BzrError
2465+from ....trace import note, warning
2466 from ....transport import NoSuchFile
2467-from .... import osutils
2468-from ....trace import note, warning
2469-from . import UpstreamSource, PackageVersionNotPresent
2470 from ..util import export_with_nested
2471+from . import PackageVersionNotPresent, UpstreamSource
2472
2473
2474 class UScanError(BzrError):
2475@@ -237,6 +237,7 @@
2476 def _xml_report_extract_upstream_version(text):
2477 _xml_report_extract_errors(text)
2478 from xml.sax.saxutils import unescape
2479+
2480 # uscan --dehs's output isn't well-formed XML, so let's fall back to
2481 # regexes instead..
2482 um = re.search(b'<upstream-version>(.*)</upstream-version>', text)
2483
2484=== modified file 'util.py'
2485--- util.py 2023-01-18 16:38:21 +0000
2486+++ util.py 2023-01-31 19:12:08 +0000
2487@@ -20,56 +20,31 @@
2488
2489 import errno
2490 import hashlib
2491+import os
2492+import re
2493+import shutil
2494 import signal
2495-import shutil
2496 import subprocess
2497 import tempfile
2498-import os
2499-import re
2500
2501-from debian import deb822
2502 from debian.changelog import Changelog, ChangelogParseError
2503 from debian.copyright import Copyright, NotMachineReadableError
2504-
2505-from debmutate.changelog import (
2506- changes_by_author,
2507- find_thanks,
2508- find_extra_authors,
2509- find_last_distribution,
2510- strip_changelog_message,
2511- )
2512+from debmutate.changelog import (changes_by_author, find_extra_authors,
2513+ find_last_distribution, find_thanks,
2514+ strip_changelog_message)
2515 from debmutate.versions import get_snapshot_revision
2516
2517-from ... import (
2518- bugtracker,
2519- errors,
2520- osutils,
2521- urlutils,
2522- )
2523-from ...transport import NoSuchFile
2524+from debian import deb822
2525+
2526+from ... import bugtracker, errors, osutils, urlutils
2527 from ...export import export
2528-from ...trace import (
2529- mutter,
2530- note,
2531- warning,
2532- )
2533-from ...transport import (
2534- do_catching_redirections,
2535- get_transport,
2536- )
2537+from ...trace import mutter, note, warning
2538+from ...transport import NoSuchFile, do_catching_redirections, get_transport
2539 from ...tree import Tree
2540-from . import (
2541- global_conf,
2542- )
2543-from .config import (
2544- DebBuildConfig,
2545- BUILD_TYPE_MERGE,
2546- BUILD_TYPE_NATIVE,
2547- BUILD_TYPE_NORMAL,
2548- )
2549-from .errors import (
2550- BzrError,
2551- )
2552+from . import global_conf
2553+from .config import (BUILD_TYPE_MERGE, BUILD_TYPE_NATIVE, BUILD_TYPE_NORMAL,
2554+ DebBuildConfig)
2555+from .errors import BzrError
2556
2557 BUILDDEB_DIR = '.bzr-builddeb'
2558
2559
2560=== modified file 'vcs_up_to_date.py'
2561--- vcs_up_to_date.py 2023-01-12 11:16:09 +0000
2562+++ vcs_up_to_date.py 2023-01-31 19:12:08 +0000
2563@@ -27,15 +27,11 @@
2564 import logging
2565 import os
2566
2567+from breezy.plugins.debian.apt_repo import LocalApt, RemoteApt
2568+from breezy.plugins.debian.util import MissingChangelogError, find_changelog
2569+from breezy.workingtree import WorkingTree
2570 from debmutate.changelog import distribution_is_unreleased
2571
2572-from breezy.workingtree import WorkingTree
2573-from breezy.plugins.debian.util import find_changelog, MissingChangelogError
2574-from breezy.plugins.debian.apt_repo import (
2575- LocalApt,
2576- RemoteApt,
2577-)
2578-
2579
2580 class PackageMissingInArchive(Exception):
2581 def __init__(self, package):

Subscribers

People subscribed via source and target branches

to all changes: