Skip to content

Commit

Permalink
fix: add ‹/usr/local› to ‹PYTHONPATH› (#109)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
softwarefactory-project-zuul[bot] authored May 30, 2024
2 parents 4543640 + addcd47 commit d6f474d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM quay.io/packit/base:c9s
# [NOTE] Adjust ‹PYTHONPATH› when changing the default image

ENV USER=packit \
HOME=/home/packit
HOME=/home/packit \
# [NOTE] Fixes the issue with importing after upgrading Fedora Messaging to
# 3.5.0: fedora-infra/fedora-messaging#364
PYTHONPATH="/usr/local/lib/python3.9/site-packages"

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

0 comments on commit d6f474d

Please sign in to comment.