Bug fixes, test suite, CI, and Nix flake - #2
Merged
Merged
Conversation
- add_song: delete macOS ._ files from the destination instead of the already-moved temp path (they were silently never deleted) - censor: create .censored/Pack/ before moving so the first censor of a pack no longer raises FileNotFoundError; resolve paths before the is_relative_to check - get_censored/uncensor: return []/raise UncensorException when .censored does not exist instead of crashing - extract: fix suffix whitelist (.gz/.tgz/.bz2 now accepted, duplicate .xz removed) and add missing f-string prefix on the error message - download_file: 30s request timeout; clear error when a Google Drive download fails instead of Path(None) TypeError - validate_response: accept application/octet-stream and x-zip-compressed; strip Content-Type parameters before comparing - get_download_filename: return str as annotated; strip path separators - config: reject empty root with a proper ConfigError; clear error when APPDATA is unset on Windows - CLI: remove duplicate Typer() construction; use ctx.invoked_subcommand instead of grepping sys.argv; explicit imports instead of import *; init-config overwrite prompt now defaults to No - declare requests, tqdm, and rich as direct dependencies (previously only present transitively); add uv.lock - update repository URLs after account rename; fix typos Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39 pytest tests covering add_pack (dir/zip/courses/overwrite), add_song (including a regression test for macOS file deletion), censor/uncensor roundtrips, archive extraction, response validation, download filename parsing, and config loading. No network access required. CI runs the suite on Ubuntu/Windows/macOS x Python 3.10-3.12 via uv, plus a ruff lint job. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Packages the three dependencies missing from nixpkgs (simfile, msdparser, pyrfc6266) from PyPI sdists with hashes taken from uv.lock, then builds itg-cli with buildPythonApplication. The test suite runs inside the build via pytestCheckHook. setuptools and pyparsing version pins are relaxed to match what nixpkgs ships; the fs pkg_resources deprecation warning is silenced in the wrapper so CLI output stays clean. Includes a dev shell with uv and Python 3.12. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
commands.py,_utils.py,_config.py, and__main__.py:add_songdeleted macOS._files from an already-moved temp path (silent no-op); now cleans the destinationcensorcrashed withFileNotFoundErrorwhen.censored/didn't exist yet;uncensor/get_censoredcrashed when nothing was censoredextracthad a broken suffix whitelist (duplicate.xz,.bzinstead of.bz2, no.gz) and a missing f-string prefix on its error messageroot = ''now raises a properConfigError; clear error whenAPPDATAis unsettyper.Typer()removed, explicit imports,ctx.invoked_subcommandinstead ofsys.argvgrepping, init-config overwrite prompt defaults to Norequests,tqdm,richwere only present transitively via gdown/typeruv.lockand a dev dependency groupsimfile,msdparser, andpyrfc6266from PyPI sdists (absent from nixpkgs), builds itg-cli with the test suite running in the build sandbox. Enablesnix run github:celex3/itg-cliBehavior changes to review
init-configoverwrite prompt now defaults to No (was Yes)Courses/PackNamefolders are no longer created for packs without coursesitg-cli.nixstub is superseded byflake.nixand can be deletedTest plan
uv run pytest- 39 passeduv run ruff check src tests- cleannix build+nix flake checkpass; built binary verified with a real add-pack / censor / uncensor roundtrip against a fake ITGmania install🤖 Generated with Claude Code