File: install.py

package info (click to toggle)
scikit-build 0.18.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,792 kB
  • sloc: python: 5,258; cpp: 284; makefile: 171; f90: 12; sh: 7
file content (27 lines) | stat: -rw-r--r-- 1,027 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""This module defines custom implementation of ``install`` setuptools
command."""

from __future__ import annotations

from typing import Any

from setuptools.command.install import install as _install

from . import CommandMixinProtocol, set_build_base_mixin


class install(set_build_base_mixin, _install):
    """Custom implementation of ``install`` setuptools command."""

    def finalize_options(self: CommandMixinProtocol, *args: Any, **kwargs: Any) -> None:
        """Ensure that if the distribution is non-pure, all modules
        are installed in ``self.install_platlib``.

        .. note:: `setuptools.dist.Distribution.has_ext_modules()`
           is overridden in :func:`..setuptools_wrap.setup()`.
        """
        if self.install_lib is None and self.distribution.has_ext_modules():  # type: ignore[attr-defined]
            # pylint:disable=attribute-defined-outside-init
            self.install_lib = self.install_platlib

        super().finalize_options(*args, **kwargs)  # type: ignore[safe-super]