@@ -2,10 +2,6 @@ python-inspector - inspect Python package dependencies and metadata
2
2
=====================================================================
3
3
4
4
5
- Copyright (c) nexB Inc. and others.
6
- SPDX-License-Identifier: Apache-2.0
7
- Homepage: https://github.com/aboutcode-org/python-inspector and https://www.aboutcode.org/
8
-
9
5
10
6
``python-inspector `` is a collection of utilities to:
11
7
@@ -28,21 +24,21 @@ The goal of python-inspector is to be a comprehensive library
28
24
that can handle every style of Python package layouts, manifests and lockfiles.
29
25
30
26
31
- Testing
32
- --------
27
+ SPDX-License-Identifier: Apache-2.0
33
28
34
- - Run the tests with::
29
+ Copyright (c) AboutCode, nexB Inc. and others.
35
30
36
- pytest -vvs
37
-
38
- - There are live tests to regenerate the tests with updated data run::
31
+ Homepage: https://github.com/aboutcode-org/python-inspector and https://www.aboutcode.org/
39
32
40
- PYINSP_REGEN_TEST_FIXTURES=yes pytest -vvs
41
33
42
34
Usage
43
35
--------
44
36
45
- - Install with pip::
37
+ - Install the stable release with pip from PyPI::
38
+
39
+ pip install python-inspector
40
+
41
+ - Or install the latest with pip::
46
42
47
43
pip install git+https://github.com/aboutcode-org/python-inspector
48
44
51
47
python-inspector --help
52
48
53
49
50
+ Development
51
+ --------------
52
+
53
+ Run::
54
+
55
+ git clone https://github.com/aboutcode-org/python-inspector
56
+
57
+ Create a virtual environment and install deps locally::
58
+
59
+ make dev
60
+ source venv/bin/activate
61
+
62
+
63
+ When in the virtual environment, run python-inspector from that clone::
64
+
65
+ python-inspector --help
66
+
67
+
68
+ Run tests::
69
+
70
+ make test
71
+
72
+ Run code checks::
54
73
55
- Its companion libraries are:
74
+ make check
75
+
76
+ Run code formatting::
77
+
78
+ make valie
79
+
80
+ Check available make targets for further details
81
+
82
+
83
+
84
+ More testing
85
+ ------------------
86
+
87
+ - Run the tests with pytest::
88
+
89
+ pytest -vvs
90
+
91
+ - Or run them faster using 12 cores ::
92
+
93
+ pytest -vvs --numprocesses=12
94
+
95
+
96
+ Regenerate test files
97
+ -----------------------------
98
+
99
+ Some tests use live data from Pypi.org to run resolutions. When the package versions have
100
+ changed, the resolution can change and some of the tests fail. We have an environment variable
101
+ that regenerates the expected JSON result files when set.
102
+
103
+ To regenerate expected test result files for the failed tests, use this command::
104
+
105
+ PYINSP_REGEN_TEST_FIXTURES=yes pytest -vvs --lf
106
+
107
+ Then, carefully review the diff before committing the expected JSON test result files to validate
108
+ that the changes are OK and mostly affect small changes in resolved package versions.
109
+
110
+
111
+ Credits and dependencies
112
+ ---------------------------
113
+
114
+ For info, python-inspector embeds or depends on these libraries:
56
115
57
116
- ``pip-requirements-parser ``, a mostly correct pip requirements parsing
58
117
library extracted from pip.
@@ -72,6 +131,8 @@ Its companion libraries are:
72
131
73
132
- ``packageurl-python `` to use Package URL to reference Python packages
74
133
134
+ - ``scancode-toolkit `` for Python package manifest parsing.
135
+
75
136
76
137
77
138
Acknowledgements, Funding, Support and Sponsoring
0 commit comments