Similar to what https://github.com/pypa/packaging/issues/885 has done. We should have support for that to better integrate with other lock formats (if necessary).