-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Brunei Darussalam holidays #1168
Conversation
- Update existing l10n tests to use TestCase::assertLocalizedHolidays - Change `check` make target to include `make l10n` - Fix .po file generation warning for AR, CO, CR, RS - Bulk update stale .po files (location) - Remove unused l10n test methods from common::TestCase
I'm tackling these 2 errors so far to no avail: ______________ ERROR at setup of TestBrunei.test_armed_forces_day ______________
[gw0] linux -- Python 3.9.16 /opt/hostedtoolcache/Python/3.9.16/x64/bin/python
cls = <class 'tests.countries.test_brunei.TestBrunei'>
@classmethod
def setUpClass(cls):
> super().setUpClass(
Brunei,
years=range(1984, 2077),
years_non_observed=range(1984, 2077),
)
tests/countries/test_brunei.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/common.py:48: in setUpClass
cls.holidays = test_class(years=years)
holidays/countries/brunei.py:73: in __init__
super().__init__(*args, **kwargs)
holidays/holiday_base.py:327: in __init__
self._populate(year)
holidays/countries/brunei.py:109: in _populate
_add_observed(self._add_isra_and_miraj_day(tr("Israk dan Mikraj")))
holidays/countries/brunei.py:85: in _add_observed
if self.observed and (self._is_friday(dt) or self._is_sunday(dt)):
holidays/holiday_base.py:842: in _is_friday
return self._check_weekday(FRI, *args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = {datetime.date(2048, 1, 1): 'Awal Tahun Masihi', datetime.date(2048, 2, 14): 'Tahun Baru Cina', datetime.date(2048, 2, 15): 'Tahun Baru Cina - Diperhatikan', datetime.date(2048, 5, 10): 'Israk dan Mikraj* (*angarran)'}
weekday = 4, args = ({datetime.date(2048, 5, 10)},)
dt = {datetime.date(2048, 5, 10)}
def _check_weekday(self, weekday: int, *args) -> bool:
"""
Returns True if `weekday` equals to the date's week day.
Returns False otherwise.
"""
dt = args[0] if len(args) == 1 else date(self._year, *args)
> return dt.weekday() == weekday
E AttributeError: 'set' object has no attribute 'weekday'
holidays/holiday_base.py:827: AttributeError ___________________ TestEntityLoader.test_countries_imports ____________________
[gw0] linux -- Python 3.9.16 /opt/hostedtoolcache/Python/3.9.16/x64/bin/python
self = <tests.test_registry.TestEntityLoader testMethod=test_countries_imports>
def test_countries_imports(self):
warnings.simplefilter("ignore")
import holidays
loader_entities = set()
for module, entities in registry.COUNTRIES.items():
module = importlib.import_module(f"holidays.countries.{module}")
for entity in entities:
> countries_cls = getattr(countries, entity)
E AttributeError: module 'holidays.countries' has no attribute 'Brunei'
tests/test_registry.py:31: AttributeError |
It seems that the country hasn't been added to |
Fixed now, thanks for the help :) |
Co-Authored-By: ~Jhellico <[email protected]>
Co-Authored-By: Arkadii Yakovets <[email protected]>
Add PoC Arabic l10n for CA, ET, UA Add minor fixes and updates
Co-authored-by: ~Jhellico <[email protected]>
Co-authored-by: abh31000 <[email protected]>
Co-authored-by: abh31000 <[email protected]>
Co-Authored-By: ~Jhellico <[email protected]>
Co-authored-by: ~Jhellico <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✌️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a great addition to the list of supported countries!
Thanks for all your work @PPsyrius!
Please let me know if you have any questions regarding the comments I've left:
Co-Authored-By: Arkadii Yakovets <[email protected]>
self._add_islamic_calendar_holiday(
self.tr("%s - Diperhatikan") % self[hol_date],
(
(
obs_date,
self._year
not in BruneiIslamicCalendar.EID_AL_FITR_DATES,
),
),
) @arkid15r Can you explain more about this? This is supposed to fully replace all instances of for dt in self._add_eid_al_adha_day(tr("Hari Raya Aidil Adha")):
_add_observed(dt) and placed at the back once all Islamic holidays are already declared, right? |
Sure -- the code example is a reply to the @KJhellico's comment you had during the review. It supposed to address the mentioned issue w/
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple more comments to address and we're good to go:
Co-Authored-By: Arkadii Yakovets <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👍
Marking as ready for beta
Thank you for the contribution! |
Proposed change
Add Brunei holidays (
en_US
,ms
,th
localization).Closes #1157. Currently waiting until a decision on #1140 and #1148 is made.
Type of change
Checklist
beta
branch of the repositorymake pre-commit
make test
,make tox
(we strongly encourage adding tests to your code)