-
Notifications
You must be signed in to change notification settings - Fork 53
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
Cannot import module with callback #364
Comments
mfocko
added a commit
to mfocko/fedora-messaging
that referenced
this issue
May 27, 2024
Related to fedora-infra#364 Related to packit/agile#552 Signed-off-by: Matej Focko <[email protected]>
Upon closer inspection and discussion with @nforro, it appears that the issue comes from the fact that we do global pip install from the sources which installs to |
mfocko
added a commit
to mfocko/packit-service-fedmsg
that referenced
this issue
May 30, 2024
With regards to the change that occured in between 3.4.1 and 3.5.0 releases of Fedora Messaging, it is not possible to import consumer callback from ‹/usr/local/› installed Python module, which is the default for global installation of packages via pip. Given the fact that there needs to be hardcoded Python version in the path, I hate this solution. When trying out ‹--callback-file›, I've been hit with the same import issue, as Celery is installed via pip too, cause it hasn't been released to EPEL9 even after a year of requesting this via RHBZ#2032543. Trying out the “hack”¹ from similar project resulted in failure too, as the current working directory isn't included in the path either. So much for the ecosystem and easy to use… ¹ https://gitlab.com/CentOS/Integration/gitlab-webhooks/-/merge_requests/1/diffs?commit_id=1bc3b2f8c2598dd6a24c70f149b3cc683eaf37b1 Related to fedora-infra/fedora-messaging#364 Signed-off-by: Matej Focko <[email protected]>
mfocko
added a commit
to mfocko/packit-service-fedmsg
that referenced
this issue
May 30, 2024
With regards to the change that occured in between 3.4.1 and 3.5.0 releases of Fedora Messaging, it is not possible to import consumer callback from ‹/usr/local/› installed Python module, which is the default for global installation of packages via pip. Given the fact that there needs to be hardcoded Python version in the path, I hate this solution. When trying out ‹--callback-file›, I've been hit with the same import issue, as Celery is installed via pip too, cause it hasn't been released to EPEL9 even after a year of requesting this via RHBZ#2032543. Trying out the “hack”¹ from similar project resulted in failure too, as the current working directory isn't included in the path either. So much for the ecosystem and easy to use… ¹ https://gitlab.com/CentOS/Integration/gitlab-webhooks/-/merge_requests/1/diffs?commit_id=1bc3b2f8c2598dd6a24c70f149b3cc683eaf37b1 Related to fedora-infra/fedora-messaging#364 Signed-off-by: Matej Focko <[email protected]>
softwarefactory-project-zuul bot
added a commit
to packit/packit-service-fedmsg
that referenced
this issue
May 30, 2024
fix: add ‹/usr/local› to ‹PYTHONPATH› With regards to the change that occured in between 3.4.1 and 3.5.0 releases of Fedora Messaging, it is not possible to import consumer callback from ‹/usr/local/› installed Python module, which is the default for global installation of packages via pip. Given the fact that there needs to be hardcoded Python version in the path, I hate this solution. When trying out ‹--callback-file›, I've been hit with the same import issue, as Celery is installed via pip too, cause it hasn't been released to EPEL9 even after a year of requesting this via RHBZ#2032543. Trying out the “hack”¹ from similar project resulted in failure too, as the current working directory isn't included in the path either. So much for the ecosystem and easy to use… ¹ https://gitlab.com/CentOS/Integration/gitlab-webhooks/-/merge_requests/1/diffs?commit_id=1bc3b2f8c2598dd6a24c70f149b3cc683eaf37b1 Related to fedora-infra/fedora-messaging#364 follow-up from the Monday's deployment Reviewed-by: Nikola Forró Reviewed-by: Laura Barcziová Reviewed-by: Matej Focko
mfocko
added a commit
to mfocko/fedora-messaging
that referenced
this issue
Jun 12, 2024
Related to fedora-infra#364 Related to packit/agile#552 Signed-off-by: Matej Focko <[email protected]>
abompard
pushed a commit
that referenced
this issue
Jun 13, 2024
Related to #364 Related to packit/agile#552 Signed-off-by: Matej Focko <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, during today's production deployment (packit/agile#552) of Packit Service I hit multiple issues with the Fedora Messaging.
Missing
requests
The easiest one to fix (at least I hope) is missing
requests
dependency for the newreplay
feature. I have a feeling that this is related to the way it's being packaged into RPM, so right now therequests
doesn't get installed. I've installed manually on our side as of now and hopefully will open a PR that will fix this.Failing import
Right now (Fedora Messaging 3.5.0 from RPM) I'm getting:
The way we build the image can be seen here.
I was trying to debug this issue:
I can import the module from
python3
REPL in the imageI can import using your own function
_callback_from_python_path()
:This bug has been introduced in between 3.4.1 (works as intended) and 3.5.0 releases.
I've briefly went through the commits in between those tags, checked the
git blame
on thecli.py
for any changes of importing the callbacks, haven't managed to find anything suspicious.Additional information
The text was updated successfully, but these errors were encountered: