flake8-import-conventions
An opinionated plugin for Flake8 on how certain packages should be imported or aliased.
It is based on the pandas-vet and flake8-2020 plugins.
Installation
Via Pipenv:
pipenv install --dev flake8 flake8-import-conventions
Flake8 codes
| Package | Code | Description |
|---|---|---|
| Altair | IC001 | altair should be imported as import altair as alt |
| GeoPandas | IC002 | geopandas should be imported as import geopandas |
| Matplotlib | IC003 | matplotlib.pyplot should be imported as import matplotlib.pyplot as plt |
| NetworkX | IC004 | networkx should be imported as import networkx as nx |
| NumPy | IC005 | numpy should be imported as import numpy as np |
| pandas | IC006 | pandas should be imported as import pandas as pd |
| Plotly | IC007 | plotly.express should be imported as import plotly.express as px |
| Plotly | IC008 | plotly.graph_objects should be imported as import plotly.graph_objects as go |
| seaborn | IC009 | seaborn should be imported as import seaborn as sns |
| statsmodels | IC010 | statsmodels.api should be imported as import statsmodels.api as sm |
Development
poetry install --with dev
poetry shell
Open the manual_test.py file in VS Code to see the error messages.
pytest tests/ -v
or (to see print()s)
pytest tests/ -v -s
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)"
References
- Anthony Sottile's "a flake8 plugin from scratch (intermediate) anthony explains #025" tutorial.
- flake8-pie.
- wemake-python-styleguide.
Metadata
Release files for flake8-import-conventions 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flake8_import_conventions-0.1.0.tar.gz | 5.1 kB | Without provenance | Details for flake8_import_conventions-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flake8_import_conventions-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for flake8_import_conventions-0.1.0-py3-none-any.whl |
Total release size: 11.2 kB
Release files / flake8_import_conventions-0.1.0.tar.gz
| Download URL | flake8_import_conventions-0.1.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0710db3a77de023c9a40b4483a9a259a1fdc3d09187892799614bf0f425df779
|
|
BLAKE2b-256 checksum How to use checksums |
4b2a94072dab358027f3ce2a9eee278624124da50be7d252d44b418f7aea2b27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.7.15 Linux/5.15.0-1031-azure
|
Release files / flake8_import_conventions-0.1.0-py3-none-any.whl
| Download URL | flake8_import_conventions-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0a32cbdb78239a4976aef5d3ac958f25a2b6c155760060d40a8bbebe481a03b
|
|
BLAKE2b-256 checksum How to use checksums |
0abc7770ca645bc9739019c2d51aaa9134f974ca623e4c8474f42db6eaf608dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.7.15 Linux/5.15.0-1031-azure
|
Security for flake8-import-conventions 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.