Important
A simple source code import checker that checks your project for whether you:
Import and use everything in your requirements.txt file; and/or
Import packages with specified frequencies using a constraint file (use to wean a project off of a dependency).
Installation
Install the latest stable version from PyPI using:
pip install important
Otherwise, to grab the latest version on master, use:
pip install git+https://github.com/cfournie/important.git
Requirements
This works best when run from a virtualenv where your project’s requirements are installed (to translate requirements to module names).
This tool requires that it be installed with the same Python version as the source code that it’s analyzing and that the source code is syntactically correct.
Usage
Check for unused requirements using:
$ important -v --requirements requirements.txt .
Parsed 52 imports in 8 files
Error: Unused requirements or violated constraints found
caniusepython3 (unused requirement)
Check for imports that are used too frequently (to prevent further usage of a requirement while you phase it out) using:
$ important -v --constraints constraints.txt .
Parsed 52 imports in 8 files
Error: Unused requirements or violated constraints found
click<=1 (constraint violated by click==2)
Check for unused requirements but exclude test files using:
$ important -v --requirements requirements.txt --exclude **/test_*.py .
Parsed 52 imports in 8 files
Error: Unused requirements or violated constraints found
caniusepython3 (unused requirement)
Ignore errors related to some of your requirements using:
$ important -v --requirements requirements.txt --ignore caniusepython3 .
Parsed 52 imports in 8 files
$ important -v --requirements requirements.txt --ignorefile ignored.txt .
Parsed 52 imports in 8 files
Alternatively, you can configure important using a setup.cfg file in the current working directory, e.g.:
[important]
requirements=
requirements.txt
constraints=
constraints.txt
ignore=
Sphinx
flake8
exclude=
.git
sourcecode=.
Then run using:
$ important -v
Parsed 52 imports in 8 files
Metadata
Release files for important 0.1.4
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 | |
|---|---|---|---|---|
| important-0.1.4.tar.gz | 8.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| important-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 19.0 kB
Release files / important-0.1.4.tar.gz
| Download URL | important-0.1.4.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b59e8f8b399d23b26080fb56404dfd11cb6a947aa780abdd303784b7b86c23b
|
|
BLAKE2b-256 checksum How to use checksums |
533c553a170167a2eca92a0b59d78ee8647166be9f933de2022b21c8c7cc1f31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / important-0.1.4-py2.py3-none-any.whl
| Download URL | important-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
448aec08a66b00f3ebcfbb1928b407b2cbf6ccf84fe6104ecd53bfe870ab70be
|
|
BLAKE2b-256 checksum How to use checksums |
7410c709c553e5f1063ef8c57bc31cba10ed3182935b90a202b1955cc58d45f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for important 0.1.4
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.