Skip to content

Fix NameError: rename RequestRate to Rate and deprecate Python 3.8/3.9 - #89

Merged
njzjz merged 5 commits into
masterfrom
copilot/sub-pr-88
Feb 14, 2026
Merged

Fix NameError: rename RequestRate to Rate and deprecate Python 3.8/3.9#89
njzjz merged 5 commits into
masterfrom
copilot/sub-pr-88

Conversation

Copilot AI commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

The import statement was changed to remove RequestRate, but line 35 still referenced it, causing a runtime NameError. Additionally, Python 3.8 and 3.9 support has been deprecated, with the minimum Python version now set to 3.10.

Changes:

  • Added Rate to imports from pyrate_limiter
  • Updated arxiv adapter to use Rate instead of RequestRate
  • Removed Python 3.8 and 3.9 from package classifiers in pyproject.toml
  • Updated requires-python to >=3.10 in pyproject.toml
  • Updated GitHub Actions test workflow to test with Python 3.10 and 3.13
  • Updated README.md to reflect minimum Python version requirement of 3.10
# Before (broken)
from pyrate_limiter import Duration, Limiter
adapter_arxiv = LimiterAdapter(
    limiter=Limiter(RequestRate(1, Duration.SECOND * 3)), ...  # NameError
)

# After
from pyrate_limiter import Duration, Limiter, Rate
adapter_arxiv = LimiterAdapter(
    limiter=Limiter(Rate(1, Duration.SECOND * 3)), ...
)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
@njzjz
njzjz changed the base branch from njzjz-patch-1 to master February 14, 2026 09:50
@njzjz
njzjz marked this pull request as ready for review February 14, 2026 09:51
Copilot AI review requested due to automatic review settings February 14, 2026 09:51
Copilot AI changed the title [WIP] WIP Rename RequestRate to Rate in import statements Fix NameError: rename RequestRate to Rate in session.py Feb 14, 2026
Copilot AI requested a review from njzjz February 14, 2026 09:52

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

This WIP pull request updates the import and usage of RequestRate to Rate from the pyrate_limiter library, reflecting an API change in the library. The change only affects the rate limiting configuration for the arXiv API adapter.

Changes:

  • Updated import statement to use Rate instead of RequestRate from pyrate_limiter
  • Updated the arXiv adapter configuration to use Rate instead of RequestRate

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

@njzjz

njzjz commented Feb 14, 2026

Copy link
Copy Markdown
Owner

@copilot Deprecate Python 3.8 and 3.9. The minimal Python version is now 3.10.

Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>

Copilot AI commented Feb 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Deprecate Python 3.8 and 3.9. The minimal Python version is now 3.10.

Done! I've deprecated Python 3.8 and 3.9. The minimal Python version is now 3.10. Updated pyproject.toml classifiers, requires-python field, GitHub Actions test workflow, and README.md. (commit dc0adb2)

Copilot AI changed the title Fix NameError: rename RequestRate to Rate in session.py Fix NameError: rename RequestRate to Rate and deprecate Python 3.8/3.9 Feb 14, 2026
@njzjz njzjz closed this Feb 14, 2026
@njzjz njzjz reopened this Feb 14, 2026
@codecov

codecov Bot commented Feb 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.10%. Comparing base (71ec7a6) to head (dc0adb2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
- Coverage   87.58%   87.10%   -0.49%     
==========================================
  Files          13       12       -1     
  Lines         580      504      -76     
==========================================
- Hits          508      439      -69     
+ Misses         72       65       -7     

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

@njzjz
njzjz merged commit 23a913d into master Feb 14, 2026
14 of 15 checks passed
@njzjz
njzjz deleted the copilot/sub-pr-88 branch February 14, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants