Skip to content

Commit

Permalink
Merge pull request #1833 from vacanza/dev
Browse files Browse the repository at this point in the history
v0.51
  • Loading branch information
arkid15r authored Jun 17, 2024
2 parents 7608166 + 4e5932c commit 8980a47
Show file tree
Hide file tree
Showing 82 changed files with 1,026 additions and 2,058 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.head_ref || github.ref }}

jobs:
pre-commit:
Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
matrix:
os:
- macOS-latest
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
Expand Down Expand Up @@ -85,12 +85,10 @@ jobs:
run: |
make test
- name: Upload coverage
uses: coverallsapp/github-action@v2
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.4.1
with:
flag-name: tests-${{ matrix.python-version }}-${{ matrix.os }}
parallel: true
path-to-lcov: coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}

build:
name: Build distribution
Expand Down Expand Up @@ -123,24 +121,14 @@ jobs:
name: dist
path: dist

finish-coveralls:
name: Finish coveralls
needs: test
runs-on: ubuntu-latest
steps:
- name: Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true

test-build:
name: Test build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os:
- macOS-latest
- macos-latest
- ubuntu-latest
- windows-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*.pyc
build/*
coverage.lcov
coverage.xml
dist/
docs/build
docs/source/_autosummary
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- rst

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.4.9
hooks:
- id: ruff
- id: ruff-format
Expand Down
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Version 0.51
============

Released June 17, 2024

- Update Aruba and Curaçao holidays l10n (split locales) (#1827 by @KJhellico)
- Update Brazil holidays: add new Nov 20 holiday (#1832 by @KJhellico)
- Update CI/CD job concurrency (#1823 by @arkid15r)
- Update CI/CD job concurrency (#1830 by @arkid15r)
- Update README.rst (#1828 by @arkid15r)
- Update ruff configuration (#1819 by @arkid15r)
- Align India subdivisions with ISO 3166-2 (#1821 by @KJhellico)
- Migrate to codecov.io (#1818 by @arkid15r)
- Narrow down ignored warnings (#1816 by @arkid15r)

Version 0.50
============

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ snapshot:

test:
scripts/l10n/generate_mo_files.py
pytest --cov=. --cov-config=pyproject.toml --cov-report term --cov-report lcov --durations 10 --durations-min=0.75 --dist loadscope --no-cov-on-fail --numprocesses auto
pytest --cov=. --cov-config=pyproject.toml --cov-report term --cov-report xml --durations 10 --durations-min=0.75 --dist loadscope --no-cov-on-fail --numprocesses auto

tox:
tox --parallel auto
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ Quick Start
from datetime import date
import holidays
us_holidays = holidays.US() # this is a dict
us_holidays = holidays.US() # this is a dict-like object
# the below is the same, but takes a string:
us_holidays = holidays.country_holidays('US') # this is a dict
us_holidays = holidays.country_holidays('US') # this is a dict-like object
nyse_holidays = holidays.NYSE() # this is a dict
nyse_holidays = holidays.NYSE() # this is a dict-like object
# the below is the same, but takes a string:
nyse_holidays = holidays.financial_holidays('NYSE') # this is a dict
nyse_holidays = holidays.financial_holidays('NYSE') # this is a dict-like object
date(2015, 1, 1) in us_holidays # True
date(2015, 1, 2) in us_holidays # False
Expand Down Expand Up @@ -218,7 +218,7 @@ All other default values are highlighted with bold:
* - Aruba
- AW
-
- en_US, nl, **pap**, uk
- en_US, nl, **pap_AW**, uk
-
* - Australia
- AU
Expand Down Expand Up @@ -363,7 +363,7 @@ All other default values are highlighted with bold:
* - Curacao
- CW
-
- en_US, nl, **pap**, uk
- en_US, nl, **pap_CW**, uk
-
* - Cyprus
- CY
Expand Down Expand Up @@ -492,7 +492,7 @@ All other default values are highlighted with bold:
-
* - India
- IN
- States: AN, AP, AR, AS, BR, CG, CH, DD, DH, DL, GA, GJ, HP, HR, JH, JK, KA, KL, LA, LD, MH, ML, MN, MP, MZ, NL, OR, PB, PY, RJ, SK, TN, TR, TS, UK, UP, WB
- States: AN, AP, AR, AS, BR, CG, CH, DH, DL, GA, GJ, HP, HR, JH, JK, KA, KL, LA, LD, MH, ML, MN, MP, MZ, NL, OD, PB, PY, RJ, SK, TN, TR, TS, UK, UP, WB
-
-
* - Indonesia
Expand Down
2 changes: 1 addition & 1 deletion holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from holidays.registry import EntityLoader
from holidays.utils import *

__version__ = "0.50"
__version__ = "0.51"


EntityLoader.load("countries", globals())
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/aruba.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class Aruba(HolidayBase, ChristianHolidays, InternationalHolidays):
"""

country = "AW"
default_language = "pap"
supported_languages = ("en_US", "nl", "pap", "uk")
default_language = "pap_AW"
supported_languages = ("en_US", "nl", "pap_AW", "uk")

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, StaticHolidays):
# [1] https://en.wikipedia.org/wiki/Public_holidays_in_Azerbaijan
# [2] https://az.wikipedia.org/wiki/Az%C9%99rbaycan%C4%B1n_d%C3%B6vl%C9%99t_bayramlar%C4%B1_v%C9%99_x%C3%BCsusi_g%C3%BCnl%C9%99ri # noqa: E501
# [2] https://az.wikipedia.org/wiki/Az%C9%99rbaycan%C4%B1n_d%C3%B6vl%C9%99t_bayramlar%C4%B1_v%C9%99_x%C3%BCsusi_g%C3%BCnl%C9%99ri
# [3] https://www.sosial.gov.az/en/prod-calendar

country = "AZ"
Expand Down
8 changes: 4 additions & 4 deletions holidays/countries/bahamas.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class Bahamas(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
"""
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_the_Bahamas
- https://laws.bahamas.gov.bs/cms/images/LEGISLATION/PRINCIPAL/1938/1938-0015/PublicHolidaysAct_1.pdf # noqa: E501
- https://laws.bahamas.gov.bs/cms/images/LEGISLATION/PRINCIPAL/2013/2013-0040/MajorityRulePublicHolidayAct2013_1.pdf # noqa: E501
- https://laws.bahamas.gov.bs/cms/images/LEGISLATION/PRINCIPAL/2013/2013-0009/RandolFawkesLabourDayAct2013_1.pdf # noqa: E501
- https://laws.bahamas.gov.bs/cms/images/LEGISLATION/PRINCIPAL/1938/1938-0015/PublicHolidaysAct_1.pdf
- https://laws.bahamas.gov.bs/cms/images/LEGISLATION/PRINCIPAL/2013/2013-0040/MajorityRulePublicHolidayAct2013_1.pdf
- https://laws.bahamas.gov.bs/cms/images/LEGISLATION/PRINCIPAL/2013/2013-0009/RandolFawkesLabourDayAct2013_1.pdf
- http://www.tribune242.com/news/2013/oct/12/national-heroes-day-formally-established/
- https://eleutheranews.com/?p=3594
Checked With:
Expand Down Expand Up @@ -127,7 +127,7 @@ class BHS(Bahamas):

class BahamasStaticHolidays:
special_public_holidays = {
# https://www.bahamas.gov.bs/wps/portal/public/gov/government/notices/national%20holiday%2019th%20september/ # noqa: E501
# https://www.bahamas.gov.bs/wps/portal/public/gov/government/notices/national%20holiday%2019th%20september/
2022: (SEP, 19, "State Funeral of Queen Elizabeth II"),
}

Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/bangladesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Bangladesh(HolidayBase, InternationalHolidays):
"""
References:
- https://mopa.gov.bd/sites/default/files/files/mopa.gov.bd/public_holiday/61c35b73_e335_462a_9bcf_4695b23b6d82/reg4-2019-212.PDF # noqa: E501
- https://mopa.gov.bd/sites/default/files/files/mopa.gov.bd/public_holiday/61c35b73_e335_462a_9bcf_4695b23b6d82/reg4-2019-212.PDF
- https://en.wikipedia.org/wiki/Public_holidays_in_Bangladesh
"""

Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
- http://www.belarus.by/en/about-belarus/national-holidays
- http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm
- http://president.gov.by/uploads/documents/2019/464uk.pdf
- https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B5%D0%BB%D0%BE%D1%80%D1%83%D1%81%D1%81%D0%B8%D0%B8 # noqa: E501
- https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B5%D0%BB%D0%BE%D1%80%D1%83%D1%81%D1%81%D0%B8%D0%B8
"""

country = "BY"
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/belize.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Belize(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
- https://en.wikipedia.org/wiki/Public_holidays_in_Belize
- http://www.belizelaw.org/web/lawadmin/PDF%20files/cap289.pdf
- https://www.pressoffice.gov.bz/public-and-bank-holidays-2022-updated/
- https://www.pressoffice.gov.bz/government-of-belize-establishes-new-public-and-bank-holidays/ # noqa: E501
- https://www.pressoffice.gov.bz/government-of-belize-establishes-new-public-and-bank-holidays/
"""

country = "BZ"
Expand Down
22 changes: 14 additions & 8 deletions holidays/countries/brazil.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ class Brazil(HolidayBase, ChristianHolidays, InternationalHolidays):
"""
References:
- https://pt.wikipedia.org/wiki/Feriados_no_Brasil
- `Decreto n. 155-B, de 14.01.1890 <https://www2.camara.leg.br/legin/fed/decret/1824-1899/decreto-155-b-14-janeiro-1890-517534-publicacaooriginal-1-pe.html>`_ # noqa: E501
- `Decreto n. 19.488, de 15.12.1930 <https://www2.camara.leg.br/legin/fed/decret/1930-1939/decreto-19488-15-dezembro-1930-508040-republicacao-85201-pe.html>`_ # noqa: E501
- `Decreto n. 155-B, de 14.01.1890 <https://www2.camara.leg.br/legin/fed/decret/1824-1899/decreto-155-b-14-janeiro-1890-517534-publicacaooriginal-1-pe.html>`_
- `Decreto n. 19.488, de 15.12.1930 <https://www2.camara.leg.br/legin/fed/decret/1930-1939/decreto-19488-15-dezembro-1930-508040-republicacao-85201-pe.html>`_
- `Lei n. 14.759/23 <https://www2.camara.leg.br/legin/fed/lei/2023/lei-14759-21-dezembro-2023-795091-publicacaooriginal-170522-pl.html>`_
"""

country = "BR"
Expand Down Expand Up @@ -109,6 +110,10 @@ def _populate_public_holidays(self):
# Republic Proclamation Day.
self._add_holiday_nov_15("Proclamação da República")

if self._year >= 2024:
# National Day of Zumbi and Black Awareness.
self._add_holiday_nov_20("Dia Nacional de Zumbi e da Consciência Negra")

if self._year >= 1922:
# Christmas Day.
self._add_christmas_day("Natal")
Expand Down Expand Up @@ -179,8 +184,9 @@ def _populate_subdiv_al_public_holidays(self):
# Political Emancipation of Alagoas.
self._add_holiday_sep_16("Emancipação Política de Alagoas")

# Black Awareness Day.
self._add_holiday_nov_20("Consciência Negra")
if self._year <= 2023:
# Black Awareness Day.
self._add_holiday_nov_20("Consciência Negra")

if self._year >= 2013:
self._add_holiday_nov_30("Dia do Evangélico")
Expand All @@ -189,7 +195,7 @@ def _populate_subdiv_am_public_holidays(self):
# Elevation of Amazonas to province.
self._add_holiday_sep_5("Elevação do Amazonas à categoria de província")

if self._year >= 2010:
if 2010 <= self._year <= 2023:
self._add_holiday_nov_20("Consciência Negra")

def _populate_subdiv_ap_public_holidays(self):
Expand All @@ -204,7 +210,7 @@ def _populate_subdiv_ap_public_holidays(self):
# Creation of the Federal Territory.
self._add_holiday_sep_13("Criação do Território Federal")

if self._year >= 2008:
if 2008 <= self._year <= 2023:
self._add_holiday_nov_20("Consciência Negra")

def _populate_subdiv_ba_public_holidays(self):
Expand Down Expand Up @@ -252,7 +258,7 @@ def _populate_subdiv_ms_public_holidays(self):
self._add_holiday_oct_11("Criação do Estado")

def _populate_subdiv_mt_public_holidays(self):
if self._year >= 2003:
if 2003 <= self._year <= 2023:
self._add_holiday_nov_20("Consciência Negra")

def _populate_subdiv_pa_public_holidays(self):
Expand Down Expand Up @@ -281,7 +287,7 @@ def _populate_subdiv_rj_public_holidays(self):
# Saint George's Day.
self._add_saint_georges_day("São Jorge")

if self._year >= 2002:
if 2002 <= self._year <= 2023:
self._add_holiday_nov_20("Consciência Negra")

def _populate_subdiv_rn_public_holidays(self):
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/brunei.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Brunei(
References:
- Based on: http://www.labour.gov.bn/Lists/Upcomming%20events/AllItems.aspx
http://www.labour.gov.bn/Download/GUIDE%20TO%20BRUNEI%20EMPLOYMENT%20LAWS%20-%20english%20version-3.pdf # noqa: E501
http://www.labour.gov.bn/Download/GUIDE%20TO%20BRUNEI%20EMPLOYMENT%20LAWS%20-%20english%20version-3.pdf
- Checked with: https://asean.org/wp-content/uploads/2021/12/ASEAN-National-Holidays-2022.pdf
https://asean.org/wp-content/uploads/2022/12/ASEAN-Public-Holidays-2023.pdf
https://www.timeanddate.com/holidays/brunei/
Expand Down
6 changes: 3 additions & 3 deletions holidays/countries/canada.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
"""
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_Canada
- https://web.archive.org/web/20130703014214/http://www.hrsdc.gc.ca/eng/labour/overviews/employment_standards/holidays.shtml # noqa: E501
- https://web.archive.org/web/20130703014214/http://www.hrsdc.gc.ca/eng/labour/overviews/employment_standards/holidays.shtml
- https://www.alberta.ca/alberta-general-holidays
- https://www2.gov.bc.ca/gov/content/employment-business/employment-standards-advice/employment-standards/statutory-holidays # noqa: E501
- https://www2.gov.bc.ca/gov/content/employment-business/employment-standards-advice/employment-standards/statutory-holidays
- http://web2.gov.mb.ca/laws/statutes/ccsm/r120e.php
- https://www2.gnb.ca/content/gnb/en/departments/elg/local_government/content/governance/content/days_of_rest_act.html # noqa: E501
- https://www2.gnb.ca/content/gnb/en/departments/elg/local_government/content/governance/content/days_of_rest_act.html
- https://www.ontario.ca/document/your-guide-employment-standards-act-0/public-holidays
- https://www.officeholidays.com/countries/canada/
- https://www.timeanddate.com/holidays/canada/
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/curacao.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class Curacao(HolidayBase, ChristianHolidays, InternationalHolidays):
"""

country = "CW"
default_language = "pap"
supported_languages = ("en_US", "nl", "pap", "uk")
default_language = "pap_CW"
supported_languages = ("en_US", "nl", "pap_CW", "uk")

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand Down
4 changes: 2 additions & 2 deletions holidays/countries/hongkong.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class HongKong(
- `English Wikipedia <https://en.wikipedia.org/wiki/Public_holidays_in_Hong_Kong>`_
- `Chinese Wikipedia <https://zh.wikipedia.org/wiki/香港節日與公眾假期>`_
Statutory Holidays:
- `Section 39 of Cap. 57 Employment Ordinance <https://www.elegislation.gov.hk/hk/cap57!en-zh-Hant-HK?INDEX_CS=N&xpid=ID_1438403463460_002>`_ # noqa: E501
- `Section 39 of Cap. 57 Employment Ordinance <https://www.elegislation.gov.hk/hk/cap57!en-zh-Hant-HK?INDEX_CS=N&xpid=ID_1438403463460_002>`_
- `Holidays for 2010-2024 <https://www.labour.gov.hk/eng/news/holidays_list.htm>`_
General Holidays:
- `Cap. 149 General Holidays Ordinance <https://www.elegislation.gov.hk/hk/cap149!en-zh-Hant-HK?INDEX_CS=N>`_ # noqa: E501
- `Cap. 149 General Holidays Ordinance <https://www.elegislation.gov.hk/hk/cap149!en-zh-Hant-HK?INDEX_CS=N>`_
- `Holidays for 2007–2024 <https://www.gov.hk/en/about/abouthk/holiday/index.htm>`_
"""

Expand Down
Loading

0 comments on commit 8980a47

Please sign in to comment.