errors.py 2.6 KB

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