Open imba-tjd opened 3 years ago
I don't think this does anything we want. pip-autoremove is designed to be a user-run script, not an imported module, as per the documentation:
py_modules
A list of strings specifying the modules that setuptools will manipulate.
scripts
A list of strings specifying the standalone script files to be built and installed.
What are you trying to achieve with this? We may need to add the py_modules
line, but I don't believe removing the scripts line is what we want. That seems weird as this isn't really written as a module (it's a single script file.) If we moved to py_modules
I think we would also need an entry point ala
[options.entry_points]
console_scripts =
pip-autoremove = pip_autoremove:main
[edit.] Actually we already definite the console_scripts
entry point. @imba-tjd do you have some documentation that shows this will resolve the issue and why? Doesn't make a lot of sense to me but if it works and doesn't break anything...
The original setup.py uses py_modules, see https://github.com/invl/pip-autoremove/pull/42/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7L11
I'm confident this will solve the issue on windows.
Or you can have a try by python3 -m pip_autoremove
on whichever OS. Before your patch, it runs. But now, it doesn't.
Actually we already definite the console_scripts entry point
It will do just like python3 -m pip_autoremove, thus won't run. I tried on Linux. It does run. I don't know the reason. But it won't work on Windows anyway, just as the issue reported.
The launcher in Linux is a python script. In Windows it is an exe file.
With python script the first entry in sys.path
is the script directory.
But with an exe launcher, the first entry in sys.path
is the exe itself (this looks like a bug, or not if the exe has an embedded zip file). That's why it cannot find the pip_autoremove
module.
Anyway since pip_autoremove
is imported as a module (pip-autoremove = pip_autoremove:main
) it is better to put it in lib/python
/site-packages
rather than installing it in bin
/scripts
.
I'm on Windows
I moved the pip_autoremove.py file from the \Scripts path into ### \Lib\site-packages then I typed the command python -m pip_autoremove 'package name' and it worked correctly.
I'm on Windows
I moved the pip_autoremove.py file from the \Scripts path into ### \Lib\site-packages then I typed the command python -m pip_autoremove 'package name' and it worked correctly.
worked for me too, on Windows, Python 3.10. also works for > pip-autoremove some_package
fix https://github.com/invl/pip-autoremove/issues/43 cc @tresni