pybuilder: OSX + homebrew python@3.9: pybuilder/_vendor/virtualenv.py change_prefix does not consider symlinks, raises invalid AssertionError
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.
$ head -1 $(which pip3)
#!/usr/local/opt/python@3.9/bin/python3.9
I used pip3 install --user pybuilder to install pybuilder:
$ which pyb
/Users/username/Library/Python/3.9/bin/pyb
$ head -1 $(which pyb)
#!/usr/local/opt/python@3.9/bin/python3.9
$ pyb
PyBuilder version 0.12.10
Build started at 2021-04-28 10:36:15
------------------------------------------------------------
------------------------------------------------------------
BUILD FAILED - AssertionError: Filename /usr/local/Cellar/python@3.9/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py does not start with any of these prefixes: ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/Extras/lib/python', '/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9', '/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9', '/Users/username/Library/Python/3.9/lib/python/site-packages', '/Users/username/.local/lib/python/3.9/site-packages', '/Users/username/Library/Python/3.9/site-packages', '/Library/Python/3.9/site-packages'] (pybuilder/_vendor/virtualenv.py:1272)
------------------------------------------------------------
Build finished at 2021-04-28 10:36:15
Build took 0 seconds (64 ms)
AssertionError is raised from change_prefix:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 39 (37 by maintainers)
Commits related to this issue
- Prepare 0.13.0 Vendorize latest virtualenv with cleanup fixes fixes #795, #777, #774, #771 — committed to arcivanov/pybuilder by arcivanov 3 years ago
- Prepare 0.13.0 Vendorize latest virtualenv with cleanup fixes Bump version to 0.13.0 fixes #795, #777, #774, #771 — committed to arcivanov/pybuilder by arcivanov 3 years ago
- Prepare 0.13.0 Vendorize latest virtualenv with cleanup fixes Bump version to 0.13.0 fixes #795, #777, #774, #771 — committed to arcivanov/pybuilder by arcivanov 3 years ago
- Prepare 0.13.0 Vendorize latest virtualenv with cleanup fixes Bump version to 0.13.0 fixes #795, #777, #774, #771 — committed to arcivanov/pybuilder by arcivanov 3 years ago
Working on other projects, but a quick test with
--prePyBuilder version 0.13.0.dev20210917052200&Python 3.9.7seems to indicate that this issue is fixed! Awesome, good job!I think this can be closed after a release.
Rejoice! I was able to reproduce this issue on Linux 😃 At least the
StopIterationpart that is.Same exception with pybuilder installed with
pip3 install pybuilderas well.I run pybuilder mostly with a custom build script in a virtualenv like this:
But I get the same
AssertionErroroutside virtualenv with pybuilder installed withpip3 install --user pybuilder==0.12.10.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?
Not M1.
macOS Big Sur 11.5.2 on MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports).