module documentation

A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module.

Class Distribution No class docstring; 0/1 method, 1/1 class method documented
Exception SetupRequirementsError Undocumented
Function no_install_setup_requires Temporarily disable installing setup_requires
Function suppress_known_deprecation Undocumented
Constant LEGACY_EDITABLE Undocumented
Constant SETUPTOOLS_ENABLE_FEATURES Undocumented
Variable __legacy__ Undocumented
Class _BuildMetaBackend No class docstring; 1/14 method documented
Class _BuildMetaLegacyBackend Compatibility backend for setuptools
Class _ConfigSettingsTranslator Translate ``config_settings`` into distutils-style command arguments. Only a limited number of options is currently supported.
Function _file_with_extension Undocumented
Function _get_immediate_subdirectories Undocumented
Function _open_setup_script Undocumented
Constant _BACKEND Undocumented
Type Alias _ConfigSettings Currently the user can run::
@contextlib.contextmanager
def no_install_setup_requires(): (source)

Temporarily disable installing setup_requires Under PEP 517, the backend reports build dependencies to the frontend, and the frontend is responsible for ensuring they're installed. So setuptools (acting as a backend) should not try to install them.

@contextlib.contextmanager
def suppress_known_deprecation(): (source)

Undocumented

LEGACY_EDITABLE = (source)

Undocumented

Value
('legacy-editable' in SETUPTOOLS_ENABLE_FEATURES.replace('_', '-'))
SETUPTOOLS_ENABLE_FEATURES = (source)

Undocumented

Value
os.getenv('SETUPTOOLS_ENABLE_FEATURES', '').lower()
__legacy__ = (source)

Undocumented

def _file_with_extension(directory, extension): (source)

Undocumented

def _get_immediate_subdirectories(a_dir): (source)

Undocumented

def _open_setup_script(setup_script): (source)

Undocumented

_BACKEND = (source)

Undocumented

Value
_BuildMetaBackend()
_ConfigSettings = (source)

Currently the user can run:: pip install -e . --config-settings key=value python -m build -C--key=value -C key=value - pip will pass both key and value as strings and overwriting repeated keys (pypa/pip#11059). - build will accumulate values associated with repeated keys in a list. It will also accept keys with no associated value. This means that an option passed by build can be ``str | list[str] | None``. - PEP 517 specifies that ``config_settings`` is an optional dict.

Value
Optional[Dict[str, Union[str, List[str], None]]]