diff --git a/.gitignore b/.gitignore index f1ea4ba..c18a9cd 100644 --- a/.gitignore +++ b/.gitignore @@ -197,3 +197,5 @@ cython_debug/ .vscode/ Makefile + +project_dump.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index d739b6f..45f6aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,19 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [1.0.3] - 2025-12-26 + +### Removed +- Index parsing stdout warning. + +### Changed +- The track field type of TrackData from *int|None* to *int*, and now it is mandatory in the model. + ## [1.0.2] - 2025-12-18 ### Added -- py.typed that should allow MyPy to correctly analyse custom types. -- seconds property in the FrameTime. +- py.typed file that should allow MyPy to correctly analyse custom types. +- Seconds property in the FrameTime. ### Fixed - CHANGELOG versions diff link. @@ -96,7 +104,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Dataclasses for data models. -[Unreleased]: https://github.com/Olezhich/CueTools/compare/v1.0.2...main +[Unreleased]: https://github.com/Olezhich/CueTools/compare/v1.0.3...main +[1.0.3]: https://github.com/Olezhich/CueTools/compare/v1.0.2...v1.0.3 [1.0.2]: https://github.com/Olezhich/CueTools/compare/v1.0.1...v1.0.2 [1.0.1]: https://github.com/Olezhich/CueTools/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/Olezhich/CueTools/compare/v0.1.5...v1.0.0 diff --git a/cuetools/models.py b/cuetools/models.py index 226980b..67c0a32 100644 --- a/cuetools/models.py +++ b/cuetools/models.py @@ -17,8 +17,7 @@ class TrackData(BaseModel): file: Path = Field( description='Path to the audio file with this track (to flac, ape or etc.) relative to the cue sheet file', ) - track: int | None = Field( - default=None, + track: int = Field( description="Track number, corresponds to the line like *'TRACK 01 AUDIO'*", ) title: str | None = Field(default=None, description='Track title') diff --git a/cuetools/parser/parser.py b/cuetools/parser/parser.py index 0150532..6b3619f 100644 --- a/cuetools/parser/parser.py +++ b/cuetools/parser/parser.py @@ -208,7 +208,6 @@ def load_f_iter(cue: Iterator[str], strict_title_case: bool = False) -> AlbumDat current_track.index00 = tokens[1].lexeme # type: ignore[assignment] elif index_type == 1: current_track.index01 = tokens[1].lexeme # type: ignore[assignment] - print('INDEX WARN:: ', tokens[1].lexeme, current_track.index01) case _: raise CueParseError( current_line, diff --git a/pyproject.toml b/pyproject.toml index b60a302..194bd32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cuetools" -version = "1.0.2" +version = "1.0.3" description = "Lightweight CUE sheet toolkit for Python" authors = [ {name = "Olezhich"} diff --git a/tests/test_parser.py b/tests/test_parser.py index 5f9ac53..67a2f5e 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -126,3 +126,10 @@ def test_line_parsing(): INDEX 01 00:00:65""" cue = cuetools.loads(cue_sheet) logger.debug(cue) + + cue_sheet = """FILE "track.flac" WAVE + INDEX 00 00:00:50 + INDEX 01 00:00:65""" + with pytest.raises(cuetools.CueParseError) as e: + cuetools.loads(cue_sheet) + logger.debug(str(e.value)) diff --git a/tests/test_types.py b/tests/test_types.py index 5cb86bd..5df1e72 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -7,7 +7,7 @@ def test_FrameTime(): - track = TrackData(index00='01:50:05', index01=9000, file=Path('/')) # type: ignore + track = TrackData(index00='01:50:05', index01=9000, file=Path('/'), track=1) # type: ignore assert track.index00.frames == 8255, 'using string to FrameTime cast' # type: ignore assert track.index01.string == '02:00:00', 'using int to FrameTime cast'