Skip to content

Accept empty arguments and deprecate option names with underscores - #1128

Merged
atztogo merged 1 commit into
mainfrom
deprecate-underscore-option-names
Nov 24, 2026
Merged

atztogo merged 1 commit into
mainfrom
deprecate-underscore-option-names

Conversation

@atztogo

@atztogo atztogo commented Nov 24, 2026

Copy link
Copy Markdown
Member

fix_deprecated_option_names read the first character of every
argument with v[0] and raised IndexError on an empty argument. Since
the parser factories pass sys.argv to it, the CLI tests failed when
pytest was run with -k ''. It now uses v.startswith("-").

Option names with underscores, which have been deprecated since
v1.12.2, will not be accepted in v5. The warning says so, the code that
goes away is marked with REMOVE-AT-V5, and the change is listed in
doc/migration-v5.md.

Fixes #1092. The fix was proposed by @rpinho in #1118.

fix_deprecated_option_names read the first character of every
argument and raised IndexError on an empty one, e.g. with pytest -k ''.
Option names with underscores will not be accepted in v5.
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.36%. Comparing base (d262865) to head (ffdbf65).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
phonopy/cui/phonopy_script.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1128   +/-   ##
=======================================
  Coverage   87.36%   87.36%           
=======================================
  Files         247      247           
  Lines       42533    42537    +4     
=======================================
+ Hits        37157    37164    +7     
+ Misses       5376     5373    -3     

☔ View full report in Codecov by Harness.
📢 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.

@atztogo
atztogo merged commit e2c8342 into main Nov 24, 2026
10 checks passed
@atztogo
atztogo deleted the deprecate-underscore-option-names branch November 24, 2026 06: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.

Many tests fail with: IndexError: string index out of range

1 participant