Skip to content

Commit

Permalink
v.0.15 (#691)
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 <bthompson@pinterest.com>

* CHANGES sync

* Make Colombian holidays preserve historical observation (#676)

Authored-by: bthompson <bthompson@pinterest.com>

* Make Venezuela holidays preserve historical observation (#677)

Authored-by: bthompson <bthompson@pinterest.com>

* 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

Co-authored-by: Akos <afurton@apple.com>
Co-authored-by: Akos Furton <furton.akos@bcg.com>
Co-authored-by: Maurizio Montel <mmontel@mmontel.mxp.csb>
Co-authored-by: David Hotham <david.hotham@blueyonder.co.uk>
Co-authored-by: Kate <kate@kgthreads.com>
Co-authored-by: Ark <ark@cho.red>
Co-authored-by: Bailey Thompson <bailey.kyle.thompson@gmail.com>
Co-authored-by: g-gg <52978382+g-gg@users.noreply.github.com>
  • Loading branch information
9 people authored Aug 21, 2022
1 parent 1223874 commit d3dc700
Show file tree
Hide file tree
Showing 67 changed files with 1,739 additions and 593 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v4.2.0
- name: Run pre-commit
uses: pre-commit/action@v2.0.3
uses: pre-commit/action@v3.0.0

test:
name: "Test: python=${{ matrix.python-version }} on ${{ matrix.os }}"
Expand All @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3.1.0
uses: actions/setup-python@v4.2.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@v3.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: "3.10"
- name: Install dependencies
Expand All @@ -80,7 +80,7 @@ jobs:
python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.pypi_password }}
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -12,7 +12,7 @@ repos:
args: [--fix=lf]

- repo: https://github.com/python/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
language_version: python3
Expand All @@ -24,7 +24,7 @@ repos:
args: [--max-line-length=79]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.960'
rev: 'v0.971'
hooks:
- id: mypy
additional_dependencies: [types-all]
Expand All @@ -47,6 +47,6 @@ repos:
# args: [--ignore-directives=automodule]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
rev: v1.20.2
hooks:
- id: setup-cfg-fmt
23 changes: 23 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Version 0.15
============

Released August 21, 2022

- Added support for Python3.11 (dr-p)
- Updated README - improved badges area (dr-p)
- Support for Cuba #678 (bthompson, dr-p)
- Typechecking implementation, first release (HolidayBase, utils, some sample countries) #661 (dimbleby)
- Test coverage improvement #633 (akosfurton, dr-p)
- Drop support for UK subdivisions as countries (England, Scotland..) (dr-p)
- Drop support for IsleOfMan as UK subdivision (dr-p)
- Drop support for PortugalExt (ie: extended Portugal) (dr-p)
- US fixes #675 (arkid15r)
- Colombia fixes & test improvements #676 (bkthomps)
- Venezuela fixes & test improvements #677 (bkthomps)
- Canada fixes #579 (dr-p, scubaandre)
- Ukraine refactoring #681 (kasya)
- Italy update #689 (g-gg, dr-p)
- Bump pre-commit and setup-python actions #672, #682, #686, #688 (dr-p)
- Doc example fix #685 (steakhutzeee, dr-p)


Version 0.14.2
==============

Expand Down
41 changes: 30 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,38 @@ state or province) specific sets of government-designated holidays on the fly.
It aims to make determining whether a specific date is a holiday as fast and
flexible as possible.

.. image:: https://github.com/dr-prodigy/python-holidays/workflows/Tests/badge.svg
:target: actions
:Package:
.. image:: https://img.shields.io/pypi/pyversions/holidays.svg?logo=python&label=Python&logoColor=gold
:target: https://pypi.python.org/pypi/holidays
:alt: Python supported versions

.. image:: http://img.shields.io/coveralls/dr-prodigy/python-holidays/master
:target: https://coveralls.io/r/dr-prodigy/python-holidays
.. image:: http://img.shields.io/pypi/v/holidays.svg?logo=pypi&label=PyPI&logoColor=gold
:target: https://pypi.python.org/pypi/holidays
:alt: PyPI version

.. image:: http://img.shields.io/pypi/v/holidays.svg
:target: https://pypi.python.org/pypi/holidays
.. image:: https://img.shields.io/pypi/dm/holidays.svg?color=blue&label=Downloads&logo=pypi&logoColor=gold
:target: https://pypi.python.org/pypi/holidays
:alt: Downloads

.. image:: http://img.shields.io/pypi/l/holidays.svg
:target: LICENSE
:CD/CI:
.. image:: https://github.com/dr-prodigy/python-holidays/workflows/Tests/badge.svg
:target: actions

.. image:: https://readthedocs.org/projects/python-holidays/badge/?version=latest
:target: https://python-holidays.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: http://img.shields.io/coveralls/dr-prodigy/python-holidays/master
:target: https://coveralls.io/r/dr-prodigy/python-holidays

:Docs:
.. image:: https://readthedocs.org/projects/python-holidays/badge/?version=latest
:target: https://python-holidays.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

:Meta:
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:alt: Code style

.. image:: http://img.shields.io/pypi/l/holidays.svg
:target: LICENSE
:alt: License

Install
-------
Expand Down Expand Up @@ -152,6 +168,9 @@ following countries and their subdivisions are available:
* - Croatia
- HR
- None
* - Cuba
- CU
- None
* - Curaçao
- CW
- None
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ the US and the only method we need to override is :py:meth:`_populate`:
>>> self.pop_named("Columbus Day")
>>> # Add Ninja Turtle Day
>>> self[date(year, 7, 13)] = "Ninja Turtle Day"
>>> date(2014, 10, 14) in Holidays(country="US")
>>> date(2014, 10, 14) in holidays.country_holidays(country="US")
True
>>> date(2014, 10, 14) in CorporateHolidays(country="US")
>>> date(2014, 10, 14) in CorporateHolidays()
False
>>> date(2014, 7, 13) in Holidays(country="US")
>>> date(2014, 7, 13) in holidays.country_holidays(country="US")
False
>>> date(2014 ,7, 13) in CorporateHolidays(country="US")
>>> date(2014 ,7, 13) in CorporateHolidays()
True
We can also inherit from the HolidayBase class which has an empty
Expand Down
2 changes: 1 addition & 1 deletion holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
list_supported_financial,
)

__version__ = "0.14.2"
__version__ = "0.15"
7 changes: 2 additions & 5 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from .china import China, CN, CHN
from .colombia import Colombia, CO, COL
from .croatia import Croatia, HR, HRV
from .cuba import Cuba, CU, CUB
from .curacao import Curacao, CW, CUW
from .cyprus import Cyprus, CY, CYP
from .czechia import Czechia, CZ, CZE
Expand Down Expand Up @@ -76,7 +77,7 @@
from .paraguay import Paraguay, PY, PRY
from .peru import Peru, PE, PER
from .poland import Poland, PL, POL
from .portugal import Portugal, PT, PRT, PortugalExt, PTE, PRTE
from .portugal import Portugal, PT, PRT
from .romania import Romania, RO, ROU
from .russia import Russia, RU, RUS
from .saudi_arabia import SaudiArabia, SA, SAU
Expand All @@ -99,10 +100,6 @@
UK,
GB,
GBR,
England,
Wales,
Scotland,
NorthernIreland,
)
from .united_states import UnitedStates, US, USA
from .uruguay import Uruguay, UY, URY
Expand Down
6 changes: 3 additions & 3 deletions holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def _populate(self, year):
name = "Canberra Day"
if year >= 1913 and year <= 1957:
self[date(year, MAR, 12)] = name
elif year >= 1958 and year <= 2007:
if year >= 1958 and year <= 2007:
self[date(year, MAR, 1) + rd(weekday=MO(+3))] = name
elif year >= 2008 and year != 2012:
if year >= 2008 and year != 2012:
self[date(year, MAR, 1) + rd(weekday=MO(+2))] = name
elif year == 2012:
if year == 2012:
self[date(year, MAR, 12)] = name

# Easter
Expand Down
17 changes: 8 additions & 9 deletions holidays/countries/canada.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _populate(self, year):
elif self.subdiv == "NB" and year >= 2018:
self[date(year, FEB, 1) + rd(weekday=MO(+3))] = "Family Day"
elif self.subdiv == "BC":
if year >= 2013 and year <= 2018:
if 2013 <= year <= 2018:
self[date(year, FEB, 1) + rd(weekday=MO(+2))] = "Family Day"
elif year > 2018:
self[date(year, FEB, 1) + rd(weekday=MO(+3))] = "Family Day"
Expand Down Expand Up @@ -251,20 +251,19 @@ def _populate(self, year):

# Christmas Day
if year >= 1867:
self[date(year, DEC, 25)] = "Christmas Day"
if self.observed and date(year, DEC, 25).weekday() == SAT:
self[date(year, DEC, 24)] = "Christmas Day (Observed)"
elif self.observed and date(year, DEC, 25).weekday() == SUN:
self[date(year, DEC, 26)] = "Christmas Day (Observed)"
name = "Christmas Day"
name_observed = name + " (Observed)"
if self.observed and date(year, DEC, 25).weekday() in WEEKEND:
self[date(year, DEC, 27)] = name_observed
else:
self[date(year, DEC, 25)] = name

# Boxing Day
if year >= 1867:
name = "Boxing Day"
name_observed = name + " (Observed)"
if self.observed and date(year, DEC, 26).weekday() in WEEKEND:
self[date(year, DEC, 26) + rd(weekday=MO)] = name_observed
elif self.observed and date(year, DEC, 26).weekday() == 0:
self[date(year, DEC, 27)] = name_observed
self[date(year, DEC, 28)] = name_observed
else:
self[date(year, DEC, 26)] = name

Expand Down
Loading

0 comments on commit d3dc700

Please sign in to comment.