Skip to content

wbdata v1.1#77

Merged
OliverSherouse merged 4 commits intomasterfrom
mac-cache
Oct 5, 2025
Merged

wbdata v1.1#77
OliverSherouse merged 4 commits intomasterfrom
mac-cache

Conversation

@OliverSherouse
Copy link
Owner

@OliverSherouse OliverSherouse commented Oct 5, 2025

This pull request introduces several major updates to the project’s packaging, development workflow, and codebase. The most significant changes are a migration from Poetry to PEP 621 and Hatchling for packaging, the adoption of uv for dependency management and publishing, and the modernization of type annotations throughout the code. It also adds new documentation for repository guidelines and improves test coverage for date formatting.

Packaging and Dependency Management

  • Migrated from Poetry to PEP 621-compliant pyproject.toml and switched the build backend to Hatchling, updating dependency and group specifications accordingly. (pyproject.toml) [1] [2]
  • Replaced Poetry with uv for dependency installation, publishing, and workflow automation in CI files (publish.yaml, tests.yaml), and removed the .tool-versions file. [1] [2] [3] [4] [5]

Development Workflow Modernization

  • Updated supported Python versions to 3.10 and above in CI and configuration, and adjusted matrix builds to include newer Python versions. [1] [2]
  • Added a comprehensive AGENTS.md with repository guidelines covering project structure, build/test commands, coding style, testing, commit/PR practices, and documentation standards.

Codebase Modernization

  • Refactored type annotations to use Python 3.10+ syntax (e.g., str | None), replaced legacy Union and Dict types, and updated imports for collections.abc. (wbdata/client.py, wbdata/cache.py) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
  • Improved cache handling by updating return types and removing unused imports. (wbdata/cache.py) [1] [2] [3]
  • Minor code improvements: added lru_cache to get_default_client, fixed pandas import fallback, and made SearchResult inherit from list instead of List. (wbdata/__init__.py, wbdata/client.py) [1] [2] [3]

Testing Improvements

  • Added parameterized tests for bad date inputs and improved coverage for date formatting. (tests/test_dates.py)
  • Updated test fetcher to use strict zip for response validation. (tests/test_fetcher.py)

These changes collectively modernize the project’s packaging and development practices, streamline dependency management, and improve code clarity and test coverage.

These changes contribute to #74 and #71

Copilot AI review requested due to automatic review settings October 5, 2025 13:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements caching for the default client to improve performance by avoiding unnecessary client instantiation. The change adds LRU caching to the get_default_client() function with a cache size of 1.

  • Adds @lru_cache(maxsize=1) decorator to cache the default client instance
  • Imports lru_cache from functools module

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@OliverSherouse OliverSherouse force-pushed the mac-cache branch 2 times, most recently from fa08f5a to d365767 Compare October 5, 2025 15:08
@OliverSherouse OliverSherouse requested a review from Copilot October 5, 2025 15:09
Copy link

Copilot AI left a comment

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 12 out of 14 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Repository owner deleted a comment from Copilot AI Oct 5, 2025
Allow sequences of length 2 for dates even though it should *really* be
a tuple.

Contributes to #71.

Signed-off-by: Oliver Sherouse <oliver@oliversherouse.com>
@OliverSherouse OliverSherouse changed the title fix: cache default client wbdata v1.1 Oct 5, 2025
@OliverSherouse OliverSherouse merged commit 9778ad5 into master Oct 5, 2025
15 checks passed
@OliverSherouse OliverSherouse deleted the mac-cache branch October 5, 2025 20:31
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.

1 participant

Comments