Hello. In Fedora, we’ve recently started to deal with Python extras. For Python package names, we already generate RPM Provides and Requires in a form of:
python3.Xdist(<normalized_package_name>)
E.g.:
python3.9dist(sectuptools-scm)
Those are used on RPM level to bring in the required packages. It works reasonably well.
We follow the normalizing rules from PEP 503. It is crucial to us that the names are normalized, because on RPM level, sectuptools-scm != sectuptools_scm
. By using the normalized form for both Provides and Requires, we don’t have this problem.
We have recently started to generate such RPM Provides and Requires for extras as well, in a form of:
python3.Xdist(<normalized_package_name>[<extras_name>])
E.g.
python3.9dist(sectuptools-scm[toml])
Everything worked well
Until we started to deal with case sensitivity, underscores and such. It appears that pip treats dnspython[DNSSEC]
and dnspython[dnssec]
equally (good!), but it does not treat webscrapbook[adhoc_ssl]
and webscrapbook[adhoc-ssl]
equally
What are the normalize rules for extras names and where are they defined? And if they are undefined, should they be defined? Would re-using the same normalizing function that exists for package names make sense?
Thanks.