1PIPREQS(1) pipreqs PIPREQS(1)
2
3
4
6 pipreqs - pipreqs Documentation
7
8 Contents:
9
11 .SS Installation
12
13 pip install pipreqs
14
15 Usage
16 Usage:
17 pipreqs [options] <path>
18
19 Options:
20 --use-local Use ONLY local package info instead of querying PyPI
21 --pypi-server <url> Use custom PyPi server
22 --proxy <url> Use Proxy, parameter will be passed to requests library. You can also just set the
23 environments parameter in your terminal:
24 $ export HTTP_PROXY="http://10.10.1.10:3128"
25 $ export HTTPS_PROXY="https://10.10.1.10:1080"
26 --debug Print debug information
27 --ignore <dirs>... Ignore extra directories
28 --encoding <charset> Use encoding parameter for file open
29 --savepath <file> Save the list of requirements in the given file
30 --print Output the list of requirements in the standard output
31 --force Overwrite existing requirements.txt
32 --diff <file> Compare modules in requirements.txt to project imports.
33 --clean <file> Clean up requirements.txt by removing modules that are not imported in project.
34 --no-pin Omit version of output packages.
35
36 Example
37 $ pipreqs /home/project/location
38 Successfully saved requirements file in /home/project/location/requirements.txt
39
40 Contents of requirements.txt
41
42 wheel==0.23.0
43 Yarg==0.1.9
44 docopt==0.6.2
45
46 Why not pip freeze?
47 • pip freeze only saves the packages that are installed with pip in‐
48 stall in your environment.
49
50 • pip freeze saves all packages in the environment including those that
51 you don't use in your current project. (if you don't have virtualenv)
52
53 • and sometimes you just need to create requirements.txt for a new
54 project without installing modules.
55
57 At the command line:
58
59 $ easy_install pipreqs
60
61 Or, if you have virtualenvwrapper installed:
62
63 $ mkvirtualenv pipreqs
64 $ pip install pipreqs
65
67 To use pipreqs in a project:
68
69 import pipreqs
70
72 Contributions are welcome, and they are greatly appreciated! Every lit‐
73 tle bit helps, and credit will always be given.
74
75 You can contribute in many ways:
76
77 Types of Contributions
78 Report Bugs
79 Report bugs at https://github.com/bndr/pipreqs/issues.
80
81 If you are reporting a bug, please include:
82
83 • Your operating system name and version.
84
85 • Any details about your local setup that might be helpful in trou‐
86 bleshooting.
87
88 • Detailed steps to reproduce the bug.
89
90 Fix Bugs
91 Look through the GitHub issues for bugs. Anything tagged with "bug" is
92 open to whoever wants to implement it.
93
94 Implement Features
95 Look through the GitHub issues for features. Anything tagged with "fea‐
96 ture" is open to whoever wants to implement it.
97
98 Write Documentation
99 pipreqs could always use more documentation, whether as part of the of‐
100 ficial pipreqs docs, in docstrings, or even on the web in blog posts,
101 articles, and such.
102
103 Submit Feedback
104 The best way to send feedback is to file an issue at
105 https://github.com/bndr/pipreqs/issues.
106
107 If you are proposing a feature:
108
109 • Explain in detail how it would work.
110
111 • Keep the scope as narrow as possible, to make it easier to implement.
112
113 • Remember that this is a volunteer-driven project, and that contribu‐
114 tions are welcome :)
115
116 Get Started!
117 Ready to contribute? Here's how to set up pipreqs for local develop‐
118 ment.
119
120 1. Fork the pipreqs repo on GitHub.
121
122 2. Clone your fork locally:
123
124 $ git clone git@github.com:your_name_here/pipreqs.git
125
126 3. Install your local copy into a virtualenv. Assuming you have vir‐
127 tualenvwrapper installed, this is how you set up your fork for local
128 development:
129
130 $ mkvirtualenv pipreqs
131 $ cd pipreqs/
132 $ python setup.py develop
133
134 4. Create a branch for local development:
135
136 $ git checkout -b name-of-your-bugfix-or-feature
137
138 Now you can make your changes locally.
139
140 5. When you're done making changes, check that your changes pass flake8
141 and the tests, including testing other Python versions with tox:
142
143 $ flake8 pipreqs tests
144 $ python setup.py test
145 $ tox
146
147 To get flake8 and tox, just pip install them into your virtualenv.
148
149 6. Commit your changes and push your branch to GitHub:
150
151 $ git add .
152 $ git commit -m "Your detailed description of your changes."
153 $ git push origin name-of-your-bugfix-or-feature
154
155 7. Submit a pull request through the GitHub website.
156
157 Pull Request Guidelines
158 Before you submit a pull request, check that it meets these guidelines:
159
160 1. The pull request should include tests.
161
162 2. If the pull request adds functionality, the docs should be updated.
163 Put your new functionality into a function with a docstring, and add
164 the feature to the list in README.rst.
165
166 3. The pull request should work for Python 2.7, 3.4, 3.5, 3.6, and
167 PyPy. Check https://travis-ci.org/bndr/pipreqs/pull_requests and
168 make sure that the tests pass for all supported Python versions.
169
170 Tips
171 To run a subset of tests:
172
173 $ python -m unittest tests.test_pipreqs
174
176 Development Lead
177 • Vadim Kravcenko <vadim.kravcenko@gmail.com>
178
179 Contributors
180 None yet. Why not be the first?
181
184 • Implement '--clean' and '--diff' (kxrd)
185
186 • Exclude concurrent{,.futures} from stdlib if py2 (kxrd)
187
189 • BUG: remove package/version duplicates
190
191 • Style: pep8
192
194 • Fixed the --pypi-server option
195
197 • Remove Spaces in output
198
199 • Add package to output even without version
200
202 • Fix duplicated lines in requirements.txt (Dmitry Pribysh)
203
205 • Added ignore option (Nick Rhinehart)
206
208 • Walk Abstract Syntax Tree to find imports (Kay Sackey)
209
211 • Fix regex for docstring comments (#35)
212
214 • Add more package mapping
215
216 • fix(pipreqs/mapping): remove pylab reference to matplotlib
217
218 • Remove comments """ before going through imports
219
220 • Update proxy documentation
221
223 • fixed lint warnings (EJ Lee)
224
225 • add --encoding parameter for open() (EJ Lee)
226
227 • support windows directory separator (EJ Lee)
228
230 • Add --proxy option
231
232 • Add --pypi-server option
233
235 • Ignore irreverent directory when generating requirement.txt (Lee Wei)
236
237 • Modify logging level of "Requirement.txt already exists" to warning
238 (Lee Wei)
239
241 • Add --force option as a protection for overwrites
242
244 • Fix exception when 'import' is used inside package name #17
245
246 • Add more tests
247
249 • Fix exception when 'import' is used in comments #17
250
251 • Fix duplicate entries in requirements.txt
252
254 • Refactoring
255
256 • fix "import as"
257
259 • Fix multiple alias imports on the same line (Tiago Costa)
260
261 • More package mappings
262
264 • Add ImportName -> PackageName mapping
265
266 • More tests
267
269 • Fix for TypeError for implicit conversion
270
272 • Add --use-local option
273
274 • Exclude relative imports. (Dongwon Shin)
275
276 • Use "latest_release_id" instead of "release_ids[-1]" (Dongwon Shin)
277
279 • Output tuning (Harri Berglund)
280
281 • Use str.partition() to simplify the logic (cclaus)
282
284 • Fixed problems with local imports (Dongwon Shin)
285
286 • Fixed problems with imports with 'as' (Dongwon Shin)
287
288 • Fix indentation, pep8 Styling. (Michael Borisov)
289
290 • Optimize imports and adding missing import for sys module. (Michael
291 Borisov)
292
294 • Add more assertions in tests
295
296 • Add more verbose output
297
298 • Add recursive delete to Makefile clean
299
300 • Update Readme
301
303 • py3 print function
304
306 • Add Readme, Add Examples
307
308 • Add Stdlib into package
309
311 • Fix regex matching for imports
312
313 • Release on Pypi
314
316 • First release on Github.
317
318 • genindex
319
320 • modindex
321
322 • search
323
325 Vadim Kravcenko
326
328 2021, Vadim Kravcenko
329
330
331
332
3330.4.8 Jul 23, 2021 PIPREQS(1)