ยปCore Development>Code coverage>Lib/packaging/errors.py

Python code coverage for Lib/packaging/errors.py

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