From a1180747d5126ea7bf34444dc9a283ca4943bff7 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 31 Jul 2024 08:17:29 -0700 Subject: [PATCH] remove uk bank holidays --- notifications_utils/letter_timings.py | 22 +++++----------------- poetry.lock | 16 +--------------- pyproject.toml | 1 - 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/notifications_utils/letter_timings.py b/notifications_utils/letter_timings.py index 62abf2c21..1072465fd 100644 --- a/notifications_utils/letter_timings.py +++ b/notifications_utils/letter_timings.py @@ -2,7 +2,6 @@ from collections import namedtuple from datetime import datetime, time, timedelta import pytz -from govuk_bank_holidays.bank_holidays import BankHolidays from notifications_utils.countries.data import Postage from notifications_utils.timezones import utc_string_to_aware_gmt_datetime @@ -18,16 +17,6 @@ CANCELLABLE_JOB_LETTER_STATUSES = [ ] -non_working_days_dvla = BankHolidays( - use_cached_holidays=True, - weekend=(5, 6), -) -non_working_days_royal_mail = BankHolidays( - use_cached_holidays=True, - weekend=(6,), # Only Sunday (day 6 of the week) is a non-working day -) - - def set_gmt_hour(day, hour): return ( day.astimezone(pytz.timezone("Europe/London")) @@ -36,28 +25,27 @@ def set_gmt_hour(day, hour): ) -def get_next_work_day(date, non_working_days): +def get_next_work_day(date, non_working_days=None): next_day = date + timedelta(days=1) - if non_working_days.is_work_day( + if non_working_days and non_working_days.is_work_day( date=next_day.date(), - division=BankHolidays.ENGLAND_AND_WALES, ): return next_day - return get_next_work_day(next_day, non_working_days) + return get_next_work_day(next_day) def get_next_dvla_working_day(date): """ Printing takes place monday to friday, excluding bank holidays """ - return get_next_work_day(date, non_working_days=non_working_days_dvla) + return get_next_work_day(date) def get_next_royal_mail_working_day(date): """ Royal mail deliver letters on monday to saturday """ - return get_next_work_day(date, non_working_days=non_working_days_royal_mail) + return get_next_work_day(date) def get_delivery_day(date, *, days_to_deliver): diff --git a/poetry.lock b/poetry.lock index e277224d6..a636a17e7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -966,20 +966,6 @@ files = [ {file = "geojson-3.1.0.tar.gz", hash = "sha256:58a7fa40727ea058efc28b0e9ff0099eadf6d0965e04690830208d3ef571adac"}, ] -[[package]] -name = "govuk-bank-holidays" -version = "0.14" -description = "Tool to load UK bank holidays from GOV.UK" -optional = false -python-versions = ">=3.6" -files = [ - {file = "govuk-bank-holidays-0.14.tar.gz", hash = "sha256:ce85102423b72908957d25981f616494729686515d5d66c09a1d35a354ce20a6"}, - {file = "govuk_bank_holidays-0.14-py3-none-any.whl", hash = "sha256:da485c4a40c6c874c925916e492e3f20b807cffba7eed5f07fb69327aef6b10b"}, -] - -[package.dependencies] -requests = "*" - [[package]] name = "greenlet" version = "3.0.3" @@ -3102,4 +3088,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "6420327e4cabd4b5e6b7903607f5c435c53f98b10b3da42da988a18da5fd1717" +content-hash = "b271104f669ce0a8e78fb09299b61cf0502cc81a18213dda00f77c759b6e0209" diff --git a/pyproject.toml b/pyproject.toml index 4abe5ac27..5a9dc8727 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,6 @@ flask-basicauth = "~=0.2" flask-login = "^0.6" flask-talisman = "*" flask-wtf = "^1.2" -govuk-bank-holidays = "^0.14" gunicorn = {version = "==22.0.0", extras = ["eventlet"]} humanize = "~=4.10" itsdangerous = "~=2.2"