Add Bolsa Mexicana de Valores (BMV) holidays#3639
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a new ChangesXMEX / BMV Financial Calendar
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
BolsaMexicanaDeValoresfinancial entity (withXMEXandBMValiases). - Add l10n catalogs for
XMEXines(source) anden_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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
holidays/locale/uk/LC_MESSAGES/XMEX.po
There was a problem hiding this comment.
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:
- 2002-2006 calendars: https://web.archive.org/web/20020000000000*/http://bmv.com.mx/BMV/HTML/sec1_diasnolabora.html
- 2001 calendar: https://web.archive.org/web/20010609142152/http://www.bmv.com.mx/bmv/calendario.html
The usual trick is to go to the sitemap tab here:

Then select any clickable link there, for older websites they usually have a sitemap as well which make things easier:

Wow 😍 |
|
name Also, what is the accurate translation of this in Ukrainian
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 |
PPsyrius
left a comment
There was a problem hiding this comment.
I've rechecked upto 2010 for now
|
@KJhellico please let me know if any further adjustments are needed |
|
The most recent and unresolved comments were from @PPsyrius, I'm just following your discussion. 🤷♂️ |
eeshsaxena
left a comment
There was a problem hiding this comment.
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.
@eeshsaxena thanks for the feedback! New Year's is unwrapped by design since BMV always observes it on Jan 1st. We discussed this here
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 |
|



Proposed change
This PR adds the holidays for Mexicana de Valores (XMEX) financial calendar and introduces localization (l10n) support.
Part of GSoC (#3424)
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.