Comparing cybeready:master...scanny:master · cybeready/python-pptx
Commits on Aug 3, 2024
-
build: move pptx package under src/
This improves packaging reliability because it prevents tests from running against the current directory instead of the installed version of the package.
-
dev: modernize dev environment
- Add `pyproject.toml` and gather configuration there. Move `.ruff.toml` contents into `pyproject.toml`. - Add `requirements-test.txt`.
-
Add type-annotations broadly, but prioritizing interface objects and methods. Adjust text-width to 100, remove Python 2 support, etc.
-
fix: scanny#972 next-slide-id fails when max used
scanny#972 Naive "max + 1" slide-id allocation algorithm assumed that slide-ids were assigned from bottom up. Apparently some client assigns slide ids from the top (2,147,483,647) down and the naive algorithm would assign an invalid slide-id in that case. Detect when the assigned id is out-of-range and fall-back to a robust algorithm for assigning a valid id based on a "first unused starting at bottom" policy.
-
fix: scanny#990 Turn off ZipFile strict_timestamps
Accommodate system dates before 1980-01-01. This should have no effect for users with "normal" system clocks but allows the package to save files in the unusual case the system clock is set to a date prior to 1980.
-
fix: scanny#929 raises on JPEG with image/jpg MIME-type
At least one client, perhaps Adobe PDF Converter, produces a PPTX with JPEG images mapped to the non-existent `image/jpg` MIME-type rather than the correct `image/jpeg`. Accept `image/jpg` as an alias for `image/jpeg`, which is consistent with the behavior of PowerPoint which loads these files without complaint.