Skip to content
Snippets Groups Projects
Commit 595d480a authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

pylint fixes

parent 636aa0f3
No related branches found
No related tags found
No related merge requests found
......@@ -44,10 +44,13 @@ from collections import namedtuple
branch_type = namedtuple("branch_type", ["builds_snapshot", "builds_release",
"versioned", "allowed_version_re",
"debian_branch"])
VERSION_RE = "[0-9]+\.[0-9]+(\.[0-9]+)*"
VERSION_RE = "[0-9]+\.[0-9]+(\.[0-9]+)*" # pylint: disable=W1401
HOTFIX_RE = \
"^(?P<bverstr>^%s\.[1-9][0-9]*)$" % VERSION_RE, # pylint: disable=W1401
BRANCH_TYPES = {
"feature": branch_type(True, False, False, "^%snext$" % VERSION_RE,
"debian-develop"),
"debian-develop"),
"develop": branch_type(True, False, False, "^%snext$" % VERSION_RE,
"debian-develop"),
"release": branch_type(True, True, True,
......@@ -56,6 +59,6 @@ BRANCH_TYPES = {
"master": branch_type(True, True, False,
"^%s$" % VERSION_RE, "debian"),
"hotfix": branch_type(True, True, True,
"^(?P<bverstr>^%s\.[1-9][0-9]*)$" % VERSION_RE,
HOTFIX_RE,
"debian")}
BASE_VERSION_FILE = "version"
......@@ -133,7 +133,7 @@ def main():
parser.add_option("--dist",
dest="dist",
default=None,
help="Force distribution in Debian changelog"),
help="Force distribution in Debian changelog")
parser.add_option("-S", "--source-only",
dest="source_only",
default=False,
......
......@@ -230,7 +230,7 @@ def undebianize(branch):
def get_distribution_codename():
output = sh.lsb_release("-c")
output = sh.lsb_release("-c") # pylint: disable=E1101
_, codename = output.split("\t")
codename = codename.strip()
return codename
......@@ -51,8 +51,8 @@ from devflow import BRANCH_TYPES, BASE_VERSION_FILE, VERSION_RE
from devflow import utils
DEFAULT_VERSION_FILE =\
"""__version__ = "%(DEVFLOW_VERSION)s"
DEFAULT_VERSION_FILE = """
__version__ = "%(DEVFLOW_VERSION)s"
__version_vcs_info__ = {
'branch': '%(DEVFLOW_BRANCH)s',
'revid': '%(DEVFLOW_REVISION_ID)s',
......@@ -227,8 +227,8 @@ def python_version(base_version, vcs_info, mode):
"'release'" % mode)
snap = (mode == "snapshot")
if ((snap and not btype.builds_snapshot) or
(not snap and not btype.builds_release)): # nopep8
if (snap and not btype.builds_snapshot) or\
(not snap and not btype.builds_release): # nopep8
raise ValueError("Invalid mode '%s' in branch type '%s'" %
(mode, btypestr))
......@@ -365,9 +365,9 @@ def update_version():
b = get_base_version(v)
mode = utils.get_build_mode()
version = python_version(b, v, mode)
debian_version = debian_version_from_python_version(version)
debian_version_ = debian_version_from_python_version(version)
env = {"DEVFLOW_VERSION": version,
"DEVFLOW_DEBIAN_VERSION": debian_version,
"DEVFLOW_DEBIAN_VERSION": debian_version_,
"DEVFLOW_BRANCH": v.branch,
"DEVFLOW_REVISION_ID": v.revid,
"DEVFLOW_REVISION_NUMBER": v.revno,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment