Skip to content

Add pyupgrade to git hooks#598

Open
ulgens wants to merge 2 commits intojoke2k:developfrom
ulgens:pyupgrade
Open

Add pyupgrade to git hooks#598
ulgens wants to merge 2 commits intojoke2k:developfrom
ulgens:pyupgrade

Conversation

@ulgens
Copy link
Copy Markdown
Contributor

@ulgens ulgens commented Feb 22, 2026

Add pyupgrade to git hooks and apply related fixes.

Resolves #597

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 22, 2026

Coverage Status

coverage: 97.348%. remained the same — ulgens:pyupgrade into joke2k:develop

Copy link
Copy Markdown

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 applies pyupgrade-style modernizations intended for Python 3.9+ (per #597), primarily replacing older string formatting and updating type annotations/imports to more modern equivalents.

Changes:

  • Replace str.format(...) / % formatting with f-strings across tests and packaging code.
  • Simplify typing usage in environ/environ.py by removing unused typing imports and using built-in collection types in return annotations.
  • Remove redundant Python 3 unicode literal prefixes (u"...") in Sphinx configuration.

Reviewed changes

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

Show a summary per file
File Description
tests/test_search.py Converts URL construction/assertions to f-strings for readability and py39+ style.
tests/test_path.py Updates Windows-path string expectations to f-strings.
tests/test_cache.py Converts cache URL test strings to f-strings while preserving test intent.
setup.py Modernizes error formatting and regex construction via f-strings / raw f-strings.
environ/environ.py Removes unused typing imports and updates return annotations to built-in types.
docs/conf.py Removes unnecessary u"" prefixes from string literals.

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

@ulgens ulgens force-pushed the pyupgrade branch 2 times, most recently from 4ec7a93 to 6c437ca Compare April 19, 2026 13:49
@ulgens ulgens changed the title Apply pyupgrade fixes for py39-plus Add pyupgrade to git hooks Apr 19, 2026
@ulgens ulgens marked this pull request as ready for review April 19, 2026 14:03
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.

pyupgrade usage

3 participants