launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #19655
[Merge] lp:~cjwatson/launchpad/soyuz-lint into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/soyuz-lint into lp:launchpad.
Commit message:
Remove lots of lint from Soyuz and friends.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/soyuz-lint/+merge/275155
Remove lots of lint from Soyuz and friends.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/soyuz-lint into lp:launchpad.
=== modified file 'lib/lp/archivepublisher/diskpool.py'
--- lib/lp/archivepublisher/diskpool.py 2011-12-30 01:10:37 +0000
+++ lib/lp/archivepublisher/diskpool.py 2015-10-21 09:48:51 +0000
@@ -51,7 +51,8 @@
if not os.path.isabs(dst_path):
dst_path = os.path.abspath(dst_path)
common_prefix = os.path.commonprefix([src_path_elems, dst_path_elems])
- backward_elems = ['..'] * (len(dst_path_elems)-len(common_prefix)-1)
+ backward_elems = ['..'] * (
+ len(dst_path_elems) - len(common_prefix) - 1)
forward_elems = src_path_elems[len(common_prefix):]
src_path = path_sep.join(backward_elems + forward_elems)
os.symlink(src_path, dst_path)
@@ -239,7 +240,6 @@
"File for removing %s %s/%s is not in pool, skipping." %
(component, self.source, self.filename))
-
# Okay, it's there, if it's a symlink then we need to remove
# it simply.
if component in self.symlink_components:
=== modified file 'lib/lp/archivepublisher/interfaces/archivesigningkey.py'
--- lib/lp/archivepublisher/interfaces/archivesigningkey.py 2013-01-07 02:40:55 +0000
+++ lib/lp/archivepublisher/interfaces/archivesigningkey.py 2015-10-21 09:48:51 +0000
@@ -85,5 +85,3 @@
:raises AssertionError: if the context archive has no `signing_key`
or there is no Release file in the given suite.
"""
-
-
=== modified file 'lib/lp/archiveuploader/scripts/processupload.py'
--- lib/lp/archiveuploader/scripts/processupload.py 2014-08-09 19:34:08 +0000
+++ lib/lp/archiveuploader/scripts/processupload.py 2015-10-21 09:48:51 +0000
@@ -44,7 +44,7 @@
self.parser.add_option(
"-J", "--just-leaf", action="store", dest="leafname",
default=None, help="A specific leaf dir to limit to.",
- metavar = "LEAF")
+ metavar="LEAF")
self.parser.add_option(
"-C", "--context", action="store", dest="context",
@@ -77,6 +77,7 @@
"%s is not a directory" % self.options.base_fsroot)
self.logger.debug("Initializing connection.")
+
def getPolicy(distro, build):
self.options.distro = distro.name
policy = findPolicyByName(self.options.context)
@@ -87,6 +88,7 @@
policy.pocket = build.pocket
policy.archive = build.archive
return policy
+
processor = UploadProcessor(self.options.base_fsroot,
self.options.dryrun, self.options.nomails, self.options.builds,
self.options.keep, getPolicy, self.txn, self.logger)
@@ -101,5 +103,3 @@
of each other.
"""
return "process-upload-%s.lock" % self.options.context
-
-
=== modified file 'lib/lp/buildmaster/browser/tests/test_builder.py'
--- lib/lp/buildmaster/browser/tests/test_builder.py 2015-10-13 16:58:20 +0000
+++ lib/lp/buildmaster/browser/tests/test_builder.py 2015-10-21 09:48:51 +0000
@@ -5,7 +5,6 @@
__metaclass__ = type
-from testtools.matchers import Equals
from zope.component import getUtility
from lp.buildmaster.browser.tests.test_builder_views import BuildCreationMixin
=== modified file 'lib/lp/buildmaster/browser/tests/test_builder_views.py'
--- lib/lp/buildmaster/browser/tests/test_builder_views.py 2015-10-13 16:58:20 +0000
+++ lib/lp/buildmaster/browser/tests/test_builder_views.py 2015-10-21 09:48:51 +0000
@@ -7,10 +7,7 @@
import soupmatchers
from storm.locals import Store
-from testtools.matchers import (
- Equals,
- MatchesAll,
- )
+from testtools.matchers import MatchesAll
import transaction
from zope.component import getUtility
=== modified file 'lib/lp/soyuz/adapters/tests/test_copypolicy.py'
--- lib/lp/soyuz/adapters/tests/test_copypolicy.py 2014-08-21 03:44:25 +0000
+++ lib/lp/soyuz/adapters/tests/test_copypolicy.py 2015-10-21 09:48:51 +0000
@@ -3,10 +3,7 @@
from lp.registry.interfaces.pocket import PackagePublishingPocket
from lp.registry.interfaces.series import SeriesStatus
-from lp.soyuz.adapters.copypolicy import (
- InsecureCopyPolicy,
- MassSyncCopyPolicy,
- )
+from lp.soyuz.adapters.copypolicy import InsecureCopyPolicy
from lp.soyuz.enums import (
ArchivePurpose,
PackageCopyPolicy,
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2015-07-08 16:05:11 +0000
+++ lib/lp/soyuz/browser/build.py 2015-10-21 09:48:51 +0000
@@ -30,10 +30,7 @@
Interface,
)
from zope.security.interfaces import Unauthorized
-from zope.security.proxy import (
- isinstance as zope_isinstance,
- removeSecurityProxy,
- )
+from zope.security.proxy import removeSecurityProxy
from lp import _
from lp.app.browser.launchpadform import (
=== modified file 'lib/lp/soyuz/browser/tests/test_archive.py'
--- lib/lp/soyuz/browser/tests/test_archive.py 2015-10-13 16:58:20 +0000
+++ lib/lp/soyuz/browser/tests/test_archive.py 2015-10-21 09:48:51 +0000
@@ -5,7 +5,6 @@
from fixtures import FakeLogger
from testtools.matchers import (
- Equals,
MatchesSetwise,
MatchesStructure,
)
=== modified file 'lib/lp/soyuz/browser/tests/test_archive_webservice.py'
--- lib/lp/soyuz/browser/tests/test_archive_webservice.py 2015-10-13 16:58:20 +0000
+++ lib/lp/soyuz/browser/tests/test_archive_webservice.py 2015-10-21 09:48:51 +0000
@@ -12,10 +12,7 @@
Unauthorized as LRUnauthorized,
)
from testtools import ExpectedException
-from testtools.matchers import (
- Equals,
- MatchesStructure,
- )
+from testtools.matchers import MatchesStructure
import transaction
from zope.component import getUtility
=== modified file 'lib/lp/soyuz/browser/tests/test_livefsbuild.py'
--- lib/lp/soyuz/browser/tests/test_livefsbuild.py 2015-08-03 12:59:18 +0000
+++ lib/lp/soyuz/browser/tests/test_livefsbuild.py 2015-10-21 09:48:51 +0000
@@ -36,8 +36,6 @@
extract_text,
find_main_content,
find_tags_by_class,
- setupBrowser,
- setupBrowserForUser,
)
from lp.testing.views import create_initialized_view
=== modified file 'lib/lp/soyuz/browser/tests/test_queue.py'
--- lib/lp/soyuz/browser/tests/test_queue.py 2013-07-25 11:58:55 +0000
+++ lib/lp/soyuz/browser/tests/test_queue.py 2015-10-21 09:48:51 +0000
@@ -322,16 +322,16 @@
self.assertStatus(package_upload_id, PackageUploadStatus.NEW)
def test_reject_with_comment(self):
- login_person(self.proposed_queue_admin)
- package_upload_id = self.proposed_spr.package_upload.id
- form = {
- 'Reject': 'Reject',
- 'rejection_comment': 'Because I can.',
- 'QUEUE_ID': [package_upload_id]}
- request = LaunchpadTestRequest(form=form)
- request.method = 'POST'
- self.setupQueueView(request)
- self.assertStatus(package_upload_id, PackageUploadStatus.REJECTED)
+ login_person(self.proposed_queue_admin)
+ package_upload_id = self.proposed_spr.package_upload.id
+ form = {
+ 'Reject': 'Reject',
+ 'rejection_comment': 'Because I can.',
+ 'QUEUE_ID': [package_upload_id]}
+ request = LaunchpadTestRequest(form=form)
+ request.method = 'POST'
+ self.setupQueueView(request)
+ self.assertStatus(package_upload_id, PackageUploadStatus.REJECTED)
class TestQueueItemsView(TestCaseWithFactory):
=== modified file 'lib/lp/soyuz/interfaces/distributionsourcepackagecache.py'
--- lib/lp/soyuz/interfaces/distributionsourcepackagecache.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/distributionsourcepackagecache.py 2015-10-21 09:48:51 +0000
@@ -35,4 +35,3 @@
distributionsourcepackage = Attribute("The DistributionSourcePackage "
"for which this is a cache.")
-
=== modified file 'lib/lp/soyuz/interfaces/distroarchseriesbinarypackage.py'
--- lib/lp/soyuz/interfaces/distroarchseriesbinarypackage.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/distroarchseriesbinarypackage.py 2015-10-21 09:48:51 +0000
@@ -65,4 +65,3 @@
version, or None if there has never been a release with that
version, in this architecture series.
"""
-
=== modified file 'lib/lp/soyuz/interfaces/distroseriesbinarypackage.py'
--- lib/lp/soyuz/interfaces/distroseriesbinarypackage.py 2014-11-09 11:48:45 +0000
+++ lib/lp/soyuz/interfaces/distroseriesbinarypackage.py 2015-10-21 09:48:51 +0000
@@ -57,4 +57,3 @@
title=_("The DistributionSourcePackageRelease that was used to "
"generate the most recently published binary package "
"release"))
-
=== modified file 'lib/lp/soyuz/interfaces/distroseriespackagecache.py'
--- lib/lp/soyuz/interfaces/distroseriespackagecache.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/distroseriespackagecache.py 2015-10-21 09:48:51 +0000
@@ -37,5 +37,3 @@
descriptions = Attribute("A concatenation of the descriptions "
"of the binary packages from this binary package name in the "
"distro series.")
-
-
=== modified file 'lib/lp/soyuz/interfaces/packagecopyrequest.py'
--- lib/lp/soyuz/interfaces/packagecopyrequest.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/packagecopyrequest.py 2015-10-21 09:48:51 +0000
@@ -195,4 +195,3 @@
:return: a (potentially empty) result set of `IPackageCopyRequest`
instances.
"""
-
=== modified file 'lib/lp/soyuz/interfaces/packagerelationship.py'
--- lib/lp/soyuz/interfaces/packagerelationship.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/packagerelationship.py 2015-10-21 09:48:51 +0000
@@ -34,6 +34,7 @@
url = Attribute("URL to where this token should link to. It can be None, "
"in this case no link should be rendered.")
+
class IPackageRelationshipSet(Interface):
"""IPackageRelationShip aggregator."""
=== modified file 'lib/lp/soyuz/interfaces/packagesetgroup.py'
--- lib/lp/soyuz/interfaces/packagesetgroup.py 2011-12-24 16:54:44 +0000
+++ lib/lp/soyuz/interfaces/packagesetgroup.py 2015-10-21 09:48:51 +0000
@@ -21,7 +21,7 @@
class IPackagesetGroup(IHasOwner):
- """A group of related package sets across distroseries'
+ """A group of related package sets across distroseries.
This class is used internally to group related packagesets across
distroseries. For example, if in Karmic there is a 'gnome-games'
@@ -40,4 +40,3 @@
owner = Reference(
IPerson, title=_("Person"), required=True, readonly=True,
description=_("The person who created this packageset group."))
-
=== modified file 'lib/lp/soyuz/interfaces/section.py'
--- lib/lp/soyuz/interfaces/section.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/section.py 2015-10-21 09:48:51 +0000
@@ -53,4 +53,3 @@
def new(name):
"""Create a new section."""
-
=== modified file 'lib/lp/soyuz/model/archiveauthtoken.py'
--- lib/lp/soyuz/model/archiveauthtoken.py 2015-07-08 16:05:11 +0000
+++ lib/lp/soyuz/model/archiveauthtoken.py 2015-10-21 09:48:51 +0000
@@ -59,7 +59,7 @@
"""Return a custom archive url for basic authentication."""
normal_url = URI(self.archive.archive_url)
auth_url = normal_url.replace(
- userinfo="%s:%s" %(self.person.name, self.token))
+ userinfo="%s:%s" % (self.person.name, self.token))
return str(auth_url)
=== modified file 'lib/lp/soyuz/model/packagesetgroup.py'
--- lib/lp/soyuz/model/packagesetgroup.py 2015-07-08 16:05:11 +0000
+++ lib/lp/soyuz/model/packagesetgroup.py 2015-10-21 09:48:51 +0000
@@ -30,4 +30,3 @@
owner_id = Int(name='owner', allow_none=False)
owner = Reference(owner_id, 'Person.id')
-
=== modified file 'lib/lp/soyuz/model/section.py'
--- lib/lp/soyuz/model/section.py 2015-07-08 16:05:11 +0000
+++ lib/lp/soyuz/model/section.py 2015-10-21 09:48:51 +0000
@@ -73,4 +73,3 @@
def new(self, name):
"""See ISectionSet."""
return Section(name=name)
-
=== modified file 'lib/lp/soyuz/scripts/add_missing_builds.py'
--- lib/lp/soyuz/scripts/add_missing_builds.py 2013-05-31 02:51:23 +0000
+++ lib/lp/soyuz/scripts/add_missing_builds.py 2015-10-21 09:48:51 +0000
@@ -111,4 +111,3 @@
self.txn.abort()
self.logger.info("Errors, aborted transaction.")
sys.exit(1)
-
=== modified file 'lib/lp/soyuz/scripts/gina/__init__.py'
--- lib/lp/soyuz/scripts/gina/__init__.py 2011-12-21 20:23:01 +0000
+++ lib/lp/soyuz/scripts/gina/__init__.py 2015-10-21 09:48:51 +0000
@@ -14,11 +14,13 @@
class ExecutionError(Exception):
"""The command executed in a cal() returned a non-zero status"""
+
def subprocess_setup():
# Python installs a SIGPIPE handler by default. This is usually not what
# non-Python subprocesses expect.
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
def call(cmd):
"""Run a command, raising a RuntimeError if the command failed"""
log.debug("Running %s" % cmd)
@@ -30,4 +32,3 @@
if p.returncode != 0:
raise ExecutionError("Error %d running %s" % (p.returncode, cmd))
return p.returncode
-
=== modified file 'lib/lp/soyuz/scripts/gina/changelog.py'
--- lib/lp/soyuz/scripts/gina/changelog.py 2015-04-21 10:03:15 +0000
+++ lib/lp/soyuz/scripts/gina/changelog.py 2015-10-21 09:48:51 +0000
@@ -14,11 +14,12 @@
from lp.archivepublisher.debversion import Version
+
def parse_first_line(line):
# SRCPKGNAME (VERSION).*((urgency|priority)=\S+)?
match = first_re.match(line)
if not match:
- raise ValueError, line
+ raise ValueError(line)
srcpkg = match.group(1)
version = match.group(2)
@@ -32,8 +33,8 @@
def parse_last_line(line):
- maint = line[:line.find(">")+1].strip()
- date = line[line.find(">")+1:].strip()
+ maint = line[:line.find(">") + 1].strip()
+ date = line[line.find(">") + 1:].strip()
return (maint, date)
@@ -100,4 +101,3 @@
if __name__ == '__main__':
import pprint
pprint.pprint(parse_changelog(file(sys.argv[1], "r")))
-
=== modified file 'lib/lp/soyuz/scripts/gina/library.py'
--- lib/lp/soyuz/scripts/gina/library.py 2013-05-02 00:40:14 +0000
+++ lib/lp/soyuz/scripts/gina/library.py 2015-10-21 09:48:51 +0000
@@ -46,7 +46,7 @@
assert os.path.exists(fullpath)
digester = hashlib.sha1()
openfile = open(fullpath, "r")
- for chunk in iter(lambda: openfile.read(1024*4), ''):
+ for chunk in iter(lambda: openfile.read(1024 * 4), ''):
digester.update(chunk)
digest = digester.hexdigest()
openfile.close()
=== modified file 'lib/lp/soyuz/scripts/tests/__init__.py'
--- lib/lp/soyuz/scripts/tests/__init__.py 2009-05-13 08:10:10 +0000
+++ lib/lp/soyuz/scripts/tests/__init__.py 2015-10-21 09:48:51 +0000
@@ -1,1 +0,0 @@
-
=== modified file 'lib/lp/soyuz/tests/test_build_start_estimation.py'
--- lib/lp/soyuz/tests/test_build_start_estimation.py 2015-04-20 15:59:52 +0000
+++ lib/lp/soyuz/tests/test_build_start_estimation.py 2015-10-21 09:48:51 +0000
@@ -85,4 +85,3 @@
build1.archive.disable()
estimate = self.job_start_estimate(build2)
self.assertEquals(5, (estimate - now).seconds)
-
=== modified file 'lib/lp/soyuz/tests/test_livefsbuildbehaviour.py'
--- lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2015-10-21 09:48:51 +0000
@@ -12,10 +12,7 @@
import transaction
from twisted.trial.unittest import TestCase as TrialTestCase
from zope.component import getUtility
-from zope.security.proxy import (
- Proxy,
- removeSecurityProxy,
- )
+from zope.security.proxy import Proxy
from lp.buildmaster.enums import BuildStatus
from lp.buildmaster.interfaces.builder import CannotBuild
=== modified file 'lib/lp/soyuz/tests/test_packageset.py'
--- lib/lp/soyuz/tests/test_packageset.py 2014-07-05 00:23:24 +0000
+++ lib/lp/soyuz/tests/test_packageset.py 2015-10-21 09:48:51 +0000
@@ -6,7 +6,6 @@
from zope.component import getUtility
from zope.security.interfaces import Unauthorized
-from lp.app.errors import NotFoundError
from lp.registry.errors import NoSuchSourcePackageName
from lp.registry.interfaces.distribution import IDistributionSet
from lp.registry.interfaces.series import SeriesStatus
Follow ups