Skip to content

Iterates through each path from self._clean_trees to improve error ha… #58263

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

Closed
wants to merge 4 commits into from

Conversation

aabhinavg
Copy link

@aabhinavg aabhinavg commented Apr 15, 2024

setup.py Outdated
# Remove the directory tree at the specified path
shutil.rmtree(path)
except OSError:
pass
Copy link
Member

@Aloqeely Aloqeely Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of iterating through clean_tree, I would recommend reverting the changes done in #54236 (setup.py) which caused self._clean_trees to be a list of generators.

EDIT: Using generator comprehension is intended, so you should probably fix the current logic of self._clean_trees such that it is a list of paths (strings) and not generators.
self._clean_trees.extend(...) instead of self_clean_trees.append(...) should be sufficient.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extend self._clean_trees by converting generator to list using list comprehension
This finds all "pycache" directories in the current root and appends their full paths to self._clean_trees

self._clean_trees.extend([os.path.join(root, dir) for dir in dirs if dir == "__pycache__"])
#and 
self._clean_trees.extend([os.path.join(os.getcwd(), dir) for dir in ("build", "dist") if os.path.exists(dir)])

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, but pandas is moving towards removing setup.py in favor of building the library with meson #57941

If you are having trouble building pandas with setup.py locally I would recommend making this change locally

@mroeschke
Copy link
Member

Thanks for this PR but going to close

@mroeschke mroeschke closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants