From 9bce32191592b5a9e65a4bc02807e793c8cc53c3 Mon Sep 17 00:00:00 2001 From: alina demianenko Date: Mar 30 2025 20:50:20 +0000 Subject: [PATCH 1/2] Update the list of interpreters used in tox.ini --- diff --git a/Dockerfile b/Dockerfile index b423149..6f6ddf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,23 @@ -FROM registry.fedoraproject.org/fedora:38 +FROM registry.fedoraproject.org/fedora:41 -# set PYTHONUNBUFFERED env var to non-empty string so that our -# periods with no newline get printed immediately to the screen +# Set PYTHONUNBUFFERED to true so that python prints directly to the screen ENV PYTHONUNBUFFERED=true -# Get any latest updates since last container spin -RUN dnf update -y && dnf clean all - -# Install pagure/fedmsg libraries -RUN dnf -y install python3-ogr fedora-messaging python3-toml && dnf clean all +# Install dependencies for Compose Tracker and Fedora Messaging +RUN dnf update -y && \ + dnf install -y python3-ogr fedora-messaging python3-toml && \ + dnf clean all +# Create a directory for the work environment RUN mkdir /work WORKDIR /work - +# Copy the necessary files into the container ADD compose-tracker.toml /work/my_config.toml -# Copy the fedora config for fedora-messaging and also generate a random UUID -# https://fedora-messaging.readthedocs.io/en/latest/fedora-broker.html#getting-connected -# Note this will mean that if there is more than one container running -# using this image they will be reading from the same queue. Generally -# I expect this to only be running in one place. -RUN sed -i "s/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/$(uuidgen)/g" /work/my_config.toml - -# Lower log levels to WARNING level -#RUN sed -i 's/INFO/WARNING/' /work/my_config.toml - -# Put compose-tracker into a location that can be imported ADD compose_tracker.py /usr/lib/python3.11/site-packages/ -# Call fedora-messaging CLI and tell it to use the ComposeTracker -# class from the compose-tracker module. +# Generate a new UUID for Compose Tracker +RUN sed -i "s/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/$(uuidgen)/g" /work/my_config.toml + +# Command to run the tracker CMD fedora-messaging --conf /work/my_config.toml consume diff --git a/tox.ini b/tox.ini index ca13902..4b98a03 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{36,37,38,39,310,311} +envlist = py{39,311,312,313} skip_missing_interpreters = true isolated_build = true @@ -8,4 +8,4 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/requirements-test.txt commands = - py.test + pytest From 283379b4ba950ae1046d1dac7e81df5103eb2305 Mon Sep 17 00:00:00 2001 From: alina demianenko Date: Apr 01 2025 02:38:40 +0000 Subject: [PATCH 2/2] retrieves the last path in the list of site-packages directories --- diff --git a/Dockerfile b/Dockerfile index 6f6ddf7..53e099c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,26 @@ FROM registry.fedoraproject.org/fedora:41 -# Set PYTHONUNBUFFERED to true so that python prints directly to the screen +# Set PYTHONUNBUFFERED to ensure real-time output ENV PYTHONUNBUFFERED=true -# Install dependencies for Compose Tracker and Fedora Messaging +# Install necessary packages RUN dnf update -y && \ dnf install -y python3-ogr fedora-messaging python3-toml && \ dnf clean all -# Create a directory for the work environment +# Create a working directory RUN mkdir /work WORKDIR /work -# Copy the necessary files into the container +# Copy configuration file into the container ADD compose-tracker.toml /work/my_config.toml -ADD compose_tracker.py /usr/lib/python3.11/site-packages/ -# Generate a new UUID for Compose Tracker +# Determine the site-packages directory and copy compose_tracker.py there +RUN SITE_PACKAGES=$(python3 -c "import site; print(site.getsitepackages()[-1])") && \ + cp compose_tracker.py $SITE_PACKAGES/ + +# Generate a unique UUID for the configuration RUN sed -i "s/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/$(uuidgen)/g" /work/my_config.toml -# Command to run the tracker +# Set the command to run the application CMD fedora-messaging --conf /work/my_config.toml consume