116 Commits

Author SHA1 Message Date
Abraham Long
3f7bb1eac2 Revert "Update pipreqs.py"
This reverts commit 5e37f07016000de91b0c5101ec7b3fb146e08347.
2021-09-16 07:16:06 -04:00
abrahamw88
5e37f07016
Update pipreqs.py 2021-09-13 10:56:45 -04:00
Rahul Kumaresan
9e514a4caa update README and pipreqs docstring to help prevent discripancies 2021-09-04 15:14:48 -03:00
alan-barzilay
65ccd7eca3 delete everything related to python2
We are dropping support for python 2, so we are dropping the
verification of which python version is currently running and we also stop
checking for python2 specific packages.
We also drop the encoding definition since python3 uses utf-8 as
default.
The helper open_func function is also substituted by open.
2021-09-04 15:14:48 -03:00
Alan Barzilay
8001001e9c Revert "Revert all commits since last release"
This reverts commit 90102acdbb23c09574d27df8bd1f568d34e0cfd3.
Now that we are ready to make a new release we can revert the revert and
hopefuly never have to solve a mess like this again to keep master
synchronized with the latest release
2021-09-04 15:12:27 -03:00
alan-barzilay
90102acdbb Revert all commits since last release
By reverting all commits done since release v0.4.10 we will have the
master branch synchronized with the latest release available in pipy.

All commits done since the latest release will be moved to another
branch called `next` where we will centralize development. Once we are ready
for a new release of pipreqs, the `next` branch will be merged back on to
master and a new release will be made.

This change will make development more organized and will avoid new
issues from users complaining about features only present in master not working
on their installation of pipreqs.

I would also like to thank @pedroteosousa for his help on reverting and
squashing all commits
2021-05-05 02:08:31 -03:00
Rahul M. Juliato
b188c8ba83
Decaptalized file name in log msg
When trying to generate requirements.txt and file is already existent, the user message produced asks for "Requirements.txt" instead of "requirements.txt". 
This may cause some trouble when used in case sensitive env, as well as in automated scripts.
2021-04-26 12:05:41 -03:00
Jake
5dc02aa2fa remove obsolete '==' 2021-03-29 22:16:45 +08:00
Jake
e5924d14b3 resolve conflicts; update new features 2021-03-29 22:13:19 +08:00
Jake
22fefca900 merged from origin 2021-03-29 21:48:44 +08:00
Siyang
69a884a4c4 changes based on discussions w maintainer 2021-03-29 21:35:34 +08:00
Alan Barzilay
1149429ab6
Merge pull request #195 from AlexPHorta/bugfix/issue88
Bugfix/issue88
2021-03-26 14:19:07 -03:00
Jake Teo
4eae4794a0
New Option for Dynamic Versioning (#1)
* added new option for dynamic versioning

* added quotes for dynamic options

Co-authored-by: Siyang <teo_siyang@imda.gov.sg>
2021-03-25 17:37:00 +08:00
Abhishek Kumar Singh
fc720f18bb Fixed#133
Sorted `imports` based on `lowercase` package's `name`, similar to `pip freeze`.
2020-06-14 00:20:26 +05:30
Jon Banafato
3f06f4375a Fix flake8 error for latest release 2020-05-18 19:21:05 -04:00
AlexPHorta
2022f25ae9 Working on issue #88 2020-02-27 00:59:02 -03:00
Vadim Kravcenko
6ca1f42d4e
Merge pull request #111 from yonatanp/master
bugfix: f.close() only required if open succeeded
2019-11-14 11:43:11 +01:00
Niti Santikul
71fc2dc90c support omit package output version 2019-10-21 00:53:03 +07:00
Nick Gustafson
712879a7be fix sorting bug in get_pkg_names for consistency with pip freeze 2018-02-08 10:11:16 -08:00
yonatanp
a7ad636dab
bugfix: f.close() only required if open succeeded
when open fails, instead of raising the original error, the "f.close()" was erroring in the final clause.
2018-01-05 11:33:47 +02:00
Jon Banafato
5707a39df6
Merge pull request #101 from jonafato/unified-output-function
Consolidate logic for writing to a file and to stdout
2017-11-16 13:47:03 -05:00
Jon Banafato
aae6c61f09 Clean up set and file usage in get_all_imports
- Move logic that doesn't need to be inside of file context managers
  outside
- Remove redundant `set` and `list` function calls
2017-10-26 16:36:12 -04:00
Jon Banafato
84b2e37707 Simplify get_pkg_names function
- Hoist non-file-reading logic outside of the file context manager
- Use a dict instead of a list for faster / more Pythonic lookups
- Use a set to simplify the add / append logic
- Move import sorting from `get_all_imports` to `get_pkg_names` for
  to account for set ordering. This change may also affect #89.
- Add a docstring
2017-10-26 12:16:32 -04:00
Jon Banafato
4b2ad2dc41 [WIP] Consolidate logic for writing to a file and to stdout 2017-10-24 16:58:35 -04:00
Jon Banafato
e88b5ab19c Fix flake8 errors 2017-10-24 15:14:58 -04:00
Jon Banafato
c80d06593d Support optional <path> argument
This change makes the <path> argument optional, defaulting to the
current working directory if omitted.

---

Ideally, this would have been accomplished via docopt, but optional
positional arguments with defaults are not supported at the moment [1, 2].

[1] https://github.com/docopt/docopt/issues/214
[2] https://github.com/docopt/docopt/issues/329
2017-10-22 23:45:16 -04:00
Robert Spencer
77c865253c Follow symbolic linked directories
This makes pipreqs dive into directories that are symlinks as Python
recognises these.  If symlinks are not followed, then the requirements
will be incorrect.

We also add a command line option to disable following of symlinks if
need be.
2017-08-31 23:17:31 +02:00
Vadim Kravcenko
22e80c27c2 Merge pull request #80 from kxrd/fix-issue-74
Exclude concurrent{,.futures} from stdlib if py2
2017-06-30 17:37:40 +02:00
kxrd
254e1cedcb Improve variable module_version 2017-06-13 23:10:14 +02:00
kxrd
e7b8ddf72d Replace with statement with a try/except/else/finally block to narrow down problem in the future 2017-06-13 22:22:27 +02:00
kxrd
54be2d1c24 Complete function clean 2017-06-13 22:03:21 +02:00
kxrd
d3efb942d5 Stop exctracting parameters in file, just return list of modules 2017-06-13 21:55:12 +02:00
kxrd
ac6ce860d0 Improve function diff docstring, begin function clean 2017-06-13 01:10:47 +02:00
kxrd
7549b1c416 Add and implement function diff, improve inline comments in function parse_requirements 2017-06-10 21:24:39 +02:00
kxrd
a78203dc2b Improve function parse_requirements docstring 2017-06-10 21:22:18 +02:00
kxrd
882a0d3ec3 Add docstring to function parse_requirements 2017-06-10 20:52:17 +02:00
kxrd
d8b497ea91 Rename function clean to compare_modules, have it return a tuple of modules not imported, add docstring 2017-06-10 20:43:54 +02:00
kxrd
1055a7a28b Add colon to error output for consistency 2017-06-10 20:02:43 +02:00
kxrd
888537a898 Improve except block in function parse_requirements 2017-06-10 20:01:42 +02:00
kxrd
b048c55fe6 Add clean function 2017-06-02 22:30:17 +02:00
kxrd
b6c53c6b02 Begin function clean 2017-06-02 21:16:17 +02:00
kxrd
d463b92810 Return tuple consisting of modules,parameters instead of a concatenated list 2017-06-02 21:13:47 +02:00
kxrd
cdb82c6d9b Switch out print statement against logging.error 2017-06-02 20:13:51 +02:00
kxrd
3d87f21392 Add file_ parameter to function parse_requirements, implement a try-except block in function parse_requirements 2017-06-02 19:59:59 +02:00
kxrd
0886898d8d Fix dict key:value in function parse_requirements() 2017-06-02 18:04:02 +02:00
kxrd
270f0e9933 Add function parse_requirements 2017-06-02 18:00:30 +02:00
kxrd
0b0f54a3de Exclude concurrent{,.futures} from stdlib if py2 2017-06-01 08:22:36 +02:00
L
243e6e6833 BUG: remove package/version duplicates 2017-04-17 11:33:06 -04:00
Vadim Kravcenko
1a990b52d5 refactor(pipreqs): pep8 2017-03-20 20:51:34 +01:00
Vadim Kravcenko
714393fcea missing parameter for proxy 2016-12-13 15:28:18 +01:00