Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flake8 violations #1018

Merged
merged 18 commits into from
Feb 8, 2022

Conversation

dorothykiz1
Copy link
Contributor

@dorothykiz1 dorothykiz1 commented Feb 7, 2022

This PR Fixes flake8 violations in ;

  1. asv/init.py
  2. asv/benchmarks.py
  3. asv/config.py
  4. asv/benchmark.py

asv/__init__.py Outdated
@@ -29,4 +29,4 @@
if os.environ.get('__PYVENV_LAUNCHER__'):
os.unsetenv('__PYVENV_LAUNCHER__')

from . import plugin_manager
from . import plugin_manager # noqa this dependency is not used here but it may be used in other files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the error that you are receiving here, if this unused import is removed?

You should add the error code to ignore, not just use noqa

Copy link
Contributor Author

@dorothykiz1 dorothykiz1 Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Marc,
There's no particular error as regards to this an appveyor, should I add the flake8 error am ignoring

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no error in appveyor when removing this import, why do we need to keep it and ignore the flake8 issue, instead of just removing the import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I remove the line completely, appveyor fails with the build below , when I leave it with the # noqa it runs.
https://ci.appveyor.com/project/airspeed-velocity/asv/builds/42489522

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the relevant error in the build, can you post it here please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C:\projects\asv\asv\commands_init_.py:84: KeyError
C:\projects\asv\asv\repo.py:313: UserError
these are the 2 errors in the build

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that. But do you mind sharing the whole traceback of the error please. At least the error message, and the failing code. Just what you sent doesn't seem to be useful at all in understanding and diacussing the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run: flake8 asv/__init__.py asv/config.py asv/benchmarks.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as in the other PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to test the actual files I had added to this branch but I will remove it .

@dorothykiz1
Copy link
Contributor Author

@datapythonista this PR is ready for your review will await your guidance

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. The files that you fix should be added to the CI. Also, since this is quite small and some changes seem repeated with another PR, it may make sense to implement the changes here there, and close this, but up to you. If you keep this open, a more descriptive description that let us know how this PR is different from he similar ones could be helpful.

asv/__init__.py Outdated
@@ -29,4 +29,4 @@
if os.environ.get('__PYVENV_LAUNCHER__'):
os.unsetenv('__PYVENV_LAUNCHER__')

from . import plugin_manager
from . import plugin_manager # noqa: F401 this updates command args to plugin args
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation doesn't make sense.

For the comment, maybe better unused, but required to load plugins

asv/benchmarks.py Show resolved Hide resolved
@dorothykiz1
Copy link
Contributor Author

@datapythonista this PR is ready for your review

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the clean up @dorothykiz1

@datapythonista datapythonista merged commit 95eedfd into airspeed-velocity:master Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants