File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,24 @@ Basic usage, running in your project directory::
28
28
This will find all imports in the code in "sample" and check that the
29
29
packages those modules belong to are in the requirements.txt file.
30
30
31
+ Additionally it is possible to check that there are no dependencies in
32
+ requirements.txt that are then unused in the project::
33
+ <activate virtualenv for your project>
34
+ pip-extra-reqs --ignore-file=sample/tests/* sample
35
+
36
+ This would find anything that is listed in requirements.txt but that is not
37
+ imported by sample.
31
38
32
39
Sample tox.ini configuration
33
40
----------------------------
34
41
35
42
To make your life easier, copy something like this into your tox.ini::
36
43
37
- [testenv:pip-missing -reqs]
44
+ [testenv:pip-check -reqs]
38
45
deps=-rrequirements.txt
39
- commands=pip-missing-reqs --ignore-file=sample/tests/* sample
46
+ commands=
47
+ pip-missing-reqs --ignore-file=sample/tests/* sample
48
+ pip-extra-reqs --ignore-file=sample/tests/* sample
40
49
41
50
42
51
Excluding test files (or others) from this check
You can’t perform that action at this time.
0 commit comments