diff --git a/src/tito/builder/fetch.py b/src/tito/builder/fetch.py index ccd432a..94e69fc 100644 --- a/src/tito/builder/fetch.py +++ b/src/tito/builder/fetch.py @@ -21,6 +21,7 @@ from tito.config_object import ConfigObject from tito.common import error_out, debug, get_spec_version_and_release, \ get_class_by_name + class FetchBuilder(ConfigObject, BuilderBase): """ A separate Builder class for projects whose source is not in git. Source @@ -212,5 +213,3 @@ class ArgSourceStrategy(SourceStrategy): in_f.close() out_f.close() shutil.move(self.spec_file + ".new", self.spec_file) - - diff --git a/src/tito/builder/main.py b/src/tito/builder/main.py index 756904b..3c5acd7 100644 --- a/src/tito/builder/main.py +++ b/src/tito/builder/main.py @@ -287,7 +287,6 @@ class BuilderBase(object): pass - class Builder(ConfigObject, BuilderBase): """ Parent builder class. @@ -373,7 +372,6 @@ class Builder(ConfigObject, BuilderBase): # Set to path to srpm once we build one. self.srpm_location = None - def _get_build_version(self): """ Figure out the git tag and version-release we're building. @@ -1295,7 +1293,3 @@ class ExternalSourceBuilder(ConfigObject, BuilderBase): else: version = self.build_version.split("-")[0] return version - - - - diff --git a/src/tito/cli.py b/src/tito/cli.py index c4605c1..3769461 100644 --- a/src/tito/cli.py +++ b/src/tito/cli.py @@ -308,7 +308,6 @@ class BaseCliModule(object): # Delete the temp properties file we created. run_command("rm %s" % properties_file) - def _validate_options(self): """ Subclasses can implement if they need to check for any diff --git a/src/tito/common.py b/src/tito/common.py index e170637..7f281cc 100644 --- a/src/tito/common.py +++ b/src/tito/common.py @@ -169,6 +169,7 @@ def find_file_with_extension(in_dir=None, suffix=None): else: return file_name + def find_spec_file(in_dir=None): """ Find the first spec file in the current directory. @@ -210,6 +211,7 @@ def extract_sha1(output): else: return "" + def run_command(command, print_on_success=False): """ Run command. @@ -360,6 +362,7 @@ def scl_to_rpm_option(scl, silent=None): rpm_options += " --eval '%undefine scl'" return rpm_options + def get_project_name(tag=None, scl=None): """ Extract the project name from the specified tag or a spec file in the @@ -632,4 +635,3 @@ def find_wrote_in_rpmbuild_output(output): if not paths: error_out("Unable to locate 'Wrote: ' lines in rpmbuild output") return paths - diff --git a/src/tito/config_object.py b/src/tito/config_object.py index 68a8395..b5e10b7 100644 --- a/src/tito/config_object.py +++ b/src/tito/config_object.py @@ -17,6 +17,7 @@ Shared code for builder and tagger class import os from tito.common import find_git_root + class ConfigObject(object): """ Perent class for Builder and Tagger with shared code @@ -38,4 +39,3 @@ class ConfigObject(object): self.git_root = find_git_root() self.rel_eng_dir = os.path.join(self.git_root, "rel-eng") - diff --git a/src/tito/distributionbuilder.py b/src/tito/distributionbuilder.py index 6c7e215..dd5bca5 100644 --- a/src/tito/distributionbuilder.py +++ b/src/tito/distributionbuilder.py @@ -4,6 +4,7 @@ from tito.builder import UpstreamBuilder from tito.common import debug, run_command, error_out import commands + class DistributionBuilder(UpstreamBuilder): """ This class is used for building packages for distributions. Parent class UpstreamBuilder build one big patch from upstream and create e.g.: diff --git a/src/tito/exception.py b/src/tito/exception.py index af3d133..f3673c9 100644 --- a/src/tito/exception.py +++ b/src/tito/exception.py @@ -29,6 +29,7 @@ class TitoException(Exception): def __str__(self): return "TitoException: %s" % self.message + class RunCommandException(Exception): """ Raised by run_command() """ def __init__(self, msg, command, status, output): diff --git a/src/tito/obs.py b/src/tito/obs.py index f947083..df8e1c1 100644 --- a/src/tito/obs.py +++ b/src/tito/obs.py @@ -142,7 +142,6 @@ class ObsReleaser(Releaser): self.cli_tool, self.obs_project_name, self.obs_package_name)) print("Aborting automatic rebuild because --no-build has been specified.") - def _obs_sync_files(self, project_checkout): """ Copy files from our obs checkout into each obs checkout and add them. @@ -164,4 +163,3 @@ class ObsReleaser(Releaser): # Add/remove everything: run_command("%s addremove" % (self.cli_tool)) - diff --git a/src/tito/tagger.py b/src/tito/tagger.py index cf909d8..fe91d10 100644 --- a/src/tito/tagger.py +++ b/src/tito/tagger.py @@ -37,6 +37,7 @@ from tito.common import (debug, error_out, run_command, from tito.exception import TitoException from tito.config_object import ConfigObject + class VersionTagger(ConfigObject): """ Standard Tagger class, used for tagging packages built from source in @@ -626,5 +627,3 @@ class ForceVersionTagger(VersionTagger): self._update_changelog(new_version) self._update_setup_py(new_version) self._update_package_metadata(new_version) - - diff --git a/test/functional/fetch_tests.py b/test/functional/fetch_tests.py index 859ecbf..ea01a4c 100644 --- a/test/functional/fetch_tests.py +++ b/test/functional/fetch_tests.py @@ -35,6 +35,7 @@ builder = tito.builder.FetchBuilder rsync = %s """ + class FetchBuilderTests(TitoGitTestFixture): def setUp(self): @@ -97,4 +98,3 @@ class FetchBuilderTests(TitoGitTestFixture): "extsrc-0.0.2-1.*.noarch.rpm")))) self.assertEquals(1, len(glob.glob(join(yum_repo_dir, "repodata/repomd.xml")))) - diff --git a/test/functional/release_yum_tests.py b/test/functional/release_yum_tests.py index ff20b89..867c22c 100644 --- a/test/functional/release_yum_tests.py +++ b/test/functional/release_yum_tests.py @@ -34,6 +34,7 @@ builder = tito.builder.Builder rsync = %s """ + class YumReleaserTests(TitoGitTestFixture): def setUp(self): @@ -68,5 +69,3 @@ class YumReleaserTests(TitoGitTestFixture): "releaseme-0.0.1-1.*.noarch.rpm")))) self.assertEquals(1, len(glob.glob(join(yum_repo_dir, "repodata/repomd.xml")))) - - diff --git a/test/functional/singleproject_tests.py b/test/functional/singleproject_tests.py index 4b17c6b..3c87710 100644 --- a/test/functional/singleproject_tests.py +++ b/test/functional/singleproject_tests.py @@ -79,4 +79,3 @@ class SingleProjectTests(TitoGitTestFixture): def test_build_rpm_tag(self): tito("build --rpm --tag=%s-0.0.1-1 -o %s" % (PKG_NAME, self.repo_dir)) - diff --git a/test/unit/common-tests.py b/test/unit/common-tests.py index 59bea1b..b8cc84b 100644 --- a/test/unit/common-tests.py +++ b/test/unit/common-tests.py @@ -81,6 +81,7 @@ class CommonTests(unittest.TestCase): self.assertEquals("fe87e2b75ed1850718d99c797cc171b88bfad5ca", extract_sha1(ls_remote_output)) + class VersionMathTest(unittest.TestCase): def test_increase_version_minor(self): line = "1.0.0" diff --git a/test/unit/pep8-tests.py b/test/unit/pep8-tests.py index 0c35b5a..ba39aad 100644 --- a/test/unit/pep8-tests.py +++ b/test/unit/pep8-tests.py @@ -33,8 +33,10 @@ class TestPep8(TitoUnitTestFixture): tests = [ # http://pep8.readthedocs.org/en/latest/intro.html#error-codes 'E2', # whitespace errors + 'E3', # blank line errors 'E9', # runtime errors (SyntaxError, IndentationError, IOError) 'W2', # whitespace warnings + 'W3', # blank line warnings 'W6', # deprecated features ]