summaryrefslogtreecommitdiff
path: root/setuptools/errors.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-05-09 10:42:04 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-05-09 10:42:56 -0400
commit9116c7eb52504bec77d26881d2c28e427dc52143 (patch)
tree6becb88401eb15bdff6fc924211894e6d9c277d1 /setuptools/errors.py
parent8d12d6196c369c7cf0164a1202e968dd68a2cb6c (diff)
parente009a87b5578cb16099b697ba8395c8f6bdd70f3 (diff)
downloadpython-setuptools-git-debt/remove-easy-install.tar.gz
Merge branch 'main' into debt/remove-easy-installdebt/remove-easy-install
Diffstat (limited to 'setuptools/errors.py')
-rw-r--r--setuptools/errors.py40
1 files changed, 29 insertions, 11 deletions
diff --git a/setuptools/errors.py b/setuptools/errors.py
index f4d35a63..ec7fb3b6 100644
--- a/setuptools/errors.py
+++ b/setuptools/errors.py
@@ -4,17 +4,6 @@ Provides exceptions used by setuptools modules.
"""
from distutils import errors as _distutils_errors
-from distutils.errors import DistutilsError
-
-
-class RemovedCommandError(DistutilsError, RuntimeError):
- """Error used for commands that have been removed in setuptools.
-
- Since ``setuptools`` is built on ``distutils``, simply removing a command
- from ``setuptools`` will make the behavior fall back to ``distutils``; this
- error is raised if a command exists in ``distutils`` but has been actively
- removed in ``setuptools``.
- """
# Re-export errors from distutils to facilitate the migration to PEP632
@@ -38,3 +27,32 @@ UnknownFileError = _distutils_errors.UnknownFileError
# The root error class in the hierarchy
BaseError = _distutils_errors.DistutilsError
+
+
+class RemovedCommandError(BaseError, RuntimeError):
+ """Error used for commands that have been removed in setuptools.
+
+ Since ``setuptools`` is built on ``distutils``, simply removing a command
+ from ``setuptools`` will make the behavior fall back to ``distutils``; this
+ error is raised if a command exists in ``distutils`` but has been actively
+ removed in ``setuptools``.
+ """
+
+
+class PackageDiscoveryError(BaseError, RuntimeError):
+ """Impossible to perform automatic discovery of packages and/or modules.
+
+ The current project layout or given discovery options can lead to problems when
+ scanning the project directory.
+
+ Setuptools might also refuse to complete auto-discovery if an error prone condition
+ is detected (e.g. when a project is organised as a flat-layout but contains
+ multiple directories that can be taken as top-level packages inside a single
+ distribution [*]_). In these situations the users are encouraged to be explicit
+ about which packages to include or to make the discovery parameters more specific.
+
+ .. [*] Since multi-package distributions are uncommon it is very likely that the
+ developers did not intend for all the directories to be packaged, and are just
+ leaving auxiliary code in the repository top-level, such as maintenance-related
+ scripts.
+ """