Skip to content

Commit 4ac01e9

Browse files
authored
Modernization and cleanup (#86)
This PR completely restructures the MediaFile library from a single monolithic file into a modular, maintainable package architecture. The core functionality remains unchanged while improving code organization, readability, and future maintainability. ## **Architectural Restructuring** - **Split monolithic `mediafile.py`** (2342 lines) into logical modules: - `mediafile/__init__.py` - Main MediaFile class and public API - `mediafile/constants.py` - Constants and enums (TYPES, ImageType) - `mediafile/exceptions.py` - Custom exception hierarchy - `mediafile/fields.py` - Field descriptor classes (MediaField, DateField, etc.) - `mediafile/storage/` - Format-specific storage strategies - `mediafile/utils/` - Utility functions and helpers ## **Build System & Dependencies** - **Updated to modern Python packaging** with `pyproject.toml` - **Dropped Python 3.7 and 3.8 support** - now requires Python ≥3.9 - **Updated dependency specifications** and modernized build configuration - **Removed Tox** in favor of plain GitHub Actions for testing - **New version**: `1.0.0-alpha.1` - reflecting the significant architectural changes - **Coverage**: Code test coverage is now uploaded as artifact (maybe we want to switch to codecov at some point)
2 parents 1d1fa38 + 3bb85f5 commit 4ac01e9

20 files changed

+2567
-2353
lines changed

.git-blame-ignore-revs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
# Migrated to ruff
2-
7ff9d471b23c45b6d957e7507035af39885546ab
1+
# Moved changelog into its own file and added changelog reminder.
2+
7ff9d471b23c45b6d957e7507035af39885546ab
3+
# Removed flask8 in favor of ruff.
4+
226e455a5605cf70a4387ba6a17da85d41c6ce87
5+
6+
# Moved mediafile.py into mediafile/__init__.py to allow easier refactoring.
7+
4d508f94aef6976162993b7d92dc2347120ee306
8+
# Moved exceptions into own file.
9+
075749781172208a6ce6bfda0e31e9ab6e42f340
10+
# Modernized exceptions and added common type.
11+
891eef5b2d117b07dd74b17fb84e509db9c24f4c
12+
# Moved constants into own file.
13+
9470f8e4d7b3bd17372d6c82aa19834f2148a795
14+
# Moved storage classes into own files and folder.
15+
146a462e44e0bd4efa4f67a06378686adc8d38b4
16+
# Moved field classes to own file.
17+
80145c8c2e0a031c1d4da7a872ca200cc0e2d3af
18+
# Moved afs unpack util functions to asf module.
19+
5bfd2cb144ce618c7a8fff7a713addc661bd7465
20+
# Moved mutagen util functions
21+
28f336523d26f8ba1d3996c9b90ae5b8c8411b5d
22+
# Moved soundcheck util functions into own file.
23+
8a1769f9731cc9aec44c707b07941ce3824e6e0b
24+
# Moved image util functions into own file
25+
184f59c727612978e7c5f64ff24e07019094599e
26+
# Moved safecast util functions.
27+
a5b5c6c8ff61b0271df36e17633c34503f1de189
28+
# Fixed imports
29+
bb3857d297596b589302c9d7b4bd166e5184a59b

0 commit comments

Comments
 (0)