From 8a69069e8317dc34427fce864ade6c461c7dfa03 Mon Sep 17 00:00:00 2001 From: David Walker Date: Sat, 5 Feb 2022 15:58:44 +0000 Subject: [PATCH] Fix Docker image build --- docker/Dockerfile | 10 +++++----- setup.py | 5 +++-- src/naturerec_model/logic/reports.py | 5 +++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 71c1bb5..315c2b0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,15 +1,15 @@ FROM python:3.10-slim-bullseye AS runtime -COPY naturerecorderpy-1.0.18.0 /opt/naturerecorderpy-1.0.18.0 +COPY naturerecorderpy-1.0.19.0 /opt/naturerecorderpy-1.0.19.0 -WORKDIR /opt/naturerecorderpy-1.0.18.0 +WORKDIR /opt/naturerecorderpy-1.0.19.0 RUN apt-get update -y RUN pip install -r requirements.txt -RUN pip install nature_recorder-1.0.18-py3-none-any.whl +RUN pip install nature_recorder-1.0.19-py3-none-any.whl -ENV NATURE_RECORDER_DATA_FOLDER=/var/opt/naturerecorderpy-1.0.18.0 -ENV NATURE_RECORDER_DB=/var/opt/naturerecorderpy-1.0.18.0/naturerecorder.db +ENV NATURE_RECORDER_DATA_FOLDER=/var/opt/naturerecorderpy-1.0.19.0 +ENV NATURE_RECORDER_DB=/var/opt/naturerecorderpy-1.0.19.0/naturerecorder.db ENTRYPOINT [ "python" ] CMD [ "-m", "naturerec_web" ] diff --git a/setup.py b/setup.py index a862428..cc27a48 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def find_package_files(directory, remove_root): setuptools.setup( name="nature_recorder", - version="1.0.18", + version="1.0.19", description="Wildlife sightings database", packages=setuptools.find_packages("src"), include_package_data=True, @@ -43,9 +43,10 @@ def find_package_files(directory, remove_root): "naturerec_web.jobs": ["templates/jobs/*.html"], "naturerec_web.life_list": ["templates/life_list/*.html"], "naturerec_web.locations": ["templates/locations/*.html"], + "naturerec_web.reports": ["templates/reports/*.html"], "naturerec_web.sightings": ["templates/sightings/*.html"], "naturerec_web.species": ["templates/species/*.html"], - "naturerec_web.status": ["templates/status/*.html"], "naturerec_web.species_ratings": ["templates/species_ratings/*.html"], + "naturerec_web.status": ["templates/status/*.html"], } ) diff --git a/src/naturerec_model/logic/reports.py b/src/naturerec_model/logic/reports.py index 22a25cc..9c78b19 100644 --- a/src/naturerec_model/logic/reports.py +++ b/src/naturerec_model/logic/reports.py @@ -117,6 +117,11 @@ def save_report_barchart(report_df, y_column_name, x_label, y_label, title, imag # Save to the specified file in PNG format plt.savefig(image_path, format='png', dpi=300) + # And clear the plot + plt.clf() + plt.cla() + plt.close() + def get_image_base64(image_path): """