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

postponed days for Russian holidays in 2024 #1760

Closed
wants to merge 13 commits into from

Conversation

summicron502
Copy link
Contributor

Proposed change

Added postponed days for Russian holidays in 2024

Added days and translations

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new python-holidays functionality in general)

Checklist

  • I've followed the contributing guidelines
  • I've run make pre-commit, it didn't generate any changes
  • I've run make test, all tests passed locally

29.04.2024
30.04.2024
10.05.2024
30.12.2024
31.12.2024
according to:
https://www.consultant.ru/document/cons_doc_LAW_455140/
29.04.2024
30.04.2024
10.05.2024
30.12.2024
31.12.2024
according to:
https://www.consultant.ru/document/cons_doc_LAW_455140/
29.04.2024
30.04.2024
10.05.2024
30.12.2024
31.12.2024
according to:
https://www.consultant.ru/document/cons_doc_LAW_455140/
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8664950383

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 8655235045: 0.0%
Covered Lines: 11007
Relevant Lines: 11007

💛 - Coveralls

Copy link
Contributor

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@summicron502 Thank you for your contribution, although you might want to consider switching to the dedicated substituted holidays pattern instead, as shown in #1613 . 👍

That and some additional test cases for these postponed holidays would make this PR perfect for merging.

holidays/countries/russia.py Outdated Show resolved Hide resolved
holidays/countries/russia.py Outdated Show resolved Hide resolved
holidays/locale/ru/LC_MESSAGES/RU.po Outdated Show resolved Hide resolved
holidays/locale/en_US/LC_MESSAGES/RU.po Outdated Show resolved Hide resolved
summicron502 and others added 5 commits April 17, 2024 11:25
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
@summicron502
Copy link
Contributor Author

Changes accepted

Copy link
Contributor

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@summicron502 Other changes (I've put them as subcomments so they may have been overlooked before):

holidays/countries/russia.py Line 115-137 (class RussiaStaticHolidays section)

class RussiaStaticHolidays:
    # Date format (see strftime() Format Codes).
    substituted_date_format = tr("%d.%m.%Y")
    # Postpone of %s.
    substituted_label = tr("Перенос %s")

    special_public_holidays = {
        # Postponed Days 2023
        # src: https://www.consultant.ru/document/cons_doc_LAW_425407/
        2023: (
            (FEB, 24, JAN, 1),
            (MAY, 8, JAN, 8),
        ),
        # Postponed Days 2024
        # src: https://www.consultant.ru/document/cons_doc_LAW_455140/
        2024: (
            (APR, 29, APR, 27),
            (APR, 30, FEB, 11),
            (MAY, 10, JUN, 1),
            (DEC, 30, DEC, 28),
            (DEC, 31, JAN, 7),
        ),
    }

tests/countries/test_russia.py Line 30-40 (def test_special_holidays(self) section)

    def test_special_holidays(self):
        self.assertHoliday(
            # Postponed Holidays.
            "2023-02-24",
            "2023-05-08",
            "2024-04-29",
            "2024-04-30",
            "2024-05-10",
            "2024-12-30",
            "2024-12-31",
        )

summicron502 and others added 3 commits April 18, 2024 09:33
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
@arkid15r
Copy link
Collaborator

It's just a friendly reminder to address the CI/CD issues before we could merge this PR.

Thank you!

summicron502 and others added 2 commits April 23, 2024 09:06
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com>
Copy link

sonarcloud bot commented Apr 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@PPsyrius
Copy link
Contributor

PPsyrius commented Apr 23, 2024

@summicron502 Other changes (I've put them as subcomments so they may have been overlooked before):

holidays/countries/russia.py Line 115-137 (class RussiaStaticHolidays section)

class RussiaStaticHolidays:
    # Date format (see strftime() Format Codes).
    substituted_date_format = tr("%d.%m.%Y")
    # Postpone of %s.
    substituted_label = tr("Перенос %s")

    special_public_holidays = {
        # Postponed Days 2023
        # src: https://www.consultant.ru/document/cons_doc_LAW_425407/
        2023: (
            (FEB, 24, JAN, 1),
            (MAY, 8, JAN, 8),
        ),
        # Postponed Days 2024
        # src: https://www.consultant.ru/document/cons_doc_LAW_455140/
        2024: (
            (APR, 29, APR, 27),
            (APR, 30, FEB, 11),
            (MAY, 10, JUN, 1),
            (DEC, 30, DEC, 28),
            (DEC, 31, JAN, 7),
        ),
    }

tests/countries/test_russia.py Line 30-40 (def test_special_holidays(self) section)

    def test_special_holidays(self):
        self.assertHoliday(
            # Postponed Holidays.
            "2023-02-24",
            "2023-05-08",
            "2024-04-29",
            "2024-04-30",
            "2024-05-10",
            "2024-12-30",
            "2024-12-31",
        )

Please include these parts manually since GitHub doesn't allow code reviewers to suggest sections that the original PR contributor doesn't touch. (These are already tested with make test locally)

image

@summicron502
Copy link
Contributor Author

@summicron502 Other changes (I've put them as subcomments so they may have been overlooked before):
holidays/countries/russia.py Line 115-137 (class RussiaStaticHolidays section)

class RussiaStaticHolidays:
    # Date format (see strftime() Format Codes).
    substituted_date_format = tr("%d.%m.%Y")
    # Postpone of %s.
    substituted_label = tr("Перенос %s")

    special_public_holidays = {
        # Postponed Days 2023
        # src: https://www.consultant.ru/document/cons_doc_LAW_425407/
        2023: (
            (FEB, 24, JAN, 1),
            (MAY, 8, JAN, 8),
        ),
        # Postponed Days 2024
        # src: https://www.consultant.ru/document/cons_doc_LAW_455140/
        2024: (
            (APR, 29, APR, 27),
            (APR, 30, FEB, 11),
            (MAY, 10, JUN, 1),
            (DEC, 30, DEC, 28),
            (DEC, 31, JAN, 7),
        ),
    }

tests/countries/test_russia.py Line 30-40 (def test_special_holidays(self) section)

    def test_special_holidays(self):
        self.assertHoliday(
            # Postponed Holidays.
            "2023-02-24",
            "2023-05-08",
            "2024-04-29",
            "2024-04-30",
            "2024-05-10",
            "2024-12-30",
            "2024-12-31",
        )

Please include these parts manually since GitHub doesn't allow code reviewers to suggest sections that the original PR contributor doesn't touch. (These are already tested with make test locally)

image

For some reason l10n started to fail

from lingva.extract import main as create_pot_file
ModuleNotFoundError: No module named 'lingva'

Is it known problem or that's my fault?

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please find my comments to address below:

@@ -8,6 +8,7 @@ Akos Furton
Alejandro Antunes
Alexander Schulze
Alexandre Carvalho
Andrei Klimenko
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the alphabetical order, please

.coverage 2 Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be removed.

#. Postpone of %s.
#, c-format
msgid "Перенос %s"
msgstr "Postpone of %s"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We normally use Выходной (перенесено с %s) Day off (substituted from %s) for the labels

@arkid15r
Copy link
Collaborator

For some reason l10n started to fail

from lingva.extract import main as create_pot_file
ModuleNotFoundError: No module named 'lingva'

Is it known problem or that's my fault?

try running make setup or pip install -U lingva

@arkid15r
Copy link
Collaborator

arkid15r commented May 9, 2024

@summicron502 did you have a chance to work on addressing the issues/comments?

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.

None yet

4 participants