A Flake8 plugin to check if specific packages are imported as modules.
Project description
flake8-import-as-module
A Flake8 plugin to check if specific packages are imported as modules.
Installation
Via Pipenv:
pipenv install --dev flake8 flake8-import-as-module
Flake8 codes
Package | Code | Description |
---|---|---|
Altair | IM001 | from altair import ... is unconventional. altair should be imported as a module. |
pandas | IM002 | from pandas import ... is unconventional. pandas should be imported as a module. |
References
- https://docs.python.org/3.7/tutorial/modules.html
- https://stackoverflow.com/a/49072655
- https://github.com/marcgibbons/flake8-datetime-import
- https://github.com/joaopalmeiro/flake8-import-conventions
- https://github.com/asottile/flake8-2020
Development
poetry install --with dev
poetry shell
pytest tests/ -v
Copy the output of the following script and paste it in the Flake8 codes section:
python gen_table.py
If changes are not reflected in VS Code after changing something in the package, close it and open it again.
Deployment
poetry check
poetry version minor
or
poetry version patch
Commit the change in the pyproject.toml
file.
git tag
git tag "v$(poetry version --short)"
git push origin "v$(poetry version --short)"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flake8_import_as_module-0.1.0.tar.gz
.
File metadata
- Download URL: flake8_import_as_module-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.7.15 Linux/5.15.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b2b0a19f0ba7b83b7b7cf184cdf95816478670e40439241557d1b7f8de8e007 |
|
MD5 | 7aaf5b355d3c0fee9ac7af3c65c9344c |
|
BLAKE2b-256 | 04633eb3bdbe1f1f16ca3b81ac31bdd4d178572714112065522a3fdb6ed8d341 |
File details
Details for the file flake8_import_as_module-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: flake8_import_as_module-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.7.15 Linux/5.15.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a49785dfc0752608e64fb26df68fa58d18b05874c10daaa9df2f71f1b30d30 |
|
MD5 | 7814e47b68cf5b8b433c2a741412e92d |
|
BLAKE2b-256 | 48befdee445206c6639c8ca41259726e67c39fe8f75f4fbb598b550306ac7fb1 |