diff --git a/setup.cfg b/setup.cfg index 68c5213..ca22a00 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,5 +18,5 @@ strict = 1 restructuredtext = 1 [flake8] -ignore=_ +ignore = W504 copyright-check = True diff --git a/setup.py b/setup.py index 21ead92..a68ea5f 100644 --- a/setup.py +++ b/setup.py @@ -18,13 +18,12 @@ requires = ['blockdiag>=1.5.0'] test_requires = ['nose', 'pep8>=1.3', + 'flake8', + 'flake8-coding', + 'flake8-copyright', 'reportlab', 'docutils'] -# only for Python2.6 -if sys.version_info > (2, 6) and sys.version_info < (2, 7): - test_requires.append('unittest2') - if (3, 2) < sys.version_info < (3, 3): requires.append('webcolors < 1.5') # webcolors-1.5 does not support py32 diff --git a/src/nwdiag/elements.py b/src/nwdiag/elements.py index dead074..60ecc5b 100644 --- a/src/nwdiag/elements.py +++ b/src/nwdiag/elements.py @@ -36,7 +36,7 @@ def set_attributes(self, network, attrs=None): for attr in attrs: if attr.name == 'address': - address = re.sub('\s*,\s*', '\n', unquote(attr.value)) + address = re.sub(r'\s*,\s*', '\n', unquote(attr.value)) self.address[network] = address else: self.set_attribute(attr) diff --git a/src/nwdiag/tests/test_rst_directives.py b/src/nwdiag/tests/test_rst_directives.py index 2a66702..f61d00f 100644 --- a/src/nwdiag/tests/test_rst_directives.py +++ b/src/nwdiag/tests/test_rst_directives.py @@ -152,7 +152,7 @@ def test_setup_noviewbox_is_true(self): self.assertEqual(1, len(doctree)) self.assertEqual(nodes.image, type(doctree[0])) svg = open(doctree[0]['uri']).read() - self.assertRegexpMatches(svg, '