-
Notifications
You must be signed in to change notification settings - Fork 247
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
OSX + homebrew python@3.9: pybuilder/_vendor/virtualenv.py change_prefix does not consider symlinks, raises invalid AssertionError #771
Comments
Are there any workarounds? We're completely blocked. |
Hello, unfortunately I'm completely swamped right now with work. We don't test with Brew Python, but we do test with PyEnv Python on Mac and it works: https://travis-ci.com/github/pybuilder/pybuilder/jobs/502734233 I would highly recommend using PyEnv with Brew regardless as Brew Python contains the following warning:
|
I see why this is happening and it's brew-specific, unfortunately. |
@hoxu could you please run the build with |
@dindurthy you could use OSX-shipped
|
|
Changing PATH won't work without breaking too many other things, unfortunately. I think the only workaround is to not use brew python. |
So @arcivanov: wouldn't this be fixed by simply changing: def change_prefix(filename, dst_prefix):
- prefixes = [sys.prefix]
+ prefixes = [os.path.realpath(sys.prefix)] >>> sys.prefix
'/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9'
>>> os.path.realpath(sys.prefix)
'/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9' If so, would you accept PR with the above change? |
If you could could you please retest with latest |
First reproduction with 0.12.10:
Then test with
A different error, I call it progress :)
Is this a regression? |
Yes and no. 😄 This is apparently a bug in virtualenv, which is bundled in PyB. Let me see if VEnv can fix it on their end. |
@hoxu
|
So nope, doesn't fail. Let me know if you need the full output regardless. |
Could you please post the shebang of the virtualenv file (first line)? |
|
I can't seem to reproduce this issue with BigSur and Homebrew on GitHub Actions. Could you please see these logs and tell me whether anything jumps at you as different from your system configuration? |
I noticed one difference:
I seem to be using
Both symlinks seem to exist for me, though. I don't think this is relevant. Does the GitHub Actions workflow work with pybuilder |
I might have supplied you with the wrong logs. One sec. |
Yeah sorry, wrong logs. Correct link: https://github.com/pybuilder/pybuilder/commit/618512b0f356e3314b1218ae7c0192b9fea49c6b/checks/3581148294/logs
|
That's the thing - StopIteration issue doesn't reproduce either on GHA macos 11 + Homebrew. I wonder if it's some standard environment on a laptop that doesn't appear on macos boxes... |
Now this is interesting... Did you add that to PATH? Because I think I saw Homebrew not updating that on GHA, that's why python location check is there. I'll test tomorrow if it makes a difference and will look at whether Brew updates that symlink. |
Can you check what this outputs on GHA?
|
I have |
That is weird... Are you on M1 by any chance? Or Intel? |
Not M1. macOS Big Sur 11.5.2 on MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports). |
This is the homebrewed one: https://github.com/pybuilder/pybuilder/runs/3583700812?check_suite_focus=true |
|
Is your PyBuilder installed in |
I run pybuilder mostly with a custom build script in a virtualenv like this:
But I get the same Apologies for not having enough time to dig properly into this. Maybe @dindurthy could take a look at the GitHub Actions workflow logs and see if there are any differences to local execution? |
Same exception with pybuilder installed with |
Here is a diff from mine to GHA:
|
Rejoice! I was able to reproduce this issue on Linux :) At least the |
@arcivanov let me know when |
@hoxu go ahead please with |
@hoxu did you have a chance to try it out? |
Working on other projects, but a quick test with I think this can be closed after a release. |
Glad to hear! The release is a bit away, as an issue in virtualenv has been discovered as well. |
Vendorize latest virtualenv with cleanup fixes fixes pybuilder#795, pybuilder#777, pybuilder#774, pybuilder#771
Vendorize latest virtualenv with cleanup fixes Bump version to 0.13.0 fixes pybuilder#795, pybuilder#777, pybuilder#774, pybuilder#771
Vendorize latest virtualenv with cleanup fixes Bump version to 0.13.0 fixes pybuilder#795, pybuilder#777, pybuilder#774, pybuilder#771
Vendorize latest virtualenv with cleanup fixes Bump version to 0.13.0 fixes pybuilder#795, pybuilder#777, pybuilder#774, pybuilder#771
I have installed Python 3 on macOS 11.3 (Big Sur) with
brew install python@3.9
. Homebrew installs Python 3.9 under/usr/local/Cellar/python@3.9
, and symlinks/usr/local/opt/python@3.9 -> ../Cellar/python@3.9/3.9.4
.python3
is a symlink/usr/local/bin/python3 -> ../Cellar/python@3.9/3.9.4/bin/python3
.pip3
is a symlink/usr/local/bin/pip3 -> ../Cellar/python@3.9/3.9.4/bin/pip3
.I used
pip3 install --user pybuilder
to install pybuilder:AssertionError is raised from
change_prefix
:pybuilder/src/main/python/pybuilder/_vendor/virtualenv.py
Line 1272 in 6ac1ef4
The text was updated successfully, but these errors were encountered: