Check the missing packages in requirements.txt
Project description
check-requirements-txt
A tool (and also a pre-commit hook) to automatically check the missing packages in requirements.txt.
Install
First install this package into current python env
pip install check-requirements-txt
Then set up pre-commit
hooks
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
NOTE: Due to the pre-commit isolated pyenv runtime, this package can't be act as a normal git repo pre-commit hooks
default_stages: [commit]
repos:
- repo: local
hooks:
- id: check-requirements-txt
name: check-requirements-txt
description: Check the missing packages in requirements.txt.
entry: check-requirements-txt
args: ['--ignore', 'pip,']
language: python
types: [python]
check-requirements-txt
can be used as a normal cli tool, see check-requirements-txt --help
for more details.
Output sample
Bad import detected: "bs4"
/Users/ferstar/PycharmProjects/xxx_demo/xxx_spider.py:12
Bad import detected: "requests"
/Users/ferstar/PycharmProjects/xxx_demo/xxx_handler.py:17
"numpy" required by: {'numpy', 'scikit-learn', 'tensorflow', 'pandas'}
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for check_requirements_txt-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28bdd09ac6018c27d4e23936f1a7cc272aa2544a4a0e8a1935132cb587328f94 |
|
MD5 | 108206444c208a4495fa8af94176bdc2 |
|
BLAKE2b-256 | 93da66f3bcb8f17608c89c7d159aa08fe4df01527cb4bb862df74e8a9161ff13 |