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.
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
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
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.
- 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
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
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.