Skip to content

improve: security, deps, quality, tests, docs#208

Merged
ozcan-durak merged 3 commits into
mainfrom
improve/security-deps-quality-tests-docs
Apr 28, 2026
Merged

improve: security, deps, quality, tests, docs#208
ozcan-durak merged 3 commits into
mainfrom
improve/security-deps-quality-tests-docs

Conversation

@ozcan-durak
Copy link
Copy Markdown
Contributor

  • Move Sentry DSN to env vars (MAPILIO_KIT_SENTRY_DSN, opt-in)
  • Add MAPILIO_KIT_DISABLE_TELEMETRY opt-out + configurable sample rates
  • Update security-critical deps (certifi, idna, urllib3, charset-normalizer)
  • Replace distutils.LooseVersion with packaging.version.Version
  • Bump Python requirement 3.6 -> 3.8
  • Resolve version.py TODO, bump 3.0.5 -> 3.0.6
  • Add pyproject.toml (ruff/black/pytest/coverage) + pre-commit hooks
  • Add 48 unit tests covering point/utilities/error/sentry-init
  • Add tests CI workflow (Python 3.9-3.12)
  • New docs: CLI.md, CONFIGURATION.md, ARCHITECTURE.md
  • Rewrite CONTRIBUTING.md, add docs links + Development section to README

Ozcan added 3 commits April 28, 2026 11:10
- Move Sentry DSN to env vars (MAPILIO_KIT_SENTRY_DSN, opt-in)
- Add MAPILIO_KIT_DISABLE_TELEMETRY opt-out + configurable sample rates
- Update security-critical deps (certifi, idna, urllib3, charset-normalizer)
- Replace distutils.LooseVersion with packaging.version.Version
- Bump Python requirement 3.6 -> 3.8
- Resolve version.py TODO, bump 3.0.5 -> 3.0.6
- Add pyproject.toml (ruff/black/pytest/coverage) + pre-commit hooks
- Add 48 unit tests covering point/utilities/error/sentry-init
- Add tests CI workflow (Python 3.9-3.12)
- New docs: CLI.md, CONFIGURATION.md, ARCHITECTURE.md
- Rewrite CONTRIBUTING.md, add docs links + Development section to README
…components import

- calculate_chunk_size: previously raised UnboundLocalError when video_size
  was below the threshold; now always returns a positive int. Extract
  DEFAULT_CHUNK_FRAMES and LARGE_VIDEO_CHUNK_FRAMES constants for clarity.
- get_exiftool_specific_feature: 'raise f"..."' is invalid in Python 3 and
  would itself crash with TypeError. Replaced with a proper RuntimeError
  chained from the original TypeError.
- mapilio_kit/components/__init__.py used to eagerly import general_arguments
  and edit_config. Those re-exports were unused; removing them drops importing
  any component submodule from ~267 ms / 444 modules to ~12 ms / 57 modules
  (~23x faster, ~7.8x fewer modules) and lets unit tests run without stubbing
  the entire pipeline.
- 4 new regression tests for calculate_chunk_size; full suite now 52 passing.
doctor: health-check the local environment
- Verifies Python version, ffmpeg/exiftool availability + version,
  free disk space, Mapilio credential state, telemetry config, and
  platform details. Each check is a pure function with injectable
  dependencies for hermetic unit tests.
- Output as colored text (default), plain text (--no-color), or JSON
  (--json). Exit 0/1/2 distinguishes OK/WARN/FAIL; --strict makes
  warnings fatal.

validate: pre-flight EXIF/GPS scan
- Walks an image directory read-only and reports missing GPS,
  invalid coordinates, missing timestamps, duplicate captures,
  suspicious (0,0) coords, and large GPS / time gaps. Configurable
  thresholds via --max_gps_gap_meters / --max_time_gap_seconds.
- Text or --json output, --strict for non-zero exit on warnings.

Wiring & tests:
- Both commands registered in FUNCTION_MAP and base/__init__.py
- arguments.general_arguments now skips forcing import_path on
  commands that manage their own arguments
- 43 new tests across tests/test_doctor.py and tests/test_validator.py
- README, docs/CLI.md, docs/ARCHITECTURE.md updated

Full suite: 95 passing.
@ozcan-durak ozcan-durak merged commit 2de0e23 into main Apr 28, 2026
4 checks passed
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.

2 participants