1"""setuptools.errors 2 3Provides exceptions used by setuptools modules. 4""" 5 6from distutils import errors as _distutils_errors 7 8 9# Re-export errors from distutils to facilitate the migration to PEP632 10 11ByteCompileError = _distutils_errors.DistutilsByteCompileError 12CCompilerError = _distutils_errors.CCompilerError 13ClassError = _distutils_errors.DistutilsClassError 14CompileError = _distutils_errors.CompileError 15ExecError = _distutils_errors.DistutilsExecError 16FileError = _distutils_errors.DistutilsFileError 17InternalError = _distutils_errors.DistutilsInternalError 18LibError = _distutils_errors.LibError 19LinkError = _distutils_errors.LinkError 20ModuleError = _distutils_errors.DistutilsModuleError 21OptionError = _distutils_errors.DistutilsOptionError 22PlatformError = _distutils_errors.DistutilsPlatformError 23PreprocessError = _distutils_errors.PreprocessError 24SetupError = _distutils_errors.DistutilsSetupError 25TemplateError = _distutils_errors.DistutilsTemplateError 26UnknownFileError = _distutils_errors.UnknownFileError 27 28# The root error class in the hierarchy 29BaseError = _distutils_errors.DistutilsError 30 31 32class RemovedCommandError(BaseError, RuntimeError): 33 """Error used for commands that have been removed in setuptools. 34 35 Since ``setuptools`` is built on ``distutils``, simply removing a command 36 from ``setuptools`` will make the behavior fall back to ``distutils``; this 37 error is raised if a command exists in ``distutils`` but has been actively 38 removed in ``setuptools``. 39 """ 40 41 42class PackageDiscoveryError(BaseError, RuntimeError): 43 """Impossible to perform automatic discovery of packages and/or modules. 44 45 The current project layout or given discovery options can lead to problems when 46 scanning the project directory. 47 48 Setuptools might also refuse to complete auto-discovery if an error prone condition 49 is detected (e.g. when a project is organised as a flat-layout but contains 50 multiple directories that can be taken as top-level packages inside a single 51 distribution [*]_). In these situations the users are encouraged to be explicit 52 about which packages to include or to make the discovery parameters more specific. 53 54 .. [*] Since multi-package distributions are uncommon it is very likely that the 55 developers did not intend for all the directories to be packaged, and are just 56 leaving auxiliary code in the repository top-level, such as maintenance-related 57 scripts. 58 """ 59