Skip to content

Apply some picky coding recommendations#300

Open
joanise wants to merge 3 commits intomainfrom
dev.ej/picky-coding
Open

Apply some picky coding recommendations#300
joanise wants to merge 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

joanise added 2 commits April 21, 2026 09:23
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.
@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

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.70%. Comparing base (4ae6d24) to head (9b9af60).

Files with missing lines Patch % Lines
tests/basic_test_case.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #300      +/-   ##
==========================================
+ Coverage   95.20%   95.70%   +0.49%     
==========================================
  Files          43       43              
  Lines        3674     3632      -42     
==========================================
- Hits         3498     3476      -22     
+ Misses        176      156      -20     

☔ 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.05
Pull Request HEAD: 9b9af6021b579fec2633cce878a53b185e1a46f2
No imports take more than 0.1 s.

@joanise joanise requested a review from roedoejet April 21, 2026 13:45
@joanise joanise requested a review from deltork April 21, 2026 21:50
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