Add PyYAML as optional dependency [skip ci]