class ConfigDiscovery: (source)
Fill-in metadata and options that can be automatically derived (from other metadata/options, the file system or conventions)
Method | __call__ |
Automatically discover missing configuration fields and modifies the given ``distribution`` object in-place. |
Method | __init__ |
Undocumented |
Method | analyse |
The packages/modules are the essential contribution of the author. Therefore the name of the distribution can be derived from them. |
Instance Variable | dist |
Undocumented |
Method | _analyse |
The user can explicitly give a package layout via ``package_dir`` |
Method | _analyse |
Try to find all packages and modules under the project root. |
Method | _analyse |
Undocumented |
Method | _analyse |
Undocumented |
Method | _analyse |
Undocumented |
Method | _analyse |
Try to find all packages or modules under the ``src`` directory (or anything pointed by ``package_dir[""]``). |
Method | _disable |
Internal API to disable automatic discovery |
Method | _ensure |
Undocumented |
Method | _explicitly |
``True`` if the user has specified some form of package/module listing |
Method | _find |
Try to find the root package that is not a PEP 420 namespace |
Method | _find |
Exactly one module or package |
Method | _ignore |
Internal API to disregard ext_modules. |
Instance Variable | _called |
Undocumented |
Instance Variable | _disabled |
Undocumented |
Instance Variable | _skip |
Undocumented |
Property | _package |
Undocumented |
Property | _root |
Undocumented |
Automatically discover missing configuration fields and modifies the given ``distribution`` object in-place. Note that by default this will only have an effect the first time the ``ConfigDiscovery`` object is called. To repeatedly invoke automatic discovery (e.g. when the project directory changes), please use ``force=True`` (or create a new ``ConfigDiscovery`` instance).
The packages/modules are the essential contribution of the author. Therefore the name of the distribution can be derived from them.
Try to find all packages and modules under the project root. Since the ``flat-layout`` is more dangerous in terms of accidentally including extra files/directories, this function is more conservative and will raise an error if multiple packages or modules are found. This assumes that multi-package dists are uncommon and refuse to support that use case in order to be able to prevent unintended errors.
Try to find all packages or modules under the ``src`` directory (or anything pointed by ``package_dir[""]``). The "src-layout" is relatively safe for automatic discovery. We assume that everything within is meant to be included in the distribution. If ``package_dir[""]`` is not given, but the ``src`` directory exists, this function will set ``package_dir[""] = "src"``.
Internal API to disregard ext_modules. Normally auto-discovery would not be triggered if ``ext_modules`` are set (this is done for backward compatibility with existing packages relying on ``setup.py`` or ``setup.cfg``). However, ``setuptools`` can call this function to ignore given ``ext_modules`` and proceed with the auto-discovery if ``packages`` and ``py_modules`` are not given (e.g. when using pyproject.toml metadata).