+
Skip to content

Conversation

arkid15r
Copy link
Collaborator

@arkid15r arkid15r commented Aug 13, 2025

Proposed change

Add pyproject.toml automatic formatting.

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/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

Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Summary by CodeRabbit

  • Chores
    • Updated packaging metadata: enabled dynamic versioning, added minimum Python requirement, classifiers, authors/maintainers, URLs, and declared dependency on python-dateutil.
    • Reorganized project configuration for linting, typing, testing, and coverage tools; no changes to runtime behavior.
    • Added a pre-commit hook to format project configuration files.

Walkthrough

Adds a pyproject-fmt pre-commit hook and substantially rewrites pyproject.toml: enables dynamic versioning (version sourced from holidays.version.version), reorganizes project metadata (authors, license, requires-python, classifiers, urls), adds python-dateutil as a dependency, and refactors tooling configs (setuptools, mypy, ruff, pytest, coverage).

Changes

Cohort / File(s) Summary
Pre-commit hook update
.pre-commit-config.yaml
Adds tox-dev/pyproject-fmt hook (rev v2.6.0, id pyproject-fmt) to the repos list to format pyproject.toml; no other changes.
Packaging & tooling reconfiguration
pyproject.toml
Switches to dynamic versioning via tool.setuptools.dynamic (version from holidays.version.__version__); moves and standardizes [project] metadata (authors, license, requires-python, classifiers, urls.*); adds dependencies = ["python-dateutil"]; updates setuptools package discovery and rewrites tool configs for mypy (overrides), ruff (lint/select/ignores), pytest (ini_options), and coverage (tool.coverage.run).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Suggested reviewers

  • PPsyrius
  • KJhellico

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d600f64) to head (0d2d669).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2814   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          286       286           
  Lines        17120     17120           
  Branches      2255      2255           
=========================================
  Hits         17120     17120           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c459df8 and 5f9bcc9.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml (1 hunks)
  • pyproject.toml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/groups/islamic.py:301-301
Timestamp: 2025-04-01T14:14:01.519Z
Learning: Running `make pre-commit` in the holidays project can automatically fix common code style issues like whitespace in blank lines.
Learnt from: PPsyrius
PR: vacanza/holidays#2599
File: holidays/countries/__init__.py:193-193
Timestamp: 2025-06-05T09:31:22.753Z
Learning: For the holidays Python library, when encountering line length or formatting issues, suggest contributors run `make pre-commit` to auto-format their files instead of providing specific manual formatting fixes like line splitting or noqa comments.
Learnt from: PPsyrius
PR: vacanza/holidays#2594
File: holidays/countries/micronesia.py:25-30
Timestamp: 2025-06-04T11:06:21.179Z
Learning: In the holidays repository, line length formatting should defer to pre-commit formatting checks rather than manual suggestions. If pre-commit allows it, the formatting is acceptable per project policy.
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:20-24
Timestamp: 2025-06-16T15:48:33.931Z
Learning: The holidays project uses `make pre-commit` test which includes `ruff` as the primary linter. If `ruff` passes, then Pylint warnings that don't appear in `ruff` are considered acceptable and can be ignored.
📚 Learning: 2025-04-26T19:55:09.581Z
Learnt from: KJhellico
PR: vacanza/holidays#2501
File: scripts/docs/gen_index.py:1-12
Timestamp: 2025-04-26T19:55:09.581Z
Learning: The holidays project uses a standard header for all Python (.py) files in the repository that describes the overall holidays library, including authors, website and license information, regardless of the specific purpose of individual script files.

Applied to files:

  • pyproject.toml
📚 Learning: 2025-06-21T16:30:12.749Z
Learnt from: KJhellico
PR: vacanza/holidays#2654
File: holidays/countries/cape_verde.py:1-12
Timestamp: 2025-06-21T16:30:12.749Z
Learning: The holidays project does not use module docstrings in country holiday files. All country files start directly with the copyright header comment block without module docstrings, maintaining a consistent coding style across the project.

Applied to files:

  • pyproject.toml
🔇 Additional comments (5)
.pre-commit-config.yaml (1)

58-62: Solid addition: pyproject-fmt hook is correctly integrated and pinned.

Hook is pinned to v2.6.0 and doesn’t overlap with other formatters. Nice.

Given prior learnings for this repo, please run make pre-commit locally to auto-fix any formatting that pyproject-fmt enforces on pyproject.toml before CI.

pyproject.toml (4)

59-65: isort + ruff coexistence is fine here.

You didn’t include the ruff “I” rules, so there’s no conflict with isort. Config matches ruff-format’s Black compatibility.


1-3: Ensure [build-system] is present.

The file view doesn’t show a [build-system] table. Without it, PEP 517 builds/installs from source can break. If it’s missing, add:

[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

37-46: Dynamic versioning verified — no action required

holidays/version.py defines a plain string: version = "0.79" and contains only comments — no imports or side-effectful calls were detected.

  • holidays/version.py — line 13: version = "0.79"

53-57: Ruff lint. keys are supported — no action required*

Verified the repo files: lint.* keys in pyproject.toml are supported by the pinned Ruff versions.

  • pyproject.toml: [tool.ruff] uses lint.select, lint.per-file-ignores, etc.
  • .pre-commit-config.yaml: astral-sh/ruff-pre-commit rev = v0.12.8 (ruff-check, ruff-format)
  • requirements/dev.txt: ruff==0.12.7
  • Note: lint.* was introduced in Ruff v0.2.0, so the pinned versions (0.12.x) support these keys. The sandbox couldn't run pre-commit (command not found), but the file evidence confirms compatibility.

No change required.

@arkid15r arkid15r marked this pull request as draft August 13, 2025 23:23
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5f9bcc9 and 0d2d669.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/groups/islamic.py:301-301
Timestamp: 2025-04-01T14:14:01.519Z
Learning: Running `make pre-commit` in the holidays project can automatically fix common code style issues like whitespace in blank lines.
Learnt from: PPsyrius
PR: vacanza/holidays#2599
File: holidays/countries/__init__.py:193-193
Timestamp: 2025-06-05T09:31:22.753Z
Learning: For the holidays Python library, when encountering line length or formatting issues, suggest contributors run `make pre-commit` to auto-format their files instead of providing specific manual formatting fixes like line splitting or noqa comments.
Learnt from: PPsyrius
PR: vacanza/holidays#2594
File: holidays/countries/micronesia.py:25-30
Timestamp: 2025-06-04T11:06:21.179Z
Learning: In the holidays repository, line length formatting should defer to pre-commit formatting checks rather than manual suggestions. If pre-commit allows it, the formatting is acceptable per project policy.
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test Python 3.10 on windows-latest
  • GitHub Check: Test Python 3.13 on windows-latest
🔇 Additional comments (1)
.pre-commit-config.yaml (1)

58-62: LGTM on adding pyproject-fmt.

Good pin to v2.6.0 and clean placement alongside other formatting hooks. This will keep pyproject.toml consistent with the repo’s tooling.

@arkid15r arkid15r marked this pull request as ready for review August 15, 2025 16:23
@arkid15r arkid15r enabled auto-merge August 15, 2025 16:23
Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

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

LGTM.

@arkid15r arkid15r added this pull request to the merge queue Aug 15, 2025
Copy link
Collaborator

@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.

LGTM 🛠️

Merged via the queue into vacanza:dev with commit 867a236 Aug 15, 2025
36 checks passed
@arkid15r arkid15r deleted the ark/add-pyproject-fmt branch August 15, 2025 16:59
@coderabbitai coderabbitai bot mentioned this pull request Aug 16, 2025
9 tasks
@arkid15r arkid15r mentioned this pull request Aug 18, 2025
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.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载