Skip to content
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

Refactor implicit returns #935

Merged
merged 1 commit into from
Feb 12, 2023
Merged

Conversation

arkid15r
Copy link
Collaborator

Use return None instead of just return.

@coveralls
Copy link

Coverage Status

Coverage: 99.775%. Remained the same when pulling dc485ce on arkid15r:use-explicit-returns into 6983684 on dr-prodigy:beta.

@dr-prodigy dr-prodigy merged commit d05c87a into vacanza:beta Feb 12, 2023
@dr-prodigy
Copy link
Collaborator

Thank you Ark! 👍

@arkid15r arkid15r deleted the use-explicit-returns branch February 14, 2023 18:45
@arkid15r arkid15r mentioned this pull request Feb 20, 2023
arkid15r added a commit that referenced this pull request Feb 21, 2023
* Standardize .py file headers.

* Introduce `HolidayBase::_is_leap_year()`.
Refactor ET, HK.

* Move locale directory to holidays.

* Replace `relativedelta` with `timedelta` for days offset calculation.

* Replace `relativedelta` with `timedelta` for days offset calculation.

* update spain.py with changes for year 2023

* update test_spain.py

* update test_spain.py

* update test_spain.py

* update test_spain.py

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Import timedelta as td.

* Import timedelta as td.

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Update holidays/countries/spain.py

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Montenegro optimization

* Add initial PR template.

* Update template.

* Update template.

* Change the template.

* add docstring with reference to Spain

* update Spain tests

* remove unused constants

* Add commnent with reference to Spain

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Init v.0.20 beta.

* Upgrade dependency: change black version from 22.12.0 to 23.1.0.

* Change holiday name separator from ", " to "; ".

* Update Australia holidays: fix 2020 QLD holidays.

* Jamaica holidays update

* Bosnia and Herzegovina holidays update

* Simplify if/else statement.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Bolivia holidays update and refactoring

* Panama holidays added

* Refactor days offset calculation for recently added countries

* Change some of common.TestCase methods behavior:
  - `TestCase::assertHolidayName
  - `TestCase::assertHolidaysName`
  - `TestCase::assertNoHolidayName`

* Cuba holidays refactoring

* Hong Kong fix

* Thai Lunar Calendar added, exact start of holidays for historic use, refs, etc.

* In-code comment improvements for readability

* Add contact info in case future changes are needed

* Fixed syntax error

* TH Special Holidays code improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH in lieu holiday trigger refactor

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: turns out <= <= is now a thing

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH testcases updated

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: case switch for standardizaton

* TH autoformatting from running `tox`

* TH: E266 comment block format adherence

* TH: E501 line too long format adherence (except link and Thai date names for now)

* TH: E501 cleanups. other final checks (for now)

* TH Sort testcase date

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Added tests for Thailand

* TH fixed Visakha Bucha trigger

* TH fixed wording, add missing special election holiday

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH fixes New Year's Eve (in lieu)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH  Songkran special in lieu, fixes Queen Sirikit's bday error

No, you cannot simply changes your own birthday lmao, but the case is indeed correct for Mother's Day

* TH Asarnha-Buddhist Lent Day in lieu fixes

* TH: holiday limiter is ; not , (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: holiday limiter is ; not , (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (3)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (4)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove useless recursive call for `add_holiday`

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (5)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: add missing `self.observed`, remove all defunct codes

* TH: further simplify Asarnha Bucha trigger

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Burundi holidays refactoring

* Fix Islamic holidays calculation
- fix for holidays that happen twice in a Gregorian year (primarily islamic New Year)
- years range checking more strictly

* Update environment:
  - Add Makefile, wrap common commands
  - Move all requirements file to `requirements` directory
  - Move tests from `test` to `tests` directory
  - Introduce `pytest-xdist`, make pytest running in parallel
  - Add local pre-push hook for tests
  - Format ci-cd.yml
  - Clean up pyproject.toml
  - Update tox.ini, make tox running in parallel
  - Update setup.cfg
  - Update CONTRIBUTION.rst instructions

* Add filter warnings comment.

* Fix utils tests.

* Set Python version for QA job.

* Run tests via 'make test'.

* TH: no `self.observed` needed if they already have special  in-lieus

* TH: adjust this for coverall tests

* docstring fix

* TH: Thai lunar calendar now works up to 1941, all trigger now starts in 1941

* TH: test case refractor + extend checks to 2030

Individual Holiday's test case:

- assertNoHoliday 1 year prior
- assertHoliday while exists
- assertNoHoliday 1 year post

- asserNoHoliday for holidays_no_observed for 2010-2030

* TH: Buddhist holiday extended testcases, applying suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Tests update

* Update .pre-commit-config.yaml and tox.ini.

* Fix imports.

* Botswana observed holidays performance optimization

* Burundi observed holidays performance optimization

* Ukraine observed holidays performance optimization

* TH: remove `_en` suffix, `__init__(self, **kwargs):`

* TH: code improvements suggestions from @arkid15r

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: remove financial holiday stubs (this will be its own thing later)

* TH: move sources to 2nd row, `_ThaiLuniSolar` is now in util.py

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: add Atthami Bucha and Ok Phansa support for

* TH: fixed double `raeknakhwan` oversight

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `_ThaiLuniSolar` either returns date-type or None

* TH: `add_holiday` --> `_add_with_observed` for unified wording

* TH: `KJhellico`'s suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Fix merge issues.

* TH: applying `arkid15r` 's suggestions

- Simplified __init__ section for Thailand's, removed for _ThaiLuniSolar
- Simplified _ThaiLuniSolar holiday codes
- _ThaiLuniSolar's comment are now docstrings
- Move all Thailand's holiday references to above limitations' section
- Remove Thailand's duplicate date checks (with TODO comments instead)
- Thailand's In Line comments are also moved to each holiday's header for better readability

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: in-line single instance holidays

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: forgot to re-sort this, oof

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: fixed duplicate var, other improvements

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: clean up comments

* TH: back to `@lru_cache()` again

* Simplify test classes setup.
Update documentation.

* Exclude tests from the MANIFEST.in.

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Add United States Minor Outlying Islands (ISO-3666-2 code US-UM) (#940)

* ISO 3166-1 for US subdivisions (#941)

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>

* Add International Women's Day for DE-MV (#936)

* Add internationaler Frauentag for DE-MV

* Remove trailing whitespace

* Remove .gitpod.yml

* Add .gitpod.yml to .gitignore

* Add tests for Frauentag in DE-MV

* CHANGES sync

* Return `None` explicitly. (#935)

* CHANGES sync

* Rework i18n.

* Update pre-commit settings.

* Fix Thailand related changes coverage decrease.

* Fix naming and minor issues in .pot files generator.

* Update translations.

* Add final fixes.

* Add additional cases.

* TH: additional testcases for the rest of Thai Lunar Holidays

* Fix Ukraine tests

* Fix ordering.

* Add missing cases.

* Rename dev env setup target.

* Suppress warnings for tests.

* Poland:
- added historical holidays
- added Ukrainian translation
- refactored tests

* header fix

* Optimize observed holidays for Mozambique, Namibia, Zambia, Zimbabwe

* Added test for Ukrainian

* Update Albania observed holidays

* National Day for Truth and Reconciliation in British Columbia (Canada)

* Optimize observed holidays for Angola, Eswatini, Kazakhstan, Kenya, Malawi, Singapore, South Africa

* fix

Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>

* Localize ascii incompatible countries.
Add en_US localizatin for:
  - Armenia
  - Belarus
  - Bulgaria
  - Canada
  - Cyprus
  - Ethiopia
  - Georgia
  - Greece
  - Japan
  - Russia
  - Serbia
Update po generation files script.
Update MANIFEST.in.
Update README.rst.
Fix packaging.

* Fix headers.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Fix mo cleanup process.

* Fix compatibility issue.

* Fix .po files related issues.

* Add .mo files generator. Rework `TestCase` base class l10n handling.

* Update Makefile.

* Re-enable fallback translation.

* Fix minor test issues.

* Update PR template.

* Update CHANGES.

* Update version format.

* Update CHANGES

---------

Co-authored-by: delaosa <delaosa@gmail.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: ~Jhellico <jhellico@gmail.com>
Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Mike Borsetti <mike@borsetti.com>
Co-authored-by: Mike Borsetti <26698111+mborsetti@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>
Co-authored-by: Alexander Schulze <alexanderschulze@users.noreply.github.com>
@arkid15r arkid15r mentioned this pull request Feb 22, 2023
arkid15r added a commit that referenced this pull request Feb 23, 2023
* Replace `relativedelta` with `timedelta` for days offset calculation.

* Replace `relativedelta` with `timedelta` for days offset calculation.

* update spain.py with changes for year 2023

* update test_spain.py

* update test_spain.py

* update test_spain.py

* update test_spain.py

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Import timedelta as td.

* Import timedelta as td.

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Update holidays/countries/spain.py

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Montenegro optimization

* Add initial PR template.

* Update template.

* Update template.

* Change the template.

* add docstring with reference to Spain

* update Spain tests

* remove unused constants

* Add commnent with reference to Spain

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Init v.0.20 beta.

* Upgrade dependency: change black version from 22.12.0 to 23.1.0.

* Change holiday name separator from ", " to "; ".

* Update Australia holidays: fix 2020 QLD holidays.

* Jamaica holidays update

* Bosnia and Herzegovina holidays update

* Simplify if/else statement.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Bolivia holidays update and refactoring

* Panama holidays added

* Refactor days offset calculation for recently added countries

* Change some of common.TestCase methods behavior:
  - `TestCase::assertHolidayName
  - `TestCase::assertHolidaysName`
  - `TestCase::assertNoHolidayName`

* Cuba holidays refactoring

* Hong Kong fix

* Thai Lunar Calendar added, exact start of holidays for historic use, refs, etc.

* In-code comment improvements for readability

* Add contact info in case future changes are needed

* Fixed syntax error

* TH Special Holidays code improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH in lieu holiday trigger refactor

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: turns out <= <= is now a thing

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH testcases updated

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: case switch for standardizaton

* TH autoformatting from running `tox`

* TH: E266 comment block format adherence

* TH: E501 line too long format adherence (except link and Thai date names for now)

* TH: E501 cleanups. other final checks (for now)

* TH Sort testcase date

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Added tests for Thailand

* TH fixed Visakha Bucha trigger

* TH fixed wording, add missing special election holiday

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH fixes New Year's Eve (in lieu)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH  Songkran special in lieu, fixes Queen Sirikit's bday error

No, you cannot simply changes your own birthday lmao, but the case is indeed correct for Mother's Day

* TH Asarnha-Buddhist Lent Day in lieu fixes

* TH: holiday limiter is ; not , (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: holiday limiter is ; not , (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (3)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (4)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove useless recursive call for `add_holiday`

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (5)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: add missing `self.observed`, remove all defunct codes

* TH: further simplify Asarnha Bucha trigger

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Burundi holidays refactoring

* Fix Islamic holidays calculation
- fix for holidays that happen twice in a Gregorian year (primarily islamic New Year)
- years range checking more strictly

* Update environment:
  - Add Makefile, wrap common commands
  - Move all requirements file to `requirements` directory
  - Move tests from `test` to `tests` directory
  - Introduce `pytest-xdist`, make pytest running in parallel
  - Add local pre-push hook for tests
  - Format ci-cd.yml
  - Clean up pyproject.toml
  - Update tox.ini, make tox running in parallel
  - Update setup.cfg
  - Update CONTRIBUTION.rst instructions

* Add filter warnings comment.

* Fix utils tests.

* Set Python version for QA job.

* Run tests via 'make test'.

* TH: no `self.observed` needed if they already have special  in-lieus

* TH: adjust this for coverall tests

* docstring fix

* TH: Thai lunar calendar now works up to 1941, all trigger now starts in 1941

* TH: test case refractor + extend checks to 2030

Individual Holiday's test case:

- assertNoHoliday 1 year prior
- assertHoliday while exists
- assertNoHoliday 1 year post

- asserNoHoliday for holidays_no_observed for 2010-2030

* TH: Buddhist holiday extended testcases, applying suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Tests update

* Update .pre-commit-config.yaml and tox.ini.

* Fix imports.

* Botswana observed holidays performance optimization

* Burundi observed holidays performance optimization

* Ukraine observed holidays performance optimization

* TH: remove `_en` suffix, `__init__(self, **kwargs):`

* TH: code improvements suggestions from @arkid15r

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: remove financial holiday stubs (this will be its own thing later)

* TH: move sources to 2nd row, `_ThaiLuniSolar` is now in util.py

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: add Atthami Bucha and Ok Phansa support for

* TH: fixed double `raeknakhwan` oversight

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `_ThaiLuniSolar` either returns date-type or None

* TH: `add_holiday` --> `_add_with_observed` for unified wording

* TH: `KJhellico`'s suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Fix merge issues.

* TH: applying `arkid15r` 's suggestions

- Simplified __init__ section for Thailand's, removed for _ThaiLuniSolar
- Simplified _ThaiLuniSolar holiday codes
- _ThaiLuniSolar's comment are now docstrings
- Move all Thailand's holiday references to above limitations' section
- Remove Thailand's duplicate date checks (with TODO comments instead)
- Thailand's In Line comments are also moved to each holiday's header for better readability

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: in-line single instance holidays

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: forgot to re-sort this, oof

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: fixed duplicate var, other improvements

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: clean up comments

* TH: back to `@lru_cache()` again

* Simplify test classes setup.
Update documentation.

* Exclude tests from the MANIFEST.in.

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Add United States Minor Outlying Islands (ISO-3666-2 code US-UM) (#940)

* ISO 3166-1 for US subdivisions (#941)

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>

* Add International Women's Day for DE-MV (#936)

* Add internationaler Frauentag for DE-MV

* Remove trailing whitespace

* Remove .gitpod.yml

* Add .gitpod.yml to .gitignore

* Add tests for Frauentag in DE-MV

* CHANGES sync

* Return `None` explicitly. (#935)

* CHANGES sync

* Rework i18n.

* Update pre-commit settings.

* Fix Thailand related changes coverage decrease.

* Fix naming and minor issues in .pot files generator.

* Update translations.

* Add final fixes.

* Add additional cases.

* TH: additional testcases for the rest of Thai Lunar Holidays

* Fix Ukraine tests

* Fix ordering.

* Add missing cases.

* Rename dev env setup target.

* Suppress warnings for tests.

* Poland:
- added historical holidays
- added Ukrainian translation
- refactored tests

* header fix

* Optimize observed holidays for Mozambique, Namibia, Zambia, Zimbabwe

* Added test for Ukrainian

* Update Albania observed holidays

* National Day for Truth and Reconciliation in British Columbia (Canada)

* Optimize observed holidays for Angola, Eswatini, Kazakhstan, Kenya, Malawi, Singapore, South Africa

* fix

Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>

* Localize ascii incompatible countries.
Add en_US localizatin for:
  - Armenia
  - Belarus
  - Bulgaria
  - Canada
  - Cyprus
  - Ethiopia
  - Georgia
  - Greece
  - Japan
  - Russia
  - Serbia
Update po generation files script.
Update MANIFEST.in.
Update README.rst.
Fix packaging.

* Fix headers.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Fix mo cleanup process.

* Fix compatibility issue.

* Fix .po files related issues.

* Add .mo files generator. Rework `TestCase` base class l10n handling.

* Update Makefile.

* Re-enable fallback translation.

* Fix minor test issues.

* Update PR template.

* Update CHANGES.

* Update version format.

* Update CHANGES

* Bump mypy version. (#970)

* Fix readthedocs.io build: (#973)

- Add .readthedocs.yaml.
  - Update .gitignore.
  - Update .pre-commit-config.yaml.
  - Update Makefile.
  - Update tox.ini.

* Update CHANGES.

* Update CHANGES

---------

Co-authored-by: delaosa <delaosa@gmail.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: ~Jhellico <jhellico@gmail.com>
Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Mike Borsetti <mike@borsetti.com>
Co-authored-by: Mike Borsetti <26698111+mborsetti@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>
Co-authored-by: Alexander Schulze <alexanderschulze@users.noreply.github.com>
@arkid15r arkid15r mentioned this pull request Feb 23, 2023
arkid15r added a commit that referenced this pull request Feb 23, 2023
* Replace `relativedelta` with `timedelta` for days offset calculation.

* Replace `relativedelta` with `timedelta` for days offset calculation.

* update spain.py with changes for year 2023

* update test_spain.py

* update test_spain.py

* update test_spain.py

* update test_spain.py

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Import timedelta as td.

* Import timedelta as td.

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Update holidays/countries/spain.py

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Montenegro optimization

* Add initial PR template.

* Update template.

* Update template.

* Change the template.

* add docstring with reference to Spain

* update Spain tests

* remove unused constants

* Add commnent with reference to Spain

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Init v.0.20 beta.

* Upgrade dependency: change black version from 22.12.0 to 23.1.0.

* Change holiday name separator from ", " to "; ".

* Update Australia holidays: fix 2020 QLD holidays.

* Jamaica holidays update

* Bosnia and Herzegovina holidays update

* Simplify if/else statement.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Bolivia holidays update and refactoring

* Panama holidays added

* Refactor days offset calculation for recently added countries

* Change some of common.TestCase methods behavior:
  - `TestCase::assertHolidayName
  - `TestCase::assertHolidaysName`
  - `TestCase::assertNoHolidayName`

* Cuba holidays refactoring

* Hong Kong fix

* Thai Lunar Calendar added, exact start of holidays for historic use, refs, etc.

* In-code comment improvements for readability

* Add contact info in case future changes are needed

* Fixed syntax error

* TH Special Holidays code improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH in lieu holiday trigger refactor

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: turns out <= <= is now a thing

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH testcases updated

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: case switch for standardizaton

* TH autoformatting from running `tox`

* TH: E266 comment block format adherence

* TH: E501 line too long format adherence (except link and Thai date names for now)

* TH: E501 cleanups. other final checks (for now)

* TH Sort testcase date

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Added tests for Thailand

* TH fixed Visakha Bucha trigger

* TH fixed wording, add missing special election holiday

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH fixes New Year's Eve (in lieu)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH  Songkran special in lieu, fixes Queen Sirikit's bday error

No, you cannot simply changes your own birthday lmao, but the case is indeed correct for Mother's Day

* TH Asarnha-Buddhist Lent Day in lieu fixes

* TH: holiday limiter is ; not , (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: holiday limiter is ; not , (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (3)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (4)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove useless recursive call for `add_holiday`

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (5)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: add missing `self.observed`, remove all defunct codes

* TH: further simplify Asarnha Bucha trigger

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Burundi holidays refactoring

* Fix Islamic holidays calculation
- fix for holidays that happen twice in a Gregorian year (primarily islamic New Year)
- years range checking more strictly

* Update environment:
  - Add Makefile, wrap common commands
  - Move all requirements file to `requirements` directory
  - Move tests from `test` to `tests` directory
  - Introduce `pytest-xdist`, make pytest running in parallel
  - Add local pre-push hook for tests
  - Format ci-cd.yml
  - Clean up pyproject.toml
  - Update tox.ini, make tox running in parallel
  - Update setup.cfg
  - Update CONTRIBUTION.rst instructions

* Add filter warnings comment.

* Fix utils tests.

* Set Python version for QA job.

* Run tests via 'make test'.

* TH: no `self.observed` needed if they already have special  in-lieus

* TH: adjust this for coverall tests

* docstring fix

* TH: Thai lunar calendar now works up to 1941, all trigger now starts in 1941

* TH: test case refractor + extend checks to 2030

Individual Holiday's test case:

- assertNoHoliday 1 year prior
- assertHoliday while exists
- assertNoHoliday 1 year post

- asserNoHoliday for holidays_no_observed for 2010-2030

* TH: Buddhist holiday extended testcases, applying suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Tests update

* Update .pre-commit-config.yaml and tox.ini.

* Fix imports.

* Botswana observed holidays performance optimization

* Burundi observed holidays performance optimization

* Ukraine observed holidays performance optimization

* TH: remove `_en` suffix, `__init__(self, **kwargs):`

* TH: code improvements suggestions from @arkid15r

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: remove financial holiday stubs (this will be its own thing later)

* TH: move sources to 2nd row, `_ThaiLuniSolar` is now in util.py

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: add Atthami Bucha and Ok Phansa support for

* TH: fixed double `raeknakhwan` oversight

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `_ThaiLuniSolar` either returns date-type or None

* TH: `add_holiday` --> `_add_with_observed` for unified wording

* TH: `KJhellico`'s suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Fix merge issues.

* TH: applying `arkid15r` 's suggestions

- Simplified __init__ section for Thailand's, removed for _ThaiLuniSolar
- Simplified _ThaiLuniSolar holiday codes
- _ThaiLuniSolar's comment are now docstrings
- Move all Thailand's holiday references to above limitations' section
- Remove Thailand's duplicate date checks (with TODO comments instead)
- Thailand's In Line comments are also moved to each holiday's header for better readability

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: in-line single instance holidays

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: forgot to re-sort this, oof

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: fixed duplicate var, other improvements

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: clean up comments

* TH: back to `@lru_cache()` again

* Simplify test classes setup.
Update documentation.

* Exclude tests from the MANIFEST.in.

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Add United States Minor Outlying Islands (ISO-3666-2 code US-UM) (#940)

* ISO 3166-1 for US subdivisions (#941)

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>

* Add International Women's Day for DE-MV (#936)

* Add internationaler Frauentag for DE-MV

* Remove trailing whitespace

* Remove .gitpod.yml

* Add .gitpod.yml to .gitignore

* Add tests for Frauentag in DE-MV

* CHANGES sync

* Return `None` explicitly. (#935)

* CHANGES sync

* Rework i18n.

* Update pre-commit settings.

* Fix Thailand related changes coverage decrease.

* Fix naming and minor issues in .pot files generator.

* Update translations.

* Add final fixes.

* Add additional cases.

* TH: additional testcases for the rest of Thai Lunar Holidays

* Fix Ukraine tests

* Fix ordering.

* Add missing cases.

* Rename dev env setup target.

* Suppress warnings for tests.

* Poland:
- added historical holidays
- added Ukrainian translation
- refactored tests

* header fix

* Optimize observed holidays for Mozambique, Namibia, Zambia, Zimbabwe

* Added test for Ukrainian

* Update Albania observed holidays

* National Day for Truth and Reconciliation in British Columbia (Canada)

* Optimize observed holidays for Angola, Eswatini, Kazakhstan, Kenya, Malawi, Singapore, South Africa

* fix

Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>

* Localize ascii incompatible countries.
Add en_US localizatin for:
  - Armenia
  - Belarus
  - Bulgaria
  - Canada
  - Cyprus
  - Ethiopia
  - Georgia
  - Greece
  - Japan
  - Russia
  - Serbia
Update po generation files script.
Update MANIFEST.in.
Update README.rst.
Fix packaging.

* Fix headers.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Fix mo cleanup process.

* Fix compatibility issue.

* Fix .po files related issues.

* Add .mo files generator. Rework `TestCase` base class l10n handling.

* Update Makefile.

* Re-enable fallback translation.

* Fix minor test issues.

* Update PR template.

* Update CHANGES.

* Update version format.

* Update CHANGES

* Bump mypy version. (#970)

* Fix readthedocs.io build: (#973)

- Add .readthedocs.yaml.
  - Update .gitignore.
  - Update .pre-commit-config.yaml.
  - Update Makefile.
  - Update tox.ini.

* Update CHANGES.

* Update CHANGES

* Update .rst files.

---------

Co-authored-by: delaosa <delaosa@gmail.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: ~Jhellico <jhellico@gmail.com>
Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Mike Borsetti <mike@borsetti.com>
Co-authored-by: Mike Borsetti <26698111+mborsetti@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>
Co-authored-by: Alexander Schulze <alexanderschulze@users.noreply.github.com>
arkid15r added a commit that referenced this pull request Feb 27, 2023
* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* update spain.py with changes for year 2023

* Update holidays/countries/spain.py

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Montenegro optimization

* Add initial PR template.

* Update template.

* Update template.

* Change the template.

* add docstring with reference to Spain

* update Spain tests

* remove unused constants

* Add commnent with reference to Spain

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Init v.0.20 beta.

* Upgrade dependency: change black version from 22.12.0 to 23.1.0.

* Change holiday name separator from ", " to "; ".

* Update Australia holidays: fix 2020 QLD holidays.

* Jamaica holidays update

* Bosnia and Herzegovina holidays update

* Simplify if/else statement.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Bolivia holidays update and refactoring

* Panama holidays added

* Refactor days offset calculation for recently added countries

* Change some of common.TestCase methods behavior:
  - `TestCase::assertHolidayName
  - `TestCase::assertHolidaysName`
  - `TestCase::assertNoHolidayName`

* Cuba holidays refactoring

* Hong Kong fix

* Thai Lunar Calendar added, exact start of holidays for historic use, refs, etc.

* In-code comment improvements for readability

* Add contact info in case future changes are needed

* Fixed syntax error

* TH Special Holidays code improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH in lieu holiday trigger refactor

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: turns out <= <= is now a thing

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH testcases updated

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: case switch for standardizaton

* TH autoformatting from running `tox`

* TH: E266 comment block format adherence

* TH: E501 line too long format adherence (except link and Thai date names for now)

* TH: E501 cleanups. other final checks (for now)

* TH Sort testcase date

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Added tests for Thailand

* TH fixed Visakha Bucha trigger

* TH fixed wording, add missing special election holiday

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH fixes New Year's Eve (in lieu)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH  Songkran special in lieu, fixes Queen Sirikit's bday error

No, you cannot simply changes your own birthday lmao, but the case is indeed correct for Mother's Day

* TH Asarnha-Buddhist Lent Day in lieu fixes

* TH: holiday limiter is ; not , (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: holiday limiter is ; not , (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (3)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (4)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove useless recursive call for `add_holiday`

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (5)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: add missing `self.observed`, remove all defunct codes

* TH: further simplify Asarnha Bucha trigger

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Burundi holidays refactoring

* Fix Islamic holidays calculation
- fix for holidays that happen twice in a Gregorian year (primarily islamic New Year)
- years range checking more strictly

* Update environment:
  - Add Makefile, wrap common commands
  - Move all requirements file to `requirements` directory
  - Move tests from `test` to `tests` directory
  - Introduce `pytest-xdist`, make pytest running in parallel
  - Add local pre-push hook for tests
  - Format ci-cd.yml
  - Clean up pyproject.toml
  - Update tox.ini, make tox running in parallel
  - Update setup.cfg
  - Update CONTRIBUTION.rst instructions

* Add filter warnings comment.

* Fix utils tests.

* Set Python version for QA job.

* Run tests via 'make test'.

* TH: no `self.observed` needed if they already have special  in-lieus

* TH: adjust this for coverall tests

* docstring fix

* TH: Thai lunar calendar now works up to 1941, all trigger now starts in 1941

* TH: test case refractor + extend checks to 2030

Individual Holiday's test case:

- assertNoHoliday 1 year prior
- assertHoliday while exists
- assertNoHoliday 1 year post

- asserNoHoliday for holidays_no_observed for 2010-2030

* TH: Buddhist holiday extended testcases, applying suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Tests update

* Update .pre-commit-config.yaml and tox.ini.

* Fix imports.

* Botswana observed holidays performance optimization

* Burundi observed holidays performance optimization

* Ukraine observed holidays performance optimization

* TH: remove `_en` suffix, `__init__(self, **kwargs):`

* TH: code improvements suggestions from @arkid15r

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: remove financial holiday stubs (this will be its own thing later)

* TH: move sources to 2nd row, `_ThaiLuniSolar` is now in util.py

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: add Atthami Bucha and Ok Phansa support for

* TH: fixed double `raeknakhwan` oversight

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `_ThaiLuniSolar` either returns date-type or None

* TH: `add_holiday` --> `_add_with_observed` for unified wording

* TH: `KJhellico`'s suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Fix merge issues.

* TH: applying `arkid15r` 's suggestions

- Simplified __init__ section for Thailand's, removed for _ThaiLuniSolar
- Simplified _ThaiLuniSolar holiday codes
- _ThaiLuniSolar's comment are now docstrings
- Move all Thailand's holiday references to above limitations' section
- Remove Thailand's duplicate date checks (with TODO comments instead)
- Thailand's In Line comments are also moved to each holiday's header for better readability

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: in-line single instance holidays

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: forgot to re-sort this, oof

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: fixed duplicate var, other improvements

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: clean up comments

* TH: back to `@lru_cache()` again

* Simplify test classes setup.
Update documentation.

* Exclude tests from the MANIFEST.in.

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Add United States Minor Outlying Islands (ISO-3666-2 code US-UM) (#940)

* ISO 3166-1 for US subdivisions (#941)

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>

* Add International Women's Day for DE-MV (#936)

* Add internationaler Frauentag for DE-MV

* Remove trailing whitespace

* Remove .gitpod.yml

* Add .gitpod.yml to .gitignore

* Add tests for Frauentag in DE-MV

* CHANGES sync

* Return `None` explicitly. (#935)

* CHANGES sync

* Rework i18n.

* Update pre-commit settings.

* Fix Thailand related changes coverage decrease.

* Fix naming and minor issues in .pot files generator.

* Update translations.

* Add final fixes.

* Add additional cases.

* TH: additional testcases for the rest of Thai Lunar Holidays

* Fix Ukraine tests

* Fix ordering.

* Add missing cases.

* Rename dev env setup target.

* Suppress warnings for tests.

* Poland:
- added historical holidays
- added Ukrainian translation
- refactored tests

* header fix

* Optimize observed holidays for Mozambique, Namibia, Zambia, Zimbabwe

* Added test for Ukrainian

* Update Albania observed holidays

* National Day for Truth and Reconciliation in British Columbia (Canada)

* Optimize observed holidays for Angola, Eswatini, Kazakhstan, Kenya, Malawi, Singapore, South Africa

* fix

Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>

* Localize ascii incompatible countries.
Add en_US localizatin for:
  - Armenia
  - Belarus
  - Bulgaria
  - Canada
  - Cyprus
  - Ethiopia
  - Georgia
  - Greece
  - Japan
  - Russia
  - Serbia
Update po generation files script.
Update MANIFEST.in.
Update README.rst.
Fix packaging.

* Fix headers.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Fix mo cleanup process.

* Fix compatibility issue.

* Fix .po files related issues.

* Add .mo files generator. Rework `TestCase` base class l10n handling.

* Update Makefile.

* Re-enable fallback translation.

* Fix minor test issues.

* Update PR template.

* Update CHANGES.

* Update version format.

* Update CHANGES

* Bump mypy version. (#970)

* Fix readthedocs.io build: (#973)

- Add .readthedocs.yaml.
  - Update .gitignore.
  - Update .pre-commit-config.yaml.
  - Update Makefile.
  - Update tox.ini.

* Update CHANGES.

* Added Peru localization (es, en_US, uk)

* Update CHANGES

* Update .rst files.

* Add Thailand holidays localization: en_US, th (#946)

* TH: modify Thailand code to support i18n

* TH: applying `KJhellico`'s suggestion, more accurate titles

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: non-ASCII `msgid` fixed

* TH: Thai translation localisations

* TH: fixed mismatch file title

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `set_locale` -> `set_language`

* TH: switch default loc to `th`

* TH: split string

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: adjust file description

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: adjust file description (2)

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: avoid explicit `# noqa: E501` usage

* TH: improved national day trigger

* TH: avoid explicit `# noqa: E501` for testcases

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Update Ireland holidays: St. Bridget's Day (#953)

* IE: Fixed St. Brigit's Day (Monday is the day itself, not `(observed)`)

Co-Authored-By: Kevin Gill <kevin@movieextras.ie>

* IE: applying code suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* IE: add testcase for St. Brigid's Day

* IE: [ ] --> ( )

Co-authored-by: Arkadii Yakovets <ark@cho.red>

---------

Co-authored-by: Kevin Gill <kevin@movieextras.ie>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Update Azerbaijan holidays (#961)

* Update Saudi Arabia holidays (#962)

* Malaysia observed holidays performance optimization (#963)

* Update Japan holidays localization: en_US (#964)

* Fix Japan en_US translation

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

---------

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Added Colombia localization (es, en_US, uk) (#965)

* Added Monaco localization (en_US, fr, uk) (#966)

* Update Argentina holidays, added Ukrainian localization (#968)

* Refactor calendars: extract from `utils.py` to `calendars.py`. (#969)

* Optimize Nigeria observed holidays

---------

Co-authored-by: delaosa <delaosa@gmail.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>
Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
Co-authored-by: Mike Borsetti <mike@borsetti.com>
Co-authored-by: Mike Borsetti <26698111+mborsetti@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>
Co-authored-by: Alexander Schulze <alexanderschulze@users.noreply.github.com>
Co-authored-by: Kevin Gill <kevin@movieextras.ie>
arkid15r added a commit that referenced this pull request Mar 22, 2023
* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Bolivia holidays update and refactoring

* Panama holidays added

* Refactor days offset calculation for recently added countries

* Change some of common.TestCase methods behavior:
  - `TestCase::assertHolidayName
  - `TestCase::assertHolidaysName`
  - `TestCase::assertNoHolidayName`

* Cuba holidays refactoring

* Hong Kong fix

* Thai Lunar Calendar added, exact start of holidays for historic use, refs, etc.

* In-code comment improvements for readability

* Add contact info in case future changes are needed

* Fixed syntax error

* TH Special Holidays code improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH in lieu holiday trigger refactor

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: turns out <= <= is now a thing

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH testcases updated

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: case switch for standardizaton

* TH autoformatting from running `tox`

* TH: E266 comment block format adherence

* TH: E501 line too long format adherence (except link and Thai date names for now)

* TH: E501 cleanups. other final checks (for now)

* TH Sort testcase date

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Added tests for Thailand

* TH fixed Visakha Bucha trigger

* TH fixed wording, add missing special election holiday

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH fixes New Year's Eve (in lieu)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH  Songkran special in lieu, fixes Queen Sirikit's bday error

No, you cannot simply changes your own birthday lmao, but the case is indeed correct for Mother's Day

* TH Asarnha-Buddhist Lent Day in lieu fixes

* TH: holiday limiter is ; not , (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: holiday limiter is ; not , (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (1)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (3)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (4)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove useless recursive call for `add_holiday`

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: remove redundant function (5)

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: add missing `self.observed`, remove all defunct codes

* TH: further simplify Asarnha Bucha trigger

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: improve test code (2)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Burundi holidays refactoring

* Fix Islamic holidays calculation
- fix for holidays that happen twice in a Gregorian year (primarily islamic New Year)
- years range checking more strictly

* Update environment:
  - Add Makefile, wrap common commands
  - Move all requirements file to `requirements` directory
  - Move tests from `test` to `tests` directory
  - Introduce `pytest-xdist`, make pytest running in parallel
  - Add local pre-push hook for tests
  - Format ci-cd.yml
  - Clean up pyproject.toml
  - Update tox.ini, make tox running in parallel
  - Update setup.cfg
  - Update CONTRIBUTION.rst instructions

* Add filter warnings comment.

* Fix utils tests.

* Set Python version for QA job.

* Run tests via 'make test'.

* TH: no `self.observed` needed if they already have special  in-lieus

* TH: adjust this for coverall tests

* docstring fix

* TH: Thai lunar calendar now works up to 1941, all trigger now starts in 1941

* TH: test case refractor + extend checks to 2030

Individual Holiday's test case:

- assertNoHoliday 1 year prior
- assertHoliday while exists
- assertNoHoliday 1 year post

- asserNoHoliday for holidays_no_observed for 2010-2030

* TH: Buddhist holiday extended testcases, applying suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Tests update

* Update .pre-commit-config.yaml and tox.ini.

* Fix imports.

* Botswana observed holidays performance optimization

* Burundi observed holidays performance optimization

* Ukraine observed holidays performance optimization

* TH: remove `_en` suffix, `__init__(self, **kwargs):`

* TH: code improvements suggestions from @arkid15r

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: remove financial holiday stubs (this will be its own thing later)

* TH: move sources to 2nd row, `_ThaiLuniSolar` is now in util.py

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: add Atthami Bucha and Ok Phansa support for

* TH: fixed double `raeknakhwan` oversight

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `_ThaiLuniSolar` either returns date-type or None

* TH: `add_holiday` --> `_add_with_observed` for unified wording

* TH: `KJhellico`'s suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* Fix merge issues.

* TH: applying `arkid15r` 's suggestions

- Simplified __init__ section for Thailand's, removed for _ThaiLuniSolar
- Simplified _ThaiLuniSolar holiday codes
- _ThaiLuniSolar's comment are now docstrings
- Move all Thailand's holiday references to above limitations' section
- Remove Thailand's duplicate date checks (with TODO comments instead)
- Thailand's In Line comments are also moved to each holiday's header for better readability

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: in-line single instance holidays

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: forgot to re-sort this, oof

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: fixed duplicate var, other improvements

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* TH: clean up comments

* TH: back to `@lru_cache()` again

* Simplify test classes setup.
Update documentation.

* Exclude tests from the MANIFEST.in.

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Add United States Minor Outlying Islands (ISO-3666-2 code US-UM) (#940)

* ISO 3166-1 for US subdivisions (#941)

* Add Marshall Islands (ISO-3666-1 code MH)

* Fix Northern Mariana Islands (ISO-3666-2 code US-MP)

* Adds ISO 3166-1 entries for countries that are also ISO 3166-2 subdivisions of the United States

* isort fix

* add TODO

* Lost some pieces on the way...

* MH additional testing for coverall

* Update holidays/countries/united_states.py

Thanks...no idea what's happening with snippets of code!

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: dr-prodigy <dr.prodigy.github@gmail.com>

* Add International Women's Day for DE-MV (#936)

* Add internationaler Frauentag for DE-MV

* Remove trailing whitespace

* Remove .gitpod.yml

* Add .gitpod.yml to .gitignore

* Add tests for Frauentag in DE-MV

* CHANGES sync

* Return `None` explicitly. (#935)

* CHANGES sync

* Rework i18n.

* Update pre-commit settings.

* Fix Thailand related changes coverage decrease.

* Fix naming and minor issues in .pot files generator.

* Update translations.

* Add final fixes.

* Add additional cases.

* TH: additional testcases for the rest of Thai Lunar Holidays

* Fix Ukraine tests

* Fix ordering.

* Add missing cases.

* Rename dev env setup target.

* Suppress warnings for tests.

* Poland:
- added historical holidays
- added Ukrainian translation
- refactored tests

* header fix

* Optimize observed holidays for Mozambique, Namibia, Zambia, Zimbabwe

* Added test for Ukrainian

* Update Albania observed holidays

* National Day for Truth and Reconciliation in British Columbia (Canada)

* Optimize observed holidays for Angola, Eswatini, Kazakhstan, Kenya, Malawi, Singapore, South Africa

* fix

Co-authored-by: PPsyrius <19505219+PPsyrius@users.noreply.github.com>

* Localize ascii incompatible countries.
Add en_US localizatin for:
  - Armenia
  - Belarus
  - Bulgaria
  - Canada
  - Cyprus
  - Ethiopia
  - Georgia
  - Greece
  - Japan
  - Russia
  - Serbia
Update po generation files script.
Update MANIFEST.in.
Update README.rst.
Fix packaging.

* Fix headers.

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Fix mo cleanup process.

* Fix compatibility issue.

* Fix .po files related issues.

* Add .mo files generator. Rework `TestCase` base class l10n handling.

* Update Makefile.

* Re-enable fallback translation.

* Fix minor test issues.

* Update PR template.

* Update CHANGES.

* Update version format.

* Update CHANGES

* Bump mypy version. (#970)

* Fix readthedocs.io build: (#973)

- Add .readthedocs.yaml.
  - Update .gitignore.
  - Update .pre-commit-config.yaml.
  - Update Makefile.
  - Update tox.ini.

* Update CHANGES.

* Added Peru localization (es, en_US, uk)

* Update CHANGES

* Update .rst files.

* Add Thailand holidays localization: en_US, th (#946)

* TH: modify Thailand code to support i18n

* TH: applying `KJhellico`'s suggestion, more accurate titles

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: non-ASCII `msgid` fixed

* TH: Thai translation localisations

* TH: fixed mismatch file title

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* TH: `set_locale` -> `set_language`

* TH: switch default loc to `th`

* TH: split string

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: adjust file description

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: adjust file description (2)

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* TH: avoid explicit `# noqa: E501` usage

* TH: improved national day trigger

* TH: avoid explicit `# noqa: E501` for testcases

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Update Ireland holidays: St. Bridget's Day (#953)

* IE: Fixed St. Brigit's Day (Monday is the day itself, not `(observed)`)

Co-Authored-By: Kevin Gill <kevin@movieextras.ie>

* IE: applying code suggestions

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* IE: add testcase for St. Brigid's Day

* IE: [ ] --> ( )

Co-authored-by: Arkadii Yakovets <ark@cho.red>

---------

Co-authored-by: Kevin Gill <kevin@movieextras.ie>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Update Azerbaijan holidays (#961)

* Update Saudi Arabia holidays (#962)

* Malaysia observed holidays performance optimization (#963)

* Update Japan holidays localization: en_US (#964)

* Fix Japan en_US translation

* fix

Co-authored-by: Arkadii Yakovets <ark@cho.red>

---------

Co-authored-by: Arkadii Yakovets <ark@cho.red>

* Added Colombia localization (es, en_US, uk) (#965)

* Added Monaco localization (en_US, fr, uk) (#966)

* Update Argentina holidays, added Ukrainian localization (#968)

* Refactor calendars: extract from `utils.py` to `calendars.py`. (#969)

* Thai loc for Canadian holidays

* Update CHANGES.

* Improve Argentina holidays (#988)

* Initial ARG revamped logic + testcases

* AR: Ukranian Loc Part 1

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: Ukranian Loc Part 2

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: en_US Loc Part 1

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: Ukranian Loc Part 3

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: improve trigger Part 1

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: improve test case

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: Veterans Day logic improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: Belgrano/Flag Day logic improvements

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: San Martin Day special case for 2011 check

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* AR:  Malvinas Sovereignty Day logic improvements

Co-Authored-By: ~Jhellico <KJhellico@users.noreply.github.com>

* AR: Implemented Arkid15r's suggestions

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* AR: Stricter PEP 8 Adherance

Co-Authored-By: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Co-authored-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

* Added functions for relative weekdays calculation (#989)

* Add Chile holidays localization: en_US, es, uk (#990)

* Clean up tests module loading. (#992)

Remove unused code from `tests/countries/__init__.py`.

* Refactor `HolidayBase::get_named` (#991)

* Refactor `HolidayBase::get_named`:
  - Add `lookup` parameter.
  - Add `contains/iexact/icontains/iexact` lookup types.
  - Keep the current behavior with `icontains` as default lookup type.

* Optimize holiday name lookups.
Use exact lookup for holiday name assertions.

* Use the built-in library for time zone functions (#993)

* Use the built-in library for time zone functions

* Improve coverage

* Extend to JP

* Fixed tox.ini typo (#994)

* Clean up Thailand localization and in-line code comments (#995)

* Cleans up TH documentation & localization files

* TH: Stricter PEP 8 Adherance

* Refactored Malaysia tests (#996)

* Update PR template. (#997)

* Add tox-ini-fmt to .pre-commit-config.yaml (#999)

* Add tox-ini-fmt to .pre-commit-config.yaml.

* Bump the version.

* Fixed New Year observed calculation for NYSE (#1000)

* Update CHANGES.

* Simplify l10n business logic.

* Migrate more countries.

* Update holiday groups PR.

* Update l10n documentation.

* Update Lithuania and Ukraine.

* Rework l10n.

* Update l10n documentation.
Revert Paraguay changes.

* Update PY `_add_holiday`.

* Use gettext as `tr`.

* Use `HolidayBase::_add_holiday` in more countries.

* Clean up more countries.

* Update docs.

* Update holidays/countries/canada.py

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>

* Check Cuba and Monaco cases.

---------

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants