summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-02 18:28:42 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-03 20:49:50 +0100
commitd57e68b7208cb6e21b5ddd877e83477488a52121 (patch)
tree5689741d5adba951f3084af03d31605be436b160 /setuptools/command
parent266c38dcfc06abf0617c5e006fbc99f265242198 (diff)
downloadpython-setuptools-git-d57e68b7208cb6e21b5ddd877e83477488a52121.tar.gz
Add deprecation warning for compat editable mode
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/editable_wheel.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py
index 2fb4b07d..4110897d 100644
--- a/setuptools/command/editable_wheel.py
+++ b/setuptools/command/editable_wheel.py
@@ -33,10 +33,10 @@ from typing import (
Optional,
Tuple,
TypeVar,
- Union
+ Union,
)
-from setuptools import Command, errors, namespaces
+from setuptools import Command, SetuptoolsDeprecationWarning, errors, namespaces
from setuptools.discovery import find_package_path
from setuptools.dist import Distribution
@@ -62,6 +62,7 @@ class _EditableMode(Enum):
b) `strict` (requires a new installation when files are added/removed)
c) `compat` (attempts to replicate `python setup.py develop` - DEPRECATED)
"""
+
STRICT = "strict"
LENIENT = "lenient"
COMPAT = "compat" # TODO: Remove `compat` after Dec/2022.
@@ -75,6 +76,18 @@ class _EditableMode(Enum):
if _mode not in _EditableMode.__members__:
raise errors.OptionError(f"Invalid editable mode: {mode!r}. Try: 'strict'.")
+ if _mode == "COMPAT":
+ msg = """
+ The 'compat' editable mode is transitional and will be removed
+ in future versions of `setuptools`.
+ Please adapt your code accordingly to use either the 'strict' or the
+ 'lenient' modes.
+
+ For more information, please check:
+ https://setuptools.pypa.io/en/latest/userguide/development_mode.html
+ """
+ warnings.warn(msg, SetuptoolsDeprecationWarning)
+
return _EditableMode[_mode]