Skip to content

ensures python site package directory exists#5145

Merged
xusheng6 merged 1 commit into
Vector35:devfrom
deadc0de6:site-package-exists
May 24, 2024
Merged

ensures python site package directory exists#5145
xusheng6 merged 1 commit into
Vector35:devfrom
deadc0de6:site-package-exists

Conversation

@deadc0de6
Copy link
Copy Markdown
Contributor

This PR ensures the first entry in the python site packages is created.
This avoids issues when, for some reason, the first directory of site.getsitepackages() does not exist.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 1, 2024

CLA assistant check
All committers have signed the CLA.

@plafosse plafosse requested a review from psifertex March 12, 2024 14:36
@plafosse plafosse added this to the Elysium milestone Mar 20, 2024
@xusheng6 xusheng6 requested review from xusheng6 and removed request for psifertex May 20, 2024 14:38
@xusheng6 xusheng6 merged commit 5ec6a03 into Vector35:dev May 24, 2024
@xusheng6
Copy link
Copy Markdown
Member

I have approved this PR. Looks good to me, though Jordan brought up some concerns that the sitepackages may not be writable anyways. However, it seem to me that in the case of a pipenv, etc, the site.getsitepackages will return a unique path for each environment, which is also often times writable. If we use getusersitepackages, then it will actually always return the same path, which does not consider the presence a pipenv. Here is some output that could help explain this:

(Running inside pipenv)

>>> site.getsitepackages()
['/Users/xusheng/.local/share/virtualenvs/xusheng-2ZPXY7r0/lib/python3.11/site-packages']
>>> site.getusersitepackages()
'/Users/xusheng/Library/Python/3.11/lib/python/site-packages'

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

Successfully merging this pull request may close these issues.

5 participants