From 4ddeed9c390a1a0917fbf0ea019229533a3c599b Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Wed, 16 Mar 2022 23:33:48 +0000 Subject: [PATCH 1/2] CLN: Fix flake8 issues caused by code being a template --- setup.cfg | 2 +- test/test_repo_template/setup.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index a21a2055a..3e43213a8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -59,7 +59,7 @@ max-line-length = 99 ignore = W504, # W504: Line break occurred after a binary operator E741 # E741: Do not use variables named 'I', 'O', or 'l' -exclude = setup.py, +exclude = asv/extern, test/benchmark.invalid, test/example_results, diff --git a/test/test_repo_template/setup.py b/test/test_repo_template/setup.py index fed0d3768..48f2365c5 100644 --- a/test/test_repo_template/setup.py +++ b/test/test_repo_template/setup.py @@ -2,8 +2,12 @@ from setuptools import setup +# This file is a template, and will be rendered before executed. +# So the double curly brackets will become single after rendering, and +# when executed, this will work as expected +content = 'env = {{}}\n'.format(os.environ) # noqa W291 caused by the above comment with open('asv_test_repo/build_time_env.py', 'w') as f: - f.write("env = {{}}\n".format(repr(dict(os.environ)))) + f.write(content) setup(name='asv_test_repo', version="{version}", From 32fea58a8af3661e7b7d1a27487b16143b1b46ea Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Wed, 16 Mar 2022 23:56:58 +0000 Subject: [PATCH 2/2] Fix test error --- test/test_repo_template/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_repo_template/setup.py b/test/test_repo_template/setup.py index 48f2365c5..f794b1c78 100644 --- a/test/test_repo_template/setup.py +++ b/test/test_repo_template/setup.py @@ -5,7 +5,7 @@ # This file is a template, and will be rendered before executed. # So the double curly brackets will become single after rendering, and # when executed, this will work as expected -content = 'env = {{}}\n'.format(os.environ) # noqa W291 caused by the above comment +content = 'env = {{}}\n'.format(repr(dict(os.environ))) # noqa W291 see above comment with open('asv_test_repo/build_time_env.py', 'w') as f: f.write(content)