Skip to content

BLD: Fix compiling pandas with a venv located in the src dir #53489

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

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

lithomas1
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

cc @jbrockmendel can you give this a shot?

@lithomas1 lithomas1 added the Build Library building on various platforms label Jun 1, 2023
@lithomas1
Copy link
Member Author

Chatted offline with Brock about this and it seems to fix the issues he's been having (at least with compiling pandas in a venv).

Planning on merging on this on green.

@lithomas1 lithomas1 merged commit aec4daf into pandas-dev:main Jun 1, 2023
@lithomas1 lithomas1 deleted the fix-venv-build branch June 1, 2023 19:57
Comment on lines +7 to +13
try:
# Check if include directory is inside the pandas dir
# e.g. a venv created inside the pandas dir
# If so, convert it to a relative path
incdir = os.path.relpath(np.get_include())
except Exception:
incdir = np.get_include()
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering if you're expecting relpath to raise if the path is not a subdirectory. It doesn't:

import os

print(os.getcwd())
# /home/richard/dev
print(os.path.relpath('/home/richard/dev'))
# '.'
print(os.path.relpath('/home/richard/dev/pandas'))
# pandas
print(os.path.relpath('/home/richard'))
# ..

topper-123 pushed a commit to topper-123/pandas that referenced this pull request Jun 5, 2023
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants