| 1 | n/a | """Exceptions used throughout the package. |
|---|
| 2 | n/a | |
|---|
| 3 | n/a | Submodules of packaging may raise exceptions defined in this module as |
|---|
| 4 | n/a | well as standard exceptions; in particular, SystemExit is usually raised |
|---|
| 5 | n/a | for errors that are obviously the end-user's fault (e.g. bad |
|---|
| 6 | n/a | command-line arguments). |
|---|
| 7 | n/a | """ |
|---|
| 8 | n/a | |
|---|
| 9 | n/a | |
|---|
| 10 | n/a | class PackagingError(Exception): |
|---|
| 11 | n/a | """The root of all Packaging evil.""" |
|---|
| 12 | n/a | |
|---|
| 13 | n/a | |
|---|
| 14 | n/a | class PackagingModuleError(PackagingError): |
|---|
| 15 | n/a | """Unable to load an expected module, or to find an expected class |
|---|
| 16 | n/a | within some module (in particular, command modules and classes).""" |
|---|
| 17 | n/a | |
|---|
| 18 | n/a | |
|---|
| 19 | n/a | class PackagingClassError(PackagingError): |
|---|
| 20 | n/a | """Some command class (or possibly distribution class, if anyone |
|---|
| 21 | n/a | feels a need to subclass Distribution) is found not to be holding |
|---|
| 22 | n/a | up its end of the bargain, ie. implementing some part of the |
|---|
| 23 | n/a | "command "interface.""" |
|---|
| 24 | n/a | |
|---|
| 25 | n/a | |
|---|
| 26 | n/a | class PackagingGetoptError(PackagingError): |
|---|
| 27 | n/a | """The option table provided to 'fancy_getopt()' is bogus.""" |
|---|
| 28 | n/a | |
|---|
| 29 | n/a | |
|---|
| 30 | n/a | class PackagingArgError(PackagingError): |
|---|
| 31 | n/a | """Raised by fancy_getopt in response to getopt.error -- ie. an |
|---|
| 32 | n/a | error in the command line usage.""" |
|---|
| 33 | n/a | |
|---|
| 34 | n/a | |
|---|
| 35 | n/a | class PackagingFileError(PackagingError): |
|---|
| 36 | n/a | """Any problems in the filesystem: expected file not found, etc. |
|---|
| 37 | n/a | Typically this is for problems that we detect before IOError or |
|---|
| 38 | n/a | OSError could be raised.""" |
|---|
| 39 | n/a | |
|---|
| 40 | n/a | |
|---|
| 41 | n/a | class PackagingOptionError(PackagingError): |
|---|
| 42 | n/a | """Syntactic/semantic errors in command options, such as use of |
|---|
| 43 | n/a | mutually conflicting options, or inconsistent options, |
|---|
| 44 | n/a | badly-spelled values, etc. No distinction is made between option |
|---|
| 45 | n/a | values originating in the setup script, the command line, config |
|---|
| 46 | n/a | files, or what-have-you -- but if we *know* something originated in |
|---|
| 47 | n/a | the setup script, we'll raise PackagingSetupError instead.""" |
|---|
| 48 | n/a | |
|---|
| 49 | n/a | |
|---|
| 50 | n/a | class PackagingSetupError(PackagingError): |
|---|
| 51 | n/a | """For errors that can be definitely blamed on the setup script, |
|---|
| 52 | n/a | such as invalid keyword arguments to 'setup()'.""" |
|---|
| 53 | n/a | |
|---|
| 54 | n/a | |
|---|
| 55 | n/a | class PackagingPlatformError(PackagingError): |
|---|
| 56 | n/a | """We don't know how to do something on the current platform (but |
|---|
| 57 | n/a | we do know how to do it on some platform) -- eg. trying to compile |
|---|
| 58 | n/a | C files on a platform not supported by a CCompiler subclass.""" |
|---|
| 59 | n/a | |
|---|
| 60 | n/a | |
|---|
| 61 | n/a | class PackagingExecError(PackagingError): |
|---|
| 62 | n/a | """Any problems executing an external program (such as the C |
|---|
| 63 | n/a | compiler, when compiling C files).""" |
|---|
| 64 | n/a | |
|---|
| 65 | n/a | |
|---|
| 66 | n/a | class PackagingInternalError(PackagingError): |
|---|
| 67 | n/a | """Internal inconsistencies or impossibilities (obviously, this |
|---|
| 68 | n/a | should never be seen if the code is working!).""" |
|---|
| 69 | n/a | |
|---|
| 70 | n/a | |
|---|
| 71 | n/a | class PackagingTemplateError(PackagingError): |
|---|
| 72 | n/a | """Syntax error in a file list template.""" |
|---|
| 73 | n/a | |
|---|
| 74 | n/a | |
|---|
| 75 | n/a | class PackagingPyPIError(PackagingError): |
|---|
| 76 | n/a | """Any problem occuring during using the indexes.""" |
|---|
| 77 | n/a | |
|---|
| 78 | n/a | |
|---|
| 79 | n/a | # Exception classes used by the CCompiler implementation classes |
|---|
| 80 | n/a | class CCompilerError(Exception): |
|---|
| 81 | n/a | """Some compile/link operation failed.""" |
|---|
| 82 | n/a | |
|---|
| 83 | n/a | |
|---|
| 84 | n/a | class PreprocessError(CCompilerError): |
|---|
| 85 | n/a | """Failure to preprocess one or more C/C++ files.""" |
|---|
| 86 | n/a | |
|---|
| 87 | n/a | |
|---|
| 88 | n/a | class CompileError(CCompilerError): |
|---|
| 89 | n/a | """Failure to compile one or more C/C++ source files.""" |
|---|
| 90 | n/a | |
|---|
| 91 | n/a | |
|---|
| 92 | n/a | class LibError(CCompilerError): |
|---|
| 93 | n/a | """Failure to create a static library from one or more C/C++ object |
|---|
| 94 | n/a | files.""" |
|---|
| 95 | n/a | |
|---|
| 96 | n/a | |
|---|
| 97 | n/a | class LinkError(CCompilerError): |
|---|
| 98 | n/a | """Failure to link one or more C/C++ object files into an executable |
|---|
| 99 | n/a | or shared library file.""" |
|---|
| 100 | n/a | |
|---|
| 101 | n/a | |
|---|
| 102 | n/a | class UnknownFileError(CCompilerError): |
|---|
| 103 | n/a | """Attempt to process an unknown file type.""" |
|---|
| 104 | n/a | |
|---|
| 105 | n/a | |
|---|
| 106 | n/a | class MetadataMissingError(PackagingError): |
|---|
| 107 | n/a | """A required metadata is missing""" |
|---|
| 108 | n/a | |
|---|
| 109 | n/a | |
|---|
| 110 | n/a | class MetadataConflictError(PackagingError): |
|---|
| 111 | n/a | """Attempt to read or write metadata fields that are conflictual.""" |
|---|
| 112 | n/a | |
|---|
| 113 | n/a | |
|---|
| 114 | n/a | class MetadataUnrecognizedVersionError(PackagingError): |
|---|
| 115 | n/a | """Unknown metadata version number.""" |
|---|
| 116 | n/a | |
|---|
| 117 | n/a | |
|---|
| 118 | n/a | class IrrationalVersionError(Exception): |
|---|
| 119 | n/a | """This is an irrational version.""" |
|---|
| 120 | n/a | pass |
|---|
| 121 | n/a | |
|---|
| 122 | n/a | |
|---|
| 123 | n/a | class HugeMajorVersionNumError(IrrationalVersionError): |
|---|
| 124 | n/a | """An irrational version because the major version number is huge |
|---|
| 125 | n/a | (often because a year or date was used). |
|---|
| 126 | n/a | |
|---|
| 127 | n/a | See `error_on_huge_major_num` option in `NormalizedVersion` for details. |
|---|
| 128 | n/a | This guard can be disabled by setting that option False. |
|---|
| 129 | n/a | """ |
|---|
| 130 | n/a | pass |
|---|
| 131 | n/a | |
|---|
| 132 | n/a | |
|---|
| 133 | n/a | class InstallationException(Exception): |
|---|
| 134 | n/a | """Base exception for installation scripts""" |
|---|
| 135 | n/a | |
|---|
| 136 | n/a | |
|---|
| 137 | n/a | class InstallationConflict(InstallationException): |
|---|
| 138 | n/a | """Raised when a conflict is detected""" |
|---|