Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

brew CI: upgrade when installing pip packages #1193

Closed
wants to merge 1 commit into from

Conversation

scpeters
Copy link
Contributor

@scpeters scpeters commented Nov 2, 2024

Needed to fix protobuf version errors. For example:

102: ==================================== ERRORS ====================================
102: __________ ERROR collecting gz-transport/python/test/options_TEST.py ___________
102: ../../gz-transport/python/test/options_TEST.py:1: in <module>
102:     from gz.msgs11.stringmsg_pb2 import StringMsg
102: /usr/local/lib/python/gz/msgs11/stringmsg_pb2.py:12: in <module>
102:     _runtime_version.ValidateProtobufRuntimeVersion(
102: /Users/jenkins/Library/Python/3.13/lib/python/site-packages/google/protobuf/runtime_version.py:106: in ValidateProtobufRuntimeVersion
102:     _ReportVersionError(
102: /Users/jenkins/Library/Python/3.13/lib/python/site-packages/google/protobuf/runtime_version.py:47: in _ReportVersionError
102:     raise VersionError(msg)
102: E   google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading gz/msgs/stringmsg.proto: gencode 5.28.3 runtime 5.28.2. Runtime version cannot be older than the linked gencode version. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.
102: - generated xml file: /Users/jenkins/jenkins-agent/workspace/gz_transport-ci-gz-transport14-homebrew-amd64/build/test_results/options_TEST.xml -
102: =========================== short test summary info ============================
102: ERROR ../../gz-transport/python/test/options_TEST.py - google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading gz/msgs/stringmsg.proto: gencode 5.28.3 runtime 5.28.2. Runtime version cannot be older than the linked gencode version. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.
102: !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
102: =============================== 1 error in 0.11s ===============================
102/102 Test #102: options_TEST.py ........................................***Failed    0.28 sec

When running pip install protobuf:

+ pip3 install --break-system-packages pytest protobuf
Requirement already satisfied: pytest in /Users/jenkins/Library/Python/3.13/lib/python/site-packages (8.3.3)
Requirement already satisfied: protobuf in /Users/jenkins/Library/Python/3.13/lib/python/site-packages (5.28.2)
Requirement already satisfied: iniconfig in /Users/jenkins/Library/Python/3.13/lib/python/site-packages (from pytest) (2.0.0)
Requirement already satisfied: packaging in /Users/jenkins/Library/Python/3.13/lib/python/site-packages (from pytest) (24.1)
Requirement already satisfied: pluggy<2,>=1.5 in /Users/jenkins/Library/Python/3.13/lib/python/site-packages (from pytest) (1.5.0)

Using --upgrade with pip install should upgrade outdated packages, which should fix these protobuf errors.

Testing with this branch:

Needed to fix protobuf version errors.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@j-rivero
Copy link
Contributor

j-rivero commented Nov 4, 2024

Umm somehow is it an undesired side problem of having pip to install the software system wise? I meant we probably don't want pip to mess around the versions of protobuf handled by brew, right?

@scpeters
Copy link
Contributor Author

scpeters commented Nov 4, 2024

Umm somehow is it an undesired side problem of having pip to install the software system wise? I meant we probably don't want pip to mess around the versions of protobuf handled by brew, right?

brew doesn't install python support for protobuf anymore

maybe instead we should be removing all installed pip packages during _homebrew_cleanup.bash?

@azeey
Copy link
Contributor

azeey commented Nov 4, 2024

Would switching to using venvs for pip help?

@scpeters
Copy link
Contributor Author

scpeters commented Nov 4, 2024

Umm somehow is it an undesired side problem of having pip to install the software system wise? I meant we probably don't want pip to mess around the versions of protobuf handled by brew, right?

brew doesn't install python support for protobuf anymore

maybe instead we should be removing all installed pip packages during _homebrew_cleanup.bash?

we are already clearing /usr/local/lib/python*/site-packages in _homebrew_cleanup.bash, but I see in the unstable build that it was finding protobuf from /Users/jenkins/Library/Python/3.13/lib/python/site-packages

using a virtual environment might be the simplest solution; let me give it a try

@scpeters
Copy link
Contributor Author

scpeters commented Nov 4, 2024

Umm somehow is it an undesired side problem of having pip to install the software system wise? I meant we probably don't want pip to mess around the versions of protobuf handled by brew, right?

brew doesn't install python support for protobuf anymore
maybe instead we should be removing all installed pip packages during _homebrew_cleanup.bash?

we are already clearing /usr/local/lib/python*/site-packages in _homebrew_cleanup.bash, but I see in the unstable build that it was finding protobuf from /Users/jenkins/Library/Python/3.13/lib/python/site-packages

using a virtual environment might be the simplest solution; let me give it a try

alternative using venv in #1194

@scpeters
Copy link
Contributor Author

scpeters commented Nov 4, 2024

Fixed in #1194 instead

@scpeters scpeters closed this Nov 4, 2024
@scpeters scpeters deleted the scpeters/pip_upgrade branch November 4, 2024 22:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants