Get startedGet started for free

Configuring flake8

In the top-level __init__.py file of the impyrial package folder, you imported the length and weight subpackages to expose them to users. However, these imports aren't used, so flake8 will keep notifying you about them.

You also might have some style violations in your tests directory, which you would like to ignore.

In this exercise, you will configure flake8 to ignore these violations.

This exercise is part of the course

Developing Python Packages

View Course

Exercise instructions

  • Run flake8 on the whole package.
  • Modify the config to ignore unused imports (F401) violations in the impyrial/__init__.py file. Make sure to uncomment the sample lines.
  • Modify the config to ignore all violations in tests/*. Make sure to uncomment the sample lines.
  • Run flake8 again to see the difference.

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise