Commit 4b6cb48
committed
python: Replace deprecated setup.py with pypa/build+pip
When setuptools>58.2.0 setup.py installation is a deprecated method, a warning
message will be prompted [1]:
$ sudo make install
....
running install
/usr/lib/python3.13/site-packages/setuptools/_distutils/cmd.py:66:
SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
/usr/lib/python3.13/site-packages/setuptools/_distutils/cmd.py:66:
EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See pypa/setuptools#917 for details.
********************************************************************************
!!
self.initialize_options()
Use the recommended solution [2] to replace setup.py with pypa/build and
pip-install to completely solve the problem. It is worth noting that under
Debian, you need to add the --break-system-packages parameter to pip-uninstall,
as shown in the following prompt:
Debian12:~$ sudo pip3 uninstall bcc
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python
installation or OS distribution provider. You can override this, at the
risk of breaking your Python installation or OS, by passing
--break-system-packages.
hint: See PEP 668 for the detailed specification.
# Successfully uninstalled
Debian12:~$ sudo pip3 uninstall bcc --break-system-packages
Fix: #4586 [1]
Link: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html [2]
Cc: Jerome Marchand <[email protected]>
Cc: Hengqi Chen <[email protected]>
Signed-off-by: Rong Tao <[email protected]>1 parent f55a2f6 commit 4b6cb48
File tree
3 files changed
+22
-15
lines changed- cmake
- src/python
3 files changed
+22
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
237 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
238 | 245 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 4 | | |
13 | 5 | | |
14 | 6 | | |
| |||
27 | 19 | | |
28 | 20 | | |
29 | 21 | | |
30 | | - | |
| 22 | + | |
31 | 23 | | |
32 | 24 | | |
33 | | - | |
| 25 | + | |
34 | 26 | | |
35 | 27 | | |
36 | | - | |
| 28 | + | |
37 | 29 | | |
38 | 30 | | |
39 | 31 | | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
43 | 35 | | |
| 36 | + | |
44 | 37 | | |
45 | 38 | | |
46 | 39 | | |
47 | | - | |
48 | | - | |
| 40 | + | |
| 41 | + | |
49 | 42 | | |
50 | 43 | | |
0 commit comments