From 6070b5a3092a6408a6130f3e74f589a6c3dc7460 Mon Sep 17 00:00:00 2001 From: Mert Sarikaya <40162433+sarikayamerts@users.noreply.github.com> Date: Fri, 31 Jan 2020 02:24:11 +0300 Subject: [PATCH] update holidays dependency according to the new structure (#1295) * update holidays dependency according to the new structure * fix backward compatibility problem * by-pass version dependency for holidays package Co-authored-by: Ben Letham --- python/fbprophet/hdays.py | 9 ++++++++- python/requirements.txt | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/python/fbprophet/hdays.py b/python/fbprophet/hdays.py index 94d4b9d..ddfb128 100644 --- a/python/fbprophet/hdays.py +++ b/python/fbprophet/hdays.py @@ -11,9 +11,16 @@ from calendar import Calendar, MONDAY from datetime import date, timedelta from convertdate.islamic import from_gregorian, to_gregorian -from holidays import WEEKEND, HolidayBase, easter, rd from lunarcalendar import Lunar, Converter +try: + from holidays import WEEKEND, HolidayBase, easter, rd +except: + from holidays.constants import WEEKEND + from holidays.holiday_base import HolidayBase + from dateutil.easter import easter + from dateutil.relativedelta import relativedelta as rd + # Official public holidays at a country level # ------------ Holidays in Brazil--------------------- class Brazil(HolidayBase): diff --git a/python/requirements.txt b/python/requirements.txt index 9a08034..7748ebe 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -5,5 +5,5 @@ pandas>=0.23.4 matplotlib>=2.0.0 LunarCalendar>=0.0.9 convertdate>=2.1.2 -holidays>=0.9.5,<0.10.1 +holidays>=0.10.1 setuptools-git>=1.2