diff --git a/openstack_requirements/cmds/edit_constraint.py b/openstack_requirements/cmds/edit_constraint.py index 68f619bb6e..1db62f8078 100644 --- a/openstack_requirements/cmds/edit_constraint.py +++ b/openstack_requirements/cmds/edit_constraint.py @@ -68,7 +68,7 @@ def main(argv=None, stdout=None): content = open(args[0], 'rt').read() reqs = requirement.parse(content, permit_urls=True) out_reqs = edit(reqs, args[1], args[2]) - out = requirement.to_content(out_reqs, prefix=False) + out = requirement.to_content(out_reqs) with open(args[0] + '.tmp', 'wt') as f: f.write(out) if os.path.exists(args[0]): diff --git a/openstack_requirements/requirement.py b/openstack_requirements/requirement.py index 287d063f5d..dd6aaac369 100644 --- a/openstack_requirements/requirement.py +++ b/openstack_requirements/requirement.py @@ -21,17 +21,6 @@ import pkg_resources import re -# A header for the requirements file(s). -# TODO(lifeless): Remove this once constraints are in use. -_REQS_HEADER = [ - '# The order of packages is significant, because pip processes ' - 'them in the order\n', - '# of appearance. Changing the order has an impact on the overall ' - 'integration\n', - '# process, which may cause wedges in the gate later.\n', -] - - def key_specifier(a): weight = {'>=': 0, '>': 0, '===': 1, '==': 1, '~=': 1, '!=': 1, @@ -160,10 +149,8 @@ def parse_line(req_line, permit_urls=False): return Requirement(name, location, specifier, markers, comment, extras) -def to_content(reqs, marker_sep=';', line_prefix='', prefix=True): +def to_content(reqs, marker_sep=';', line_prefix=''): lines = [] - if prefix: - lines += _REQS_HEADER for req in reqs.reqs: lines.append(req.to_line(marker_sep, line_prefix)) return u''.join(lines) diff --git a/openstack_requirements/tests/test_requirement.py b/openstack_requirements/tests/test_requirement.py index 97c5130c20..f0a4ed5daa 100644 --- a/openstack_requirements/tests/test_requirement.py +++ b/openstack_requirements/tests/test_requirement.py @@ -116,8 +116,7 @@ class TestToContent(testtools.TestCase): 'foo', '', '<=1', "python_version=='2.7'", '# BSD')]), marker_sep='!') self.assertEqual( - ''.join(requirement._REQS_HEADER - + ["foo<=1!python_version=='2.7' # BSD\n"]), + "foo<=1!python_version=='2.7' # BSD\n", reqs) def test_location(self): @@ -125,8 +124,7 @@ class TestToContent(testtools.TestCase): [requirement.Requirement( 'foo', 'file://foo', '', "python_version=='2.7'", '# BSD')])) self.assertEqual( - ''.join(requirement._REQS_HEADER - + ["file://foo#egg=foo;python_version=='2.7' # BSD\n"]), + "file://foo#egg=foo;python_version=='2.7' # BSD\n", reqs)