Import Mappings¶
The plugin maps import names to PyPI package names automatically.
By default, it converts underscores to dashes (e.g. my_package ->
my-package). For packages where the import name differs from the
PyPI name, a built-in mapping table is used.
Built-in Mappings¶
Import Name |
PyPI Package |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Adding Custom Mappings¶
Use pep723_extra_mappings in pyproject.toml:
[tool.pytest.ini_options]
pep723_extra_mappings =
myspecial=my-special-pkg
Default Normalization¶
For imports not in the mapping table, the plugin normalizes by:
Converting underscores to dashes (
my_package->my-package)Lowercasing (
MyPackage->mypackage)
This matches the most common PyPI naming convention.