afdko

AFDKO Command Wrapper Deprecation

What’s Changing

Starting in AFDKO 5.0, all tools should be invoked through the unified afdko <command> interface:

afdko makeotf -r
afdko tx -dump font.otf
afdko spot myFont.otf

Individual command wrappers (e.g., makeotf, tx, spot) are deprecated and will be removed in future releases.

Removal Timeline

Commands are divided into two groups based on usage:

Early Removal (6 months after 5.0 release)

Less commonly used commands:

Standard Removal (12 months after 5.0 release)

Commonly used, high-impact commands:

Controlling Warnings

By default, deprecated wrappers work silently. Control behavior with:

AFDKO_WRAPPER_MODE environment variable:

Examples:

# Default behavior - no warnings
spot myFont.otf

# See deprecation warnings
export AFDKO_WRAPPER_MODE=warn
spot myFont.otf
# Shows: DeprecationWarning: The 'spot' command wrapper is deprecated...

# Test strict migration
export AFDKO_WRAPPER_MODE=error
spot myFont.otf
# Exits with error

# Suppress warnings (useful for CI)
export AFDKO_WRAPPER_MODE=off
# Or use Python standard:
export PYTHONWARNINGS=ignore

Migration Guide

Recommended approach: Start using afdko <command> syntax now.

For scripts and automation:

  1. Update to afdko <command> syntax (future-proof)
  2. Or temporarily set AFDKO_WRAPPER_MODE=off to silence warnings

Testing your migration:

export AFDKO_WRAPPER_MODE=error
# Run your build scripts - any deprecated wrapper will cause an error

Rollout Phases

The deprecation will roll out in phases:

  1. Phase 1 (Initial release): Warnings opt-in (default: off)
    • Existing workflows continue unchanged
    • Early adopters can enable warnings
  2. Phase 2 (Near removal dates): Warnings default (default: warn)
    • Users made aware of upcoming removal
    • Can suppress with AFDKO_WRAPPER_MODE=off
  3. Phase 3 (At removal dates): Wrappers removed from package
    • Only afdko <command> interface remains

Implementation Summary (for developers)

The system is implemented in python/afdko/_deprecated.py and pyproject.toml:

Main advantage: Single constant change (DEFAULT_WRAPPER_MODE) advances entire deprecation timeline through phases.