Skip to content

Commit

Permalink
v.0.17 (#785)
Browse files Browse the repository at this point in the history
* add honduras tests

* add honduras tests

* Add tests for many edge cases

* Add tests for many edge cases

* remove duplicate function

* v.0.15 beta init

* Typechecking (#661)

* typechecking HolidayBase, holidays.utils, miscellaneous typechecking
note: coverage to be extended to other parts of the project code

* Update Ukraine holidays.

  - Add Day of Ukrainian Statehood holiday.
  - Edit Victory Day name.
  - Fix formatting.
  - Update tests for Ukraine holidays.
  - Switch to <= and >= for consistency.
  - Rename Orthodox Easter.

* CHANGES sync

* Add Day after Thanksgiving to US - PA holidays (#675)

* CHANGES sync

* CHANGES sync, pre-commit reviews

* test_ukraine pre-commit fix

* Bump actions/setup-python from 3.1.0 to 4.1.0 (#682)

* Bump pre-commit/action from 2.0.3 to 3.0.0 (#672)

* removed py36 from toml target-version array

* Add Cuba (#678)

authored-by: bthompson <[email protected]>

* CHANGES sync

* Make Colombian holidays preserve historical observation (#676)

Authored-by: bthompson <[email protected]>

* Make Venezuela holidays preserve historical observation (#677)

Authored-by: bthompson <[email protected]>

* CHANGES sync

* black fixes

* removed outdated deprecation warnings

* Drop support for PortugalExt

* Ensure Canada Christmas observed falls after 25 and not before - new version #579

* CHANGES sync

* README sync (support for Cuba)

* Drop support for UK subdivisions as countries (England, Scotland..) (dr-p)
Drop support for IsleOfMan as UK subdivision (dr-p)

* Added support for Python 3.11, improved README badges

* Fixed CD/CI setup.cfg typo

* Added py3.11 to toml config

* Removed py3.11 from setup.cfg due to failing pre-commit checks

* Bump pypa/gh-action-pypi-publish from 1.5.0 to 1.5.1 #686

* Doc example fix (#685)

* added pentecost monday for province of bolzano

source: https://it.wikipedia.org/wiki/Pentecoste

* Whitsun Monday - province of Bolzano - IT (#689)

* Bump actions/setup-python to 4.2.0 (#688)

* v.0.15

* v.0.16 beta init

* Add UK Holiday for Queen Elizabeth II Funeral (#702)

* Add Moldova (#695)

* Add Bolivian holidays (#698)

* CHANGES sync

* Fix NYSE New Year observance for Saturdays. (#696)

* CHANGES sync

* Financial market support review, new method financial_holidays(..) #694

* Add Australia National Day of Mourning and confirmed Grand Final Day date (#699)

* CHANGES sync

* Add queen's funeral holidays for canada (#710)

* CHANGES sync

* New Zealand updates for Queen Elizabeth II mourning + King Charles III (#708, #709)

* Australia - new king updates

* Fix typo in comment for Cuba (#712)

* CHANGES sync - v.0.16 release date, dedication

* Fix Honduras

* Add 2014 test honduras

* Rename Eswatini from Swaziland

* Add import

* Add pre-commit isort hook.

* Run `pre-commit run --all-files`.

* Fix black - isort conflict.

* Revert docs conf.py changes.

* Sort

* Sort

* Introduce special holidays support.

Extend `HolidayBase` in order to make special holidays handling simpler.

* Fix documentation and UK special holidays list.

* Add a test.

* Add Bosnia and Herzegovina holidays.

* Edit Eid ul-Adha holiday logic and improve code readability.

* Improve readability.

* Add more tests.

* Update README.rst

* Change `special_holidays` format.

* Add Liechtenstien holidays and tests.

* Refactor tests.

* Remove empty constructors.

Move country holidays sources/descriptions from comments to docstrings.

* v.0.17 beta init

* Sort holiday names. (#713)

* Sort holiday names.
Order holidays by name when there are multiple holidays on the same date.

* CHANGES sync

* CHANGES sync

* Supported countries no. update, mexico.py permissions fix

* Keep context based imports sorting for `holidays.constants`.

* Fix observed holiday for christmas and boxing day canada (#715)

* CHANGES sync

* .pre-commit-config.yaml update

* Get holidays range type fix

* CHANGES sync

* README.rst: Fix documentation about Portugal subdiv param (#742)

* Bump actions/setup-python from 4.2.0 to 4.3.0 (#740)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixed incorrect subdivision code (#733)

* CHANGES sync

* Run isort.

* Bug fix of substitute holidays in Japan (#723)

* CHANGES sync

* isort commit

* isort commit

* CHANGES sync #650, #728

* Fix Honduras Morazan weekend bug. (#744)

* CHANGES sync

* README fix for Liechtenstein

* Singapore: Revised Date for Vesak Day in 2023 (#726)

* CHANGES sync

* Update malaysia.py (#736)

fix month for deewali 2022

* CHANGES sync

* README fix: pip install --upgrade (#735)

* Update Ukrainian holidays (#743)

* CHANGES sync

* Redesign special holidays population logic.

* Fix `_populate` docstring.

* README.rst: Remove Alpha-3 code for Bosnia and Herzegovina (#755)

Adding an extra entry like the Alpha-3 code in the countries
table causes render failure

* Added observed holidays for Ukraine (#746)

* Implement 100% test coverage (#747)

* Fix a typo: Liechtenstien -> Liechtenstein. (#752)

* Fixed Easter holidays for Bulgaria (#748)

* CHANGES sync

* pyproject.toml fixed, Ukraine reformatting

* CHANGES sync

* Portugal: add district holidays (#753)

Added holidays for the 18 portuguese districts
Added tests
Updated README.rst

* Import isort reformatting

* Fix Diwali date for 2022. (#754)

* CHANGES sync

* Optimizations for Ireland (#756)

* CHANGES sync

* Remove extra spaces from strings (#759)

* CHANGES sync

* Mexico: optimizations (#760)

* CHANGES sync

* Germany: optimizations (#766)

* China: optimizations (#767)

* CHANGES sync

* Fix a couple of `_populate` related issues.

* United Kingdom: optimizations (#780)

* Ukraine: observed holidays calculation more universal and readable (#776)

* Canada: optimizations, Yukon Heritage Day fix (#775)

* CHANGES sync

* Clean up Ireland tests. (#765)

Remove `print` statement.

* add documentation to _populate (see #704) (#763)

* Fix observance logic for laborable holidays in Uruguay (#758)

* Fix `list_supported_countries` and `list_supported_financial` methods. (#764)

Replace `obj.__base__` with `issubclass`.
Add Isle Of Man alpha-3 code.

* brazil.py: Update SC holiday according 2017 law (#761)

From 2017 onwards if the 11th of August falls on a work day the
holiday is moved to the next Sunday.

Issue: 592

* Added special case on 2022 (#779)

Added special case on 2022 Chinese Mid-Autumn Festival

Added test case on test_hongkong.py

* Remove `assert` from Norway and Sweden. (#771)

Rework all Sundays collection logic (use dateutil.rrule).
Extract repetitive test_sundays code to a separate file.

* South Africa: (#773)

- replace while loops with dateutil logic (#768)
- Queen's Birthday day fix
- observed holidays calculation fix
- added tests

* Replace Python built-in asserts with unittest asserts. (#777)

* CHANGES sync

* Replace while loops with dateutil logic (#768) (#770)

* CHANGES sync

* Lithuania: add the 2nd on November as holiday (#781)

* CHANGES sync

* MyPy implicit optional option

* Update Hong Kong holiday, mid-autumn (#782)

* CHANGES sync

* Sweden: fix Midsummer evening (#783)

* CHANGES sync

* v0.17

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Akos <[email protected]>
Co-authored-by: Akos Furton <[email protected]>
Co-authored-by: Maurizio Montel <[email protected]>
Co-authored-by: David Hotham <[email protected]>
Co-authored-by: Kate <[email protected]>
Co-authored-by: Ark <[email protected]>
Co-authored-by: Bailey Thompson <[email protected]>
Co-authored-by: g-gg <[email protected]>
Co-authored-by: Jacob Punter <[email protected]>
Co-authored-by: Nikita <[email protected]>
Co-authored-by: Ryan McCrory <[email protected]>
Co-authored-by: Pedro Baptista <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Thessel <[email protected]>
Co-authored-by: Sho Hirose <[email protected]>
Co-authored-by: Mike Borsetti <[email protected]>
Co-authored-by: shahonseven <[email protected]>
Co-authored-by: ~Jhellico <[email protected]>
Co-authored-by: poshingchu <[email protected]>
  • Loading branch information
20 people authored Nov 13, 2022
1 parent 390f59c commit e81d16a
Show file tree
Hide file tree
Showing 213 changed files with 4,293 additions and 2,213 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=auto
* text eol=lf
6 changes: 3 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
- name: Run pre-commit
uses: pre-commit/[email protected]

Expand All @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
13 changes: 10 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
args: [--fix=lf]

- repo: https://github.com/python/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
language_version: python3
Expand All @@ -23,14 +23,21 @@ repos:
- id: flake8
args: [--max-line-length=79]

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
exclude: ^docs/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.971'
rev: 'v0.990'
hooks:
- id: mypy
additional_dependencies: [types-all]
args:
- --ignore-missing-imports
- --show-error-codes
- --implicit-optional

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
Expand All @@ -47,6 +54,6 @@ repos:
# args: [--ignore-directives=automodule]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.0.0
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
33 changes: 33 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
Version 0.17
============

Released November 13, 2022

- 100% test coverage, code refactoring #747, #749 (arkid15r)
- Special holidays (one-off) support #724 (arkid15r, dr-p)
- Support for Bosnia and Herzegovina #683, #725 (kasya, arkid15r)
- Support for Liechtenstein #650, #728, #758 (kasya, arkid15r)
- Added isort to pre-commit #722, #734 (arkid15r, dr-p)
- Get item multiple return type fix (dr-p) TODO: possible refactor required
- Sort overlapping holiday names #713 (kasya, arkid15r)
- Supported country / financial lists fix #764 (arkid15r)
- Various refactorings #777 (arkid15r)
- Various refactorings #756, #759, #760, #766, #767, #770, #775, #776, #780 (KJhellico)
- Portugal improvements #753 (Nalguedo)
- Brazil improvements #761, #592 (Nalguedo)
- Uruguay improvements #758 (kasya)
- Hong Kong improvements #779, #782 (poshingchu)
- Swaziland deprecation, replaced by Eswatini #721 (bkthomps)
- Norway, Sweden rework #771 (arkid15r)
- South Africa rework #773 (KJhellico)
- Singapore fixes #717, #726, #754, #782 (amas01, mborsetti, kasya, poshingchu)
- Canada fixes #715, #733 (bkthomps, MichaelThessel)
- Honduras fixes #720, #744 (bkthomps, arkid15r)
- Japan upgrades (added substitute holidays) #723 (shohirose)
- Malaysia fix #736, #782 (shahonseven, poshingchu)
- Ukraine fixes #743, #746 (KJhellico)
- Bulgaria fixes #748 (KJhellico)
- Isle of Man fix #762, #764 (arkid15r)
- Lithuania fix #781 (Nalguedo)
- Sweden fix #783 (sander-visser, KJhellico)

Version 0.16
============

Expand Down
14 changes: 10 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The latest stable version can always be installed or updated via pip:

.. code-block:: bash
$ pip install --update holidays
$ pip install --upgrade holidays
Documentation
Expand Down Expand Up @@ -106,7 +106,7 @@ Available Countries

.. _ISO 3166-1 alpha-2 code: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes

We currently support 86 countries. The standard way to refer to a country is by
We currently support 96 countries. The standard way to refer to a country is by
using its `ISO 3166-1 alpha-2 code`_, the same used for domain names. The
following countries and their subdivisions are available:

Expand Down Expand Up @@ -148,6 +148,9 @@ following countries and their subdivisions are available:
* - Bolivia
- BO
- Departments: B, C, H, L, N, O, P, S, T
* - Bosnia and Herzegovina
- BA
- Departments: FBiH, RS, BD
* - Botswana
- BW
- None
Expand All @@ -162,7 +165,7 @@ following countries and their subdivisions are available:
- None
* - Canada
- CA
- Provinces and territories: AB, BC, MB, NB, NL, NS NT, NU, **ON** (default), PE, QC, SK, YU
- Provinces and territories: AB, BC, MB, NB, NL, NS NT, NU, **ON** (default), PE, QC, SK, YT
* - Chile
- CL
- Regions: AI, AN, AP, AR, AT, BI, CO, LI, LL, LR, MA, ML, NB, RM, TA, VS
Expand Down Expand Up @@ -268,6 +271,9 @@ following countries and their subdivisions are available:
* - Lesotho
- LS
- None
* - Liechtenstein
- LI
- None
* - Lithuania
- LT
- None
Expand Down Expand Up @@ -330,7 +336,7 @@ following countries and their subdivisions are available:
- None
* - Portugal
- PT
- Use subd='Ext' to include holidays most people have off
- Districts: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18; Use subdiv='Ext' to include holidays most people have off
* - Romania
- RO
- None
Expand Down
16 changes: 16 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ pairs, a list of dates, or even singular date/string/timestamp objects:
>>> custom_holidays.append(date(2015, 12, 25))
Add years to an existing Holiday object
---------------------------------------

Because the Holiday class is a subclass of dictionary, we use the `update()
<https://docs.python.org/3/library/stdtypes.html?highlight=update#dict.update>`__ method to add years to an existing
holiday object:

.. code-block:: python
>>> from holidays import country_holidays
>>> us_holidays = country_holidays('US', years=2020)
# to add new years of holidays to the object:
>>> us_holidays.update(country_holidays('US', years=2021))
Other ways to specify the country
---------------------------------

Expand Down
15 changes: 11 additions & 4 deletions holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
# ryanss <[email protected]> (c) 2014-2017
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)
from holidays.countries import *
from holidays.financial import *
from holidays.constants import MON, TUE, WED, THU, FRI, SAT, SUN, WEEKEND
from holidays.constants import (
MON,
TUE,
WED,
THU,
FRI,
SAT,
SUN,
WEEKEND,
JAN,
FEB,
MAR,
Expand All @@ -25,6 +30,8 @@
NOV,
DEC,
)
from holidays.countries import *
from holidays.financial import *
from holidays.holiday_base import * # * import required for IDE docstrings
from holidays.utils import (
CountryHoliday,
Expand All @@ -34,4 +41,4 @@
list_supported_financial,
)

__version__ = "0.16"
__version__ = "0.17"
Loading

0 comments on commit e81d16a

Please sign in to comment.