Skip to content
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

fix: add ‹/usr/local› to ‹PYTHONPATH› #109

Merged

Conversation

mfocko
Copy link
Member

@mfocko mfocko commented 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


  • follow-up from the Monday's deployment

@mfocko mfocko requested review from nforro and lbarcziova May 30, 2024 08:52
@mfocko mfocko self-assigned this May 30, 2024
Copy link
Contributor

Dockerfile Show resolved Hide resolved
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 mfocko force-pushed the fix/importing-consumerino branch from ea34090 to db1b9f5 Compare May 30, 2024 09:01
Co-authored-by: Laura Barcziová <[email protected]>
Co-authored-by: Nikola Forrò <[email protected]>
Signed-off-by: Matej Focko <[email protected]>
@mfocko mfocko force-pushed the fix/importing-consumerino branch from db1b9f5 to addcd47 Compare May 30, 2024 09:02
@mfocko mfocko added the mergeit When set, zuul wil gate and merge the PR. label May 30, 2024
@nforro
Copy link
Member

nforro commented May 30, 2024

Given the fact that there needs to be hardcoded Python version in the path, I hate this solution.

Maybe we could change the pip installation path (possibly with --install-option="--prefix=/usr" in extra_args).

Copy link
Contributor

Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/d1590815fefb40ea90b4e24b205705bb

✔️ pre-commit SUCCESS in 1m 49s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit d6f474d into packit:main May 30, 2024
4 checks passed
@mfocko mfocko deleted the fix/importing-consumerino branch May 30, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants