module documentation

Create a wheel that, when installed, will make the source package 'editable' (add it to the interpreter's path, including metadata) per PEP 660. Replaces 'setup.py develop'. .. note:: One of the mechanisms briefly mentioned in PEP 660 to implement editable installs is to create a separated directory inside ``build`` and use a .pth file to point to that directory. In the context of this file such directory is referred as *auxiliary build directory* or ``auxiliary_dir``.

Class editable_wheel Build 'editable' wheel for development. This command is private and reserved for internal use of setuptools, users should rely on ``setuptools.build_meta`` APIs.
Class EditableStrategy Undocumented
Class LinksNotSupported File system does not seem to support either symlinks or hard links.
Exception InformationOnly Currently there is no clear way of displaying messages to the users that use the setuptools backend directly via ``pip``. The only thing that might work is a warning, although it is not the most appropriate tool for the job...
Class _EditableMode Possible editable installation modes: `lenient` (new files automatically added to the package - DEFAULT); `strict` (requires a new installation when files are added/removed); or `compat` (attempts to emulate `python setup...
Class _LinkTree Creates a ``.pth`` file that points to a link tree in the ``auxiliary_dir``.
Class _NamespaceInstaller No class docstring; 0/6 instance variable, 2/3 methods documented
Class _StaticPth Undocumented
Class _TopLevelFinder Undocumented
Exception _DebuggingTips Undocumented
Function _absolute_root Works for packages and top-level modules
Function _can_symlink_files Undocumented
Function _empty_dir Create a directory ensured to be empty. Existing files may be removed.
Function _find_namespaces Undocumented
Function _find_package_roots Undocumented
Function _find_packages Undocumented
Function _find_top_level_modules Undocumented
Function _find_virtual_namespaces By carefully designing ``package_dir``, it is possible to implement the logical structure of PEP 420 in a package without the corresponding directories.
Function _finder_template Create a string containing the code for the``MetaPathFinder`` and ``PathEntryFinder``.
Function _is_nested Return ``True`` if ``pkg`` is nested inside ``parent`` both logically and in the file system. >>> _is_nested("a.b", "path/a/b", "a", "path/a") True >>> _is_nested("a.b", "path/a/b", "a", "otherpath/a") False >>> _is_nested("a...
Function _parent_path Infer the parent path containing a package, that if added to ``sys.path`` would allow importing that package. When ``pkg`` is directly mapped into a directory with a different name, return its own path...
Function _remove_nested Undocumented
Function _simple_layout Return ``True`` if: - all packages are contained by the same parent directory, **and** - all packages become importable if the parent directory is added to ``sys.path``.
Constant _FINDER_TEMPLATE Undocumented
Constant _LENIENT_WARNING Undocumented
Constant _STRICT_WARNING Undocumented
Type Variable _P Undocumented
Type Alias _Path Undocumented
Variable _logger Undocumented
def _absolute_root(path: _Path) -> str: (source)

Works for packages and top-level modules

def _can_symlink_files(base_dir: Path) -> bool: (source)

Undocumented

def _empty_dir(dir_: _P) -> _P: (source)

Create a directory ensured to be empty. Existing files may be removed.

def _find_namespaces(packages: List[str], pkg_roots: Dict[str, str]) -> Iterator[Tuple[str, List[str]]]: (source)

Undocumented

def _find_package_roots(packages: Iterable[str], package_dir: Mapping[str, str], src_root: _Path) -> Dict[str, str]: (source)

Undocumented

def _find_packages(dist: Distribution) -> Iterator[str]: (source)

Undocumented

def _find_top_level_modules(dist: Distribution) -> Iterator[str]: (source)

Undocumented

def _find_virtual_namespaces(pkg_roots: Dict[str, str]) -> Iterator[str]: (source)

By carefully designing ``package_dir``, it is possible to implement the logical structure of PEP 420 in a package without the corresponding directories. Moreover a parent package can be purposefully/accidentally skipped in the discovery phase (e.g. ``find_packages(include=["mypkg.*"])``, when ``mypkg.foo`` is included by ``mypkg`` itself is not). We consider this case to also be a virtual namespace (ignoring the original directory) to emulate a non-editable installation. This function will try to find these kinds of namespaces.

def _finder_template(name: str, mapping: Mapping[str, str], namespaces: Dict[str, List[str]]) -> str: (source)

Create a string containing the code for the``MetaPathFinder`` and ``PathEntryFinder``.

def _is_nested(pkg: str, pkg_path: str, parent: str, parent_path: str) -> bool: (source)

Return ``True`` if ``pkg`` is nested inside ``parent`` both logically and in the file system. >>> _is_nested("a.b", "path/a/b", "a", "path/a") True >>> _is_nested("a.b", "path/a/b", "a", "otherpath/a") False >>> _is_nested("a.b", "path/a/b", "c", "path/c") False >>> _is_nested("a.a", "path/a/a", "a", "path/a") True >>> _is_nested("b.a", "path/b/a", "a", "path/a") False

def _parent_path(pkg, pkg_path): (source)

Infer the parent path containing a package, that if added to ``sys.path`` would allow importing that package. When ``pkg`` is directly mapped into a directory with a different name, return its own path. >>> _parent_path("a", "src/a") 'src' >>> _parent_path("b", "src/c") 'src/c'

def _remove_nested(pkg_roots: Dict[str, str]) -> Dict[str, str]: (source)

Undocumented

def _simple_layout(packages: Iterable[str], package_dir: Dict[str, str], project_dir: Path) -> bool: (source)

Return ``True`` if: - all packages are contained by the same parent directory, **and** - all packages become importable if the parent directory is added to ``sys.path``. >>> _simple_layout(['a'], {"": "src"}, "/tmp/myproj") True >>> _simple_layout(['a', 'a.b'], {"": "src"}, "/tmp/myproj") True >>> _simple_layout(['a', 'a.b'], {}, "/tmp/myproj") True >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"": "src"}, "/tmp/myproj") True >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "a", "b": "b"}, ".") True >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a", "b": "_b"}, ".") False >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a"}, "/tmp/myproj") False >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a.a1.a2": "_a2"}, ".") False >>> _simple_layout(['a', 'a.b'], {"": "src", "a.b": "_ab"}, "/tmp/myproj") False >>> # Special cases, no packages yet: >>> _simple_layout([], {"": "src"}, "/tmp/myproj") True >>> _simple_layout([], {"a": "_a", "": "src"}, "/tmp/myproj") False

_FINDER_TEMPLATE: str = (source)

Undocumented

Value
'''import sys
from importlib.machinery import ModuleSpec
from importlib.machinery import all_suffixes as module_suffixes
from importlib.util import spec_from_file_location
from itertools import chain
from pathlib import Path

...
_LENIENT_WARNING: str = (source)

Undocumented

Value
'''
Options like `package-data`, `include/exclude-package-data` or
`packages.find.exclude/include` may have no effect.
'''
_STRICT_WARNING: str = (source)

Undocumented

Value
'''
New or renamed files may not be automatically picked up without a new installati
on.
'''

Undocumented

Value
TypeVar('_P',
        bound=_Path)

Undocumented

Value
Union[str, Path]

Undocumented