Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove generated files on "pip uninstall" #37

Closed
HackerFoo opened this issue Dec 11, 2020 · 4 comments
Closed

Remove generated files on "pip uninstall" #37

HackerFoo opened this issue Dec 11, 2020 · 4 comments

Comments

@HackerFoo
Copy link
Contributor

Context: #28 (comment)

litghost commented 1 hour ago •

Try this, with ANTLR4 runtime installed:

python3 -mvenv test_env
source test_env/bin/activate
pip install -v git+https://github.com/HackerFoo/fasm.git@antltr_cpp
pip uninstall fasm

I get the following message when running pip uninstall fasm:

pip uninstall fasm
Found existing installation: fasm 0.0.2
Uninstalling fasm-0.0.2:
Would remove:
test_pip/bin/fasm
test_pip/lib/python3.7/site-packages/fasm-0.0.2-py3.7.egg-info
test_pip/lib/python3.7/site-packages/fasm/*
Would not remove (might be manually added):
test_pip/lib/python3.7/site-packages/fasm/parser/libparse_fasm.so
test_pip/lib/python3.7/site-packages/fasm/parser/tags.py
Proceed (y/n)?

Note the lines under Would not remove (might be manually added):. Even if I say y, it doesn't remove the .so and tags.py.

@litghost
Copy link
Collaborator

litghost commented Dec 11, 2020

@litghost
Copy link
Collaborator

Fixed in #28

@HackerFoo
Copy link
Contributor Author

Specifically, the solution was to add a pyproject.toml in the root with the following content:

[build-system]
requires = ["setuptools", "wheel"]

The link above only mentions this can be used for a setup.py-less package, but I'm not sure why it fixes this problem, as the fasm package does have a setup.py.

I found this, so it seems like the right thing to do. I just don't understand why it fixes the problem.

@litghost
Copy link
Collaborator

Without pyproject.toml, the wheel dependency is not installed. When I installed the package in a fresh py3.7, it warned that it was not building a wheel package because wheel was not installed. That lead to the link in #37 (comment), which specifies how to install packages prior to invoking setup.py, which is basically what pyproject.toml is for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants