Skip to main content

Python 3 check local import for flake8

Project description

flake8-local-import

Downloads PyPI PyPI - Python Version PyPI - Wheel PyPI - Implementation

Python 3 check local import for flake8

Installation

pip install flake8-local-import

Configuration

You will want to set the app-import-names option to a comma separated list of names that should be considered local to your application. Note that relative imports are always considered local.

Example

#  Error
def func():
    statement

    from app_package import A   # LI100 Local import must be at the beginning of the method body


#  Error
def func():
    statement

    from app_package import A   # LI100 Local import must be at the beginning of the method body


# Good
def func():
    from app_package import A

    statement

Error codes

code description
LI100 Local import must be at the beginning of the method body
LI101 Packages from external modules should not be imported locally
LI102 Packages from standard modules should not be imported locally

Links

https://github.com/meanmail-dev/flake8-local-import

https://meanmail.dev/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flake8-local-import, version 1.0.5
Filename, size File type Python version Upload date Hashes
Filename, size flake8_local_import-1.0.5-py2.py3-none-any.whl (5.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size flake8_local_import-1.0.5-py3.8.egg (9.6 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size flake8_local_import-1.0.5.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page