Specify Python minor version in homebrew formula#3344
Merged
Conversation
Users were intermittently reporting that upgrades failed with some
variation of the following error:
```python-traceback
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 14, in <module>
from setuptools_rust import RustExtension
File "/private/tmp/pip-build-env-gh8ot2a3/overlay/lib/python3.8/site-packages/setuptools_rust/__init__.py", line 1, in <module>
from .build import build_rust
File "/private/tmp/pip-build-env-gh8ot2a3/overlay/lib/python3.8/site-packages/setuptools_rust/build.py", line 23, in <module>
from setuptools.command.build import build as CommandBuild # type: ignore[import]
ModuleNotFoundError: No module named 'setuptools.command.build'
```
This changeset includes three substantive changes to how the formula is
generated:
1. Rust has been added as a build-time dependency. This is the root
cause of the installation failure.
2. The major.minor version (`python3.9`of the python executable is used instead of
`python3`). This prevents the installation from inadvertently using the
system Python. This occurs because Homebrew only symlinks a `python3`
executable for the latest version. See Homebrew/homebrew-core/107517.
3. Adds `--allow-unsafe` to the `pip-compile` step. This is a noop
because we aren't pinning setuptools.
prescod
suggested changes
Aug 23, 2022
Contributor
prescod
left a comment
There was a problem hiding this comment.
Let's try it without Rust. I think based on our conversation that we don't need it.
Co-authored-by: Paul Prescod <pprescod@salesforce.com>
prescod
approved these changes
Aug 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users were intermittently reporting that upgrades failed with some
variation of the following error:
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 14, in <module> from setuptools_rust import RustExtension File "/private/tmp/pip-build-env-gh8ot2a3/overlay/lib/python3.8/site-packages/setuptools_rust/__init__.py", line 1, in <module> from .build import build_rust File "/private/tmp/pip-build-env-gh8ot2a3/overlay/lib/python3.8/site-packages/setuptools_rust/build.py", line 23, in <module> from setuptools.command.build import build as CommandBuild # type: ignore[import] ModuleNotFoundError: No module named 'setuptools.command.build'This changeset includes two substantive changes to how the formula is
generated:
python3.9of the python executable is used instead ofpython3). This prevents the installation from inadvertently using the system Python. This occurs because Homebrew only symlinks apython3executable for the latest version. See Enable linking multiple Python formulae Homebrew/homebrew-core#107517.--allow-unsafeto thepip-compilestep. This is a noop because we aren't pinning setuptools.