Skip to content

BF: append user packages correctly to PYTHONPATH#6770

Merged
mdcutone merged 1 commit intopsychopy:devfrom
mh105:dev-pypath-order
Aug 14, 2024
Merged

BF: append user packages correctly to PYTHONPATH#6770
mdcutone merged 1 commit intopsychopy:devfrom
mh105:dev-pypath-order

Conversation

@mh105
Copy link
Copy Markdown
Contributor

@mh105 mh105 commented Aug 4, 2024

When adding paths to the PYTHONPATH environment variable, the order of if statements matters. This is because prefs.paths['userPackages'] is a subdirectory of prefs.paths['packages'], so adding the former will result in an incorrect check of using the not in operator.

_userPackages = str(prefs.paths['packages'])
if _userPackages not in env['PYTHONPATH']:

We need to add the parent path first to avoid this issue.

@TEParsons TEParsons requested a review from mdcutone August 5, 2024 08:42
@mdcutone mdcutone merged commit 03d4126 into psychopy:dev Aug 14, 2024
@mdcutone
Copy link
Copy Markdown
Member

I'm going to cherry pick this into release.

@mh105 mh105 deleted the dev-pypath-order branch August 14, 2024 17:02
TEParsons pushed a commit to TEParsons/psychopy that referenced this pull request Aug 28, 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

Development

Successfully merging this pull request may close these issues.

2 participants