Skip to content

Apply some picky coding recommendations#300

Merged
joanise merged 3 commits intomainfrom
dev.ej/picky-coding
Apr 28, 2026
Merged

Apply some picky coding recommendations#300
joanise merged 3 commits intomainfrom
dev.ej/picky-coding

Conversation

@joanise
Copy link
Copy Markdown
Member

@joanise joanise commented Apr 21, 2026

PR Goal?

Actually, the real goal is to push an update to main so that heroku integration, which was just cycled, gets exercised.

The changes applied are all things that are no longer needed with recent versions of python:

  • io.open instead of open (was useful for Python 2.6/2.7)
  • redundant file mode when we're using the default mode
  • "{}".format() instead of f-strings
  • __future__ imports where that future is now
  • -*- coding: utf-8 -*-

Also remove some dead code from utils.py flagged by codecov. That code was long-since unused.

Fixes?

picky details fixed by uvx ruff check --select UP --fix and a few manual fixups after

Feedback sought?

rubber stamping

Confidence?

high

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Apr 21, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  tests/basic_test_case.py  35% smaller
  readalongs/cli.py  35% smaller
  readalongs/api.py  20% smaller
  tests/test_g2p_cli.py  20% smaller
  tests/test_temp_file.py  10% smaller
  tests/test_align_cli.py  3% smaller
  readalongs/align.py  2% smaller
  readalongs/text/util.py  1% smaller
  readalongs/align_utils.py  0% smaller
  readalongs/epub/create_epub.py  0% smaller
  readalongs/waveform2svg/audio_util.py  0% smaller
  readalongs/waveform2svg/make_all_svgs.py  0% smaller
  readalongs/waveform2svg/pitch2svg.py  0% smaller
  readalongs/waveform2svg/waveform2svg.py  0% smaller
  tests/test_anchors.py  0% smaller
  tests/test_dtd.py  0% smaller
  tests/test_force_align.py  0% smaller
  tests/test_make_xml_cli.py  0% smaller
  tests/test_misc.py  0% smaller
  tests/test_tokenize_cli.py  0% smaller

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.76%. Comparing base (d72a390) to head (ccd917c).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #300      +/-   ##
==========================================
+ Coverage   92.77%   93.76%   +0.98%     
==========================================
  Files          21       21              
  Lines        1800     1765      -35     
  Branches      295      295              
==========================================
- Hits         1670     1655      -15     
+ Misses         93       73      -20     
  Partials       37       37              

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

CLI load time: 0:00.04
Pull Request HEAD: ccd917cde7deb9f90c1400247fa9702a494df026
No imports take more than 0.1 s.

@joanise joanise requested review from deltork and roedoejet April 21, 2026 13:45
Copy link
Copy Markdown
Collaborator

@roedoejet roedoejet left a comment

Choose a reason for hiding this comment

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

the future is now! rubber stamped

joanise added 3 commits April 28, 2026 08:20
Suggested by ruff/pyupgrade (UP020): https://docs.astral.sh/ruff/rules/open-alias/
io.open was needed in Python 2.6/2.7, just an alias of builtin open in
Python 3.
Ran uvx ruff check --select UP --fix
which applied the safe recommendations automatically.
@joanise joanise force-pushed the dev.ej/picky-coding branch from 9b9af60 to ccd917c Compare April 28, 2026 12:24
@joanise joanise merged commit ed7b565 into main Apr 28, 2026
8 checks passed
@joanise joanise deleted the dev.ej/picky-coding branch April 28, 2026 12:34
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.

2 participants