Skip to content

Commit

Permalink
fix(image): add ‹/usr/local› to ‹PYTHONPATH›
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mfocko committed May 30, 2024
1 parent 4543640 commit cfdac0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM quay.io/packit/base:c9s

ENV USER=packit \
HOME=/home/packit
HOME=/home/packit \
PYTHONPATH="/usr/local/lib/python3.9/site-packages"

COPY files/install-deps.yaml /src/files/
RUN cd /src/ \
Expand Down

0 comments on commit cfdac0d

Please sign in to comment.