Open kunitoki opened 1 year ago
Sorry about that, the API and how it works in Python is not documented at all, I have to manually reverse engineer it, other projects just call PIP via CLI or API, then they changed the API killing the search functionalities, some install processes are very hacky and not prepared to be implemented in other than Python.
If you know the Fix, Pull Requests welcome.
For the uninstall i tried simply (and hackily):
for a in args: # RECORD Metadata file (CSV without file extension).
for item in walkFiles(sitePackages / a & "*.dist-info" / "RECORD"):
recordFiles.add item
for a in args: # RECORD Metadata file (CSV without file extension).
for item in walkFiles(sitePackages / capitalizeAscii(a) & "*.dist-info" / "RECORD"):
recordFiles.add item
for the proper install i still have to figure it out
Found other issues with removing, seems like tryRemoveFile
will not remove files installed via homebrew (osx). For example, it says everything was removed here:
$ ./plz uninstall jinja2
Uninstall 1 Packages: @["jinja2"]
Total disk space freed: 476.312 kB
rm --verbose --force /usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/__init__.py /usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/_identifier.py ...
Deleted? File
true /usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/__init__.py
true /usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jinja2/_identifier.py
...
but then if i look in the folder, nothing has been removed
I think that nim os method tryRemoveFile
has issues with @
in the path. Probably something to report upstream
Maybe the fix is simple, at some point I got burned out of hacking by try & error, and I do not have hardware to run OSX anyways, so not much I can do there. The implementation in general is not too far from working fine actually.
Pull Requests will be merged.
Yeah i will try my best to support with a PR but i will have to learn a bit in the process, still quite new in the nim world 😄
$ pip install bottle
$ plz uninstall bottle
Uninstall 1 Packages: @["bottle"]
Total disk space freed: 300.732 kB
rm --verbose --force /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/INSTALLER /usr/bin/__pycache__/bottle.cpython-310.pyc /usr/bin/bottle.py /usr/lib/python3.10/site-packages/__pycache__/bottle.cpython-310.pyc /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/AUTHORS /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/INSTALLER /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/LICENSE /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/METADATA /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/RECORD /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/REQUESTED /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/WHEEL /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/top_level.txt /usr/lib/python3.10/site-packages/bottle.py
Deleted? File
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/INSTALLER
true /usr/bin/__pycache__/bottle.cpython-310.pyc
true /usr/bin/bottle.py
true /usr/lib/python3.10/site-packages/__pycache__/bottle.cpython-310.pyc
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/AUTHORS
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/INSTALLER
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/LICENSE
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/METADATA
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/RECORD
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/REQUESTED
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/WHEEL
true /usr/lib/python3.10/site-packages/bottle-0.12.23.dist-info/top_level.txt
true /usr/lib/python3.10/site-packages/bottle.py
$
Uninstalling Bottle works for me Linux x86_64. So I will edit the title to reflect reality.
For me, INSTALLER file was not in the RECORD file and was not removed, leaving cruft. Can you try installing with pip and removing with plz and vice versa?
$ plz download bottle
Download to where? (Full path to existing folder): .
https://files.pythonhosted.org/packages/63/96/2713bb6e0ca10ee2b7be568d6e6d112cf0a1b604e14879fe744f48ebbed6/bottle-0.12.23-py3-none-any.whl ./bottle-0.12.23-py3-none-any.whl
90129 Bytes total (compressed)
SHA256 (./bottle-0.12.23-py3-none-any.whl) = 9f1c363257c590bd34db5fad4693a7f06ff4217e9ad18337451de69c25137127
https://files.pythonhosted.org/packages/63/96/2713bb6e0ca10ee2b7be568d6e6d112cf0a1b604e14879fe744f48ebbed6/bottle-0.12.23-py3-none-any.whl.asc
HTTP-404? https://files.pythonhosted.org/packages/63/96/2713bb6e0ca10ee2b7be568d6e6d112cf0a1b604e14879fe744f48ebbed6/bottle-0.12.23-py3-none-any.whl.asc (Package without PGP Signature)
./bottle-0.12.23-py3-none-any.whl
$ file ./bottle-0.12.23-py3-none-any.whl
./bottle-0.12.23-py3-none-any.whl: Zip archive data, at least v2.0 to extract, compression method=deflate
$ plz hash ./bottle-0.12.23-py3-none-any.whl
SHA256 (./bottle-0.12.23-py3-none-any.whl) = 9f1c363257c590bd34db5fad4693a7f06ff4217e9ad18337451de69c25137127
--hash=sha256:9f1c363257c590bd34db5fad4693a7f06ff4217e9ad18337451de69c25137127
$ plz latestversion bottle
0.12.23
$ plz --cleanpipcache
Deleted? File
true /tmp/pip-build-root
true /tmp/pip_build_root
true /tmp/pip-build-juan
true /tmp/pip_build_juan
true ~/.cache/pip
$ plz --cleanvenvs
Virtualenvs not found, nothing to clean.
$
INSTALLER file was not in the RECORD file and was not removed, leaving cruft.
Which python package ?, can not reproduce.
Can you paste the full output on the terminal ?.
Do you have antivirus or desktop search?, because those tend to lock files at random.
$ pip install flask
Collecting flask
Downloading Flask-2.2.2-py3-none-any.whl (101 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.5/101.5 kB 5.4 MB/s eta 0:00:00
Installing collected packages: flask
Successfully installed flask-2.2.2
$ plz uninstall flask
Uninstall 1 Packages: @["flask"]
Total disk space freed: 339.248 kB
rm --verbose --force /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/INSTALLER /usr/bin/flask /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/INSTALLER /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/LICENSE.rst /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/METADATA /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/RECORD /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/REQUESTED /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/WHEEL /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/entry_points.txt /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/top_level.txt /usr/lib/python3.10/site-packages/flask/__init__.py /usr/lib/python3.10/site-packages/flask/__main__.py /usr/lib/python3.10/site-packages/flask/__pycache__/__init__.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/__main__.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/app.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/blueprints.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/cli.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/config.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/ctx.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/debughelpers.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/globals.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/helpers.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/logging.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/scaffold.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/sessions.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/signals.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/templating.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/testing.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/typing.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/views.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/__pycache__/wrappers.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/app.py /usr/lib/python3.10/site-packages/flask/blueprints.py /usr/lib/python3.10/site-packages/flask/cli.py /usr/lib/python3.10/site-packages/flask/config.py /usr/lib/python3.10/site-packages/flask/ctx.py /usr/lib/python3.10/site-packages/flask/debughelpers.py /usr/lib/python3.10/site-packages/flask/globals.py /usr/lib/python3.10/site-packages/flask/helpers.py /usr/lib/python3.10/site-packages/flask/json/__init__.py /usr/lib/python3.10/site-packages/flask/json/__pycache__/__init__.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/json/__pycache__/provider.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/json/__pycache__/tag.cpython-310.pyc /usr/lib/python3.10/site-packages/flask/json/provider.py /usr/lib/python3.10/site-packages/flask/json/tag.py /usr/lib/python3.10/site-packages/flask/logging.py /usr/lib/python3.10/site-packages/flask/py.typed /usr/lib/python3.10/site-packages/flask/scaffold.py /usr/lib/python3.10/site-packages/flask/sessions.py /usr/lib/python3.10/site-packages/flask/signals.py /usr/lib/python3.10/site-packages/flask/templating.py /usr/lib/python3.10/site-packages/flask/testing.py /usr/lib/python3.10/site-packages/flask/typing.py /usr/lib/python3.10/site-packages/flask/views.py /usr/lib/python3.10/site-packages/flask/wrappers.py
Deleted? File
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/INSTALLER
true /usr/bin/flask
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/INSTALLER
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/LICENSE.rst
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/METADATA
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/RECORD
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/REQUESTED
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/WHEEL
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/entry_points.txt
true /usr/lib/python3.10/site-packages/Flask-2.2.2.dist-info/top_level.txt
true /usr/lib/python3.10/site-packages/flask/__init__.py
true /usr/lib/python3.10/site-packages/flask/__main__.py
true /usr/lib/python3.10/site-packages/flask/__pycache__/__init__.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/__main__.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/app.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/blueprints.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/cli.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/config.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/ctx.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/debughelpers.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/globals.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/helpers.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/logging.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/scaffold.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/sessions.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/signals.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/templating.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/testing.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/typing.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/views.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/__pycache__/wrappers.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/app.py
true /usr/lib/python3.10/site-packages/flask/blueprints.py
true /usr/lib/python3.10/site-packages/flask/cli.py
true /usr/lib/python3.10/site-packages/flask/config.py
true /usr/lib/python3.10/site-packages/flask/ctx.py
true /usr/lib/python3.10/site-packages/flask/debughelpers.py
true /usr/lib/python3.10/site-packages/flask/globals.py
true /usr/lib/python3.10/site-packages/flask/helpers.py
true /usr/lib/python3.10/site-packages/flask/json/__init__.py
true /usr/lib/python3.10/site-packages/flask/json/__pycache__/__init__.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/json/__pycache__/provider.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/json/__pycache__/tag.cpython-310.pyc
true /usr/lib/python3.10/site-packages/flask/json/provider.py
true /usr/lib/python3.10/site-packages/flask/json/tag.py
true /usr/lib/python3.10/site-packages/flask/logging.py
true /usr/lib/python3.10/site-packages/flask/py.typed
true /usr/lib/python3.10/site-packages/flask/scaffold.py
true /usr/lib/python3.10/site-packages/flask/sessions.py
true /usr/lib/python3.10/site-packages/flask/signals.py
true /usr/lib/python3.10/site-packages/flask/templating.py
true /usr/lib/python3.10/site-packages/flask/testing.py
true /usr/lib/python3.10/site-packages/flask/typing.py
true /usr/lib/python3.10/site-packages/flask/views.py
true /usr/lib/python3.10/site-packages/flask/wrappers.py
$ ls /usr/lib/python3.10/site-packages/F*
ls: cannot access '/usr/lib/python3.10/site-packages/F*': No such file or directory
$ ls /usr/lib/python3.10/site-packages/f*
ls: cannot access '/usr/lib/python3.10/site-packages/f*': No such file or directory
$
Which python package ?, can not reproduce.
try jinja2
, it doesn't seem to report INSTALLER
in RECORD
Love the idea ! Great work !
I've tried running install and i just get eggs in site-packages, not the unpacked python modules and .dist-info folder.
This also makes it impossible to uninstall (no .dist-info in site-packages if installed via plz, but it is if installed via pip). It also assumes that package names are case insensitive (for example if i do
plz uninstall flask
it doesn't find it because it was installed inFlask.*.dist-info
):