Skip to content

Add Bolsa Mexicana de Valores (BMV) holidays#3639

Merged
arkid15r merged 11 commits into
vacanza:devfrom
pareshjoshij:add_BMV
Jul 2, 2026
Merged

Add Bolsa Mexicana de Valores (BMV) holidays#3639
arkid15r merged 11 commits into
vacanza:devfrom
pareshjoshij:add_BMV

Conversation

@pareshjoshij

Copy link
Copy Markdown
Contributor

Proposed change

This PR adds the holidays for Mexicana de Valores (XMEX) financial calendar and introduces localization (l10n) support.

Part of GSoC (#3424)

  • 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/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

@pareshjoshij pareshjoshij requested a review from arkid15r as a code owner June 20, 2026 18:49
Copilot AI review requested due to automatic review settings June 20, 2026 18:49
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new BolsaMexicanaDeValores financial holiday calendar for Mexico's BMV stock exchange, covering fixed and observed holidays from 2014 onward. Includes registry entry, package-level exports, en_US, es, and uk locale PO files, a full test suite with localization checks, and a README table row.

Changes

XMEX / BMV Financial Calendar

Layer / File(s) Summary
BolsaMexicanaDeValores class and holiday logic
holidays/financial/bolsa_mexicana_de_valores.py
Defines BolsaMexicanaDeValores with market/language config and mixin wiring. Implements _populate_public_holidays for all BMV holidays including a year-conditional rule for Transmisión del Poder Ejecutivo Federal (Oct 1 for 2024+, Dec 1 otherwise). Exports XMEX and BMV alias subclasses.
Registry, package export, and README entry
holidays/registry.py, holidays/financial/__init__.py, README.md
Adds bolsa_mexicana_de_valores to the FINANCIAL registry, re-exports the new classes from the financial package, and adds the XMEX row to the README's financial markets table.
Locale PO files
holidays/locale/en_US/LC_MESSAGES/XMEX.po, holidays/locale/es/LC_MESSAGES/XMEX.po, holidays/locale/uk/LC_MESSAGES/XMEX.po
Adds en_US PO file with full Spanish-to-English holiday name translations, es PO file with holiday msgid keys and empty msgstr fields, and uk PO file with Ukrainian translations.
Test suite
tests/financial/test_bolsa_mexicana_de_valores.py
Adds TestBolsaMexicanaDeValores with per-holiday observed/non-observed date checks, full 2024 and 2025 year assertions, and localization tests for es, en_US, and uk locales.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • arkid15r
  • KJhellico
  • PPsyrius
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changeset: adding Bolsa Mexicana de Valores (BMV) holidays support with the market code XMEX.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of adding XMEX financial calendar holidays and l10n support as part of a GSoC initiative.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new financial market calendar for Bolsa Mexicana de Valores (MIC: XMEX) and wires it into the library’s registry, documentation, and localization system so holiday names can be returned in Spanish (default) or en_US.

Changes:

  • Implement XMEX/BMV holiday rules in a new BolsaMexicanaDeValores financial entity (with XMEX and BMV aliases).
  • Add l10n catalogs for XMEX in es (source) and en_US (translated) plus tests validating both default and localized outputs.
  • Register and document the new market in holidays/registry.py, holidays/financial/__init__.py, and the README financial markets table.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
holidays/financial/bolsa_mexicana_de_valores.py New XMEX/BMV financial calendar implementation and holiday population logic.
holidays/financial/__init__.py Exposes BolsaMexicanaDeValores, XMEX, and BMV from the financial package.
holidays/registry.py Registers the new financial entity and its aliases for lazy loading and utilities.
holidays/locale/es/LC_MESSAGES/XMEX.po Adds Spanish (default/source) message catalog for XMEX holiday names.
holidays/locale/en_US/LC_MESSAGES/XMEX.po Adds en_US translations for XMEX holiday names.
tests/financial/test_bolsa_mexicana_de_valores.py Adds unit and localization tests for the XMEX/BMV calendar.
README.md Documents XMEX in the “Available Financial Markets” table with supported languages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b3277e1) to head (73d37fe).
⚠️ Report is 10 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3639   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          317       318    +1     
  Lines        18977     19056   +79     
  Branches      2423      2436   +13     
=========================================
+ Hits         18977     19056   +79     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KJhellico KJhellico changed the title Add Bolsa Mexicana de Valores (XMEX) holidays Add Bolsa Mexicana de Valores (BMV) holidays Jun 20, 2026
Comment thread holidays/financial/bolsa_mexicana_de_valores.py Outdated
Comment thread holidays/financial/bolsa_mexicana_de_valores.py Outdated
@pareshjoshij pareshjoshij requested a review from KJhellico June 21, 2026 14:32
Comment thread holidays/locale/uk/LC_MESSAGES/XMEX.po Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@holidays/locale/uk/LC_MESSAGES/XMEX.po`:
- Line 48: In the Ukrainian locale file for XMEX.po, the msgstr entry for Good
Friday ("Страсна пʼятниця") uses a modifier letter apostrophe (U+02BC) instead
of a regular ASCII apostrophe (U+0027). Replace the modifier letter apostrophe
character in the word пʼятниця with a standard apostrophe to match the expected
test value, changing it to п'ятниця.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e5f2423a-86b8-4c1b-96d3-caf922600ff8

📥 Commits

Reviewing files that changed from the base of the PR and between f82063a and 85a0012.

📒 Files selected for processing (1)
  • holidays/locale/uk/LC_MESSAGES/XMEX.po

Comment thread holidays/locale/uk/LC_MESSAGES/XMEX.po
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
@pareshjoshij pareshjoshij requested a review from KJhellico June 22, 2026 11:38

@KJhellico KJhellico left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Last small fixes:

Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

2007-2014 calendars 👀: https://web.archive.org/web/20140000000000*/http://bmv.com.mx/wb3/wb/BMV/BMV_calendario_de_dias_festivos

The website itself is available since 1996, but let me see if I can dig up more pre-2007 versions

Edit:

The usual trick is to go to the sitemap tab here:
image
Then select any clickable link there, for older websites they usually have a sitemap as well which make things easier:
image

@pareshjoshij

Copy link
Copy Markdown
Contributor Author

2007-2014 calendar 👀: https://web.archive.org/web/20140000000000*/http://bmv.com.mx/wb3/wb/BMV/BMV_calendario_de_dias_festivos

The website itself is available since 1996, but let me see if I can dig up more pre-2007 versions

Wow 😍

@pareshjoshij

pareshjoshij commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@PPsyrius , @KJhellico

name Bicentennial of Mexican Independence (Bridge day). for special holiday is ok ?

Reference

Also, what is the accurate translation of this in Ukrainian


2002-2006 calendars: https://web.archive.org/web/20020000000000*/http://bmv.com.mx/BMV/HTML/sec1_diasnolabora.html

Note: reference links site has some errors. For some years (2004/05), it shows holidays on weekends and misses the Day of the Dead. Also, the 2006 Constitution Day date is wrong. I guess we can ignore this

@pareshjoshij pareshjoshij requested a review from Copilot June 23, 2026 06:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Comment thread holidays/locale/uk/LC_MESSAGES/XMEX.po Outdated
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
@pareshjoshij pareshjoshij requested a review from KJhellico June 23, 2026 09:47

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've rechecked upto 2010 for now

Comment thread holidays/financial/bolsa_mexicana_de_valores.py Outdated
Comment thread holidays/financial/bolsa_mexicana_de_valores.py Outdated
Comment thread holidays/financial/bolsa_mexicana_de_valores.py
Comment thread holidays/financial/bolsa_mexicana_de_valores.py
Comment thread holidays/financial/bolsa_mexicana_de_valores.py
Comment thread holidays/financial/bolsa_mexicana_de_valores.py
Comment thread holidays/financial/bolsa_mexicana_de_valores.py
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
Comment thread tests/financial/test_bolsa_mexicana_de_valores.py Outdated
@pareshjoshij

Copy link
Copy Markdown
Contributor Author

@KJhellico please let me know if any further adjustments are needed

@KJhellico

Copy link
Copy Markdown
Collaborator

The most recent and unresolved comments were from @PPsyrius, I'm just following your discussion. 🤷‍♂️

@eeshsaxena eeshsaxena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is really thorough - the per-year archived references (2001-2026) are excellent, and the modeling looks accurate: the 2006 shift to "puente" Mondays for Constitution/Benito Juárez/Revolution days, the no-2007-onward vs fixed-date split, the 2024 move of the change-of-government holiday from Dec 1 to Oct 1, and the localization plus the test_2025 snapshot are all great.

One thing I wanted to check on: New Year's Day is the only fixed-date holiday not wrapped in _move_holiday. Every other fixed-date holiday (Labor Day, Independence Day, Day of the Dead, Bank Employee Day, Christmas, and the pre-reform Constitution/Benito/Revolution days) is wrapped, so with observed_rule = SAT_TO_NONE + SUN_TO_NONE they are suppressed when they fall on a weekend. Because _add_new_years_day(...) isn't wrapped, Año Nuevo will instead still appear on weekends, e.g. 2022-01-01 (Sat) and 2023-01-01 (Sun), while e.g. a Sunday Christmas is dropped.

Is that intentional (does the BMV calendar specifically keep New Year's Day on weekends), or should it be wrapped in _move_holiday like the others for consistency? Either way it might be worth a comment or an explicit weekend-year assertion in test_new_years_day to lock the chosen behavior in.

For context I recently added a financial market (the LSE, #3654), so this is a fellow-contributor note - deferring to the maintainers.

@pareshjoshij

Copy link
Copy Markdown
Contributor Author

Is that intentional (does the BMV calendar specifically keep New Year's Day on weekends), or should it be wrapped in _move_holiday like the others for consistency?

@eeshsaxena thanks for the feedback! New Year's is unwrapped by design since BMV always observes it on Jan 1st. We discussed this here

For context I recently added a financial market (the LSE, #3654), so this is a fellow-contributor note - deferring to the maintainers.

I don't know the exact procedure here, but I am also working on LSE for my GSoC (#3424) project. I have my research done for it already, and it’s next on my list right after TSX (which is about 70% done). Appreciate the review

@pareshjoshij

Copy link
Copy Markdown
Contributor Author

@PPsyrius 👀

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Last one👍

It took me quite a while to recheck all 2001-2026 sources, I think the current implementation is fine now

Comment thread tests/financial/test_bolsa_mexicana_de_valores.py
Comment thread holidays/financial/bolsa_mexicana_de_valores.py
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🇲🇽

@KJhellico KJhellico left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@arkid15r arkid15r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@arkid15r arkid15r enabled auto-merge July 2, 2026 01:15
@arkid15r arkid15r added this pull request to the merge queue Jul 2, 2026
Merged via the queue into vacanza:dev with commit b89d03b Jul 2, 2026
33 checks passed
@pareshjoshij pareshjoshij deleted the add_BMV branch July 2, 2026 02:27
@KJhellico KJhellico mentioned this pull request Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants