diff --git a/RELEASE.rst b/RELEASE.rst index 591ba8016..fcd1c21e2 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -56,7 +56,7 @@ How to release a new version of Holidays - send "Holidays 'v' has been released!" (or similar) message to Vacanza Team Slack #release channel - pull the recent changes from ``main`` branch into ``dev`` - - bump the Holidays version at ``holidays/__init__.py`` file + - bump the Holidays version at ``holidays/version.py`` file - create a commit with 'Initialize v' message, e.g. 'Initialize v0.40' and push it to ``dev`` branch (this may require running ``make package`` to pass the tests locally) diff --git a/holidays/__init__.py b/holidays/__init__.py index 61aa8d6e3..3b226c922 100644 --- a/holidays/__init__.py +++ b/holidays/__init__.py @@ -10,26 +10,14 @@ # Website: https://github.com/vacanza/holidays # License: MIT (see LICENSE file) -# flake8: noqa: F403 - -import warnings +# ruff: noqa: F403 from holidays.constants import * -from holidays.deprecation import ( - FUTURE_INCOMPATIBILITY_WARNING_TEMPLATE, - FutureIncompatibilityWarning, -) +from holidays.deprecations.v1_incompatibility import * from holidays.holiday_base import * from holidays.registry import EntityLoader from holidays.utils import * - -__version__ = "0.60" - +from holidays.version import __version__ # noqa: F401 EntityLoader.load("countries", globals()) EntityLoader.load("financial", globals()) - -warnings.warn( - FUTURE_INCOMPATIBILITY_WARNING_TEMPLATE.format(version=__version__), - FutureIncompatibilityWarning, -) diff --git a/holidays/deprecation.py b/holidays/deprecations/v1_incompatibility.py similarity index 84% rename from holidays/deprecation.py rename to holidays/deprecations/v1_incompatibility.py index 19ca1d7bc..12186fc0f 100644 --- a/holidays/deprecation.py +++ b/holidays/deprecations/v1_incompatibility.py @@ -10,9 +10,13 @@ # Website: https://github.com/vacanza/holidays # License: MIT (see LICENSE file) +import warnings + +from holidays.version import __version__ + FUTURE_INCOMPATIBILITY_WARNING_TEMPLATE = """ -This is a future version incompatibility warning from Holidays library v{version} +This is a future version incompatibility warning from Holidays v{version} to inform you about an upcoming change in our API versioning strategy that may affect your project's dependencies. Starting from version 1.0 onwards, we will be following a loose form of Semantic Versioning (SemVer, https://semver.org) to provide clearer communication regarding any @@ -22,7 +26,7 @@ updates that introduce breaking changes to our API. To ensure the stability of your projects, we highly recommend pinning the version of our API that you rely on. You can pin your current holidays v0.x dependency (e.g., holidays=={version}) or limit it (e.g., holidays<1.0) in order to -avoid potentially unwanted upgrade to the version 1.0 when it's released (ETA 2024Q4 - 2025Q1). +avoid potentially unwanted upgrade to the version 1.0 when it's released (ETA 2025Q1-Q2). If you have any questions or concerns regarding this change, please don't hesitate to reach out to us via https://github.com/vacanza/holidays/discussions/1800. @@ -31,3 +35,9 @@ class FutureIncompatibilityWarning(DeprecationWarning): pass + + +warnings.warn( + FUTURE_INCOMPATIBILITY_WARNING_TEMPLATE.format(version=__version__), + FutureIncompatibilityWarning, +) diff --git a/holidays/version.py b/holidays/version.py new file mode 100644 index 000000000..e3c4e2cb7 --- /dev/null +++ b/holidays/version.py @@ -0,0 +1,13 @@ +# holidays +# -------- +# A fast, efficient Python library for generating country, province and state +# specific sets of holidays on the fly. It aims to make determining whether a +# specific date is a holiday as fast and flexible as possible. +# +# Authors: Vacanza Team and individual contributors (see AUTHORS file) +# dr-prodigy (c) 2017-2023 +# ryanss (c) 2014-2017 +# Website: https://github.com/vacanza/holidays +# License: MIT (see LICENSE file) + +__version__ = "0.60" diff --git a/pyproject.toml b/pyproject.toml index 9a77001c8..8d76b18c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,8 +83,7 @@ disable_error_code = "attr-defined" [tool.pytest.ini_options] filterwarnings = [ - "ignore::DeprecationWarning:holidays", - "ignore::DeprecationWarning:xdist", + "ignore::DeprecationWarning:holidays.deprecations.v1_incompatibility", ] [tool.rstcheck] @@ -92,7 +91,7 @@ ignore_directives = ["automodule", "autosummary"] ignore_languages = ["python"] [tool.setuptools.dynamic] -version = { attr = "holidays.__version__" } +version = { attr = "holidays.version.__version__" } [tool.setuptools.packages.find] include = ["holidays*"]