Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning when installed as dependency of snapm via "python3 setup.py install" #49

Open
bmr-cymru opened this issue Jun 20, 2024 · 2 comments

Comments

@bmr-cymru
Copy link
Collaborator

From snapshotmanager/snapm#48:

If boom is installed as a dependency via python3 setup.py install we end up with a deprecation warning from boom:

root@localhost:~/src/git/snapm# python3 setup.py install
/usr/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsWarning: `install_requires` overwritten in `pyproject.toml` (dependencies)
  corresp(dist, value, root_dir)
running install
/usr/lib/python3.12/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.12/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 https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
creating snapm.egg-info
writing snapm.egg-info/PKG-INFO
writing dependency_links to snapm.egg-info/dependency_links.txt
writing requirements to snapm.egg-info/requires.txt
writing top-level names to snapm.egg-info/top_level.txt
writing manifest file 'snapm.egg-info/SOURCES.txt'
reading manifest file 'snapm.egg-info/SOURCES.txt'
adding license file 'COPYING'
writing manifest file 'snapm.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/snapm
copying snapm/__init__.py -> build/lib/snapm
copying snapm/_snapm.py -> build/lib/snapm
copying snapm/command.py -> build/lib/snapm
copying snapm/report.py -> build/lib/snapm
creating build/lib/snapm/manager
copying snapm/manager/__init__.py -> build/lib/snapm/manager
copying snapm/manager/_manager.py -> build/lib/snapm/manager
copying snapm/manager/boot.py -> build/lib/snapm/manager
creating build/lib/snapm/manager/plugins
copying snapm/manager/plugins/__init__.py -> build/lib/snapm/manager/plugins
copying snapm/manager/plugins/_plugin.py -> build/lib/snapm/manager/plugins
copying snapm/manager/plugins/lvm2.py -> build/lib/snapm/manager/plugins
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/snapm
copying build/lib/snapm/__init__.py -> build/bdist.linux-x86_64/egg/snapm
copying build/lib/snapm/_snapm.py -> build/bdist.linux-x86_64/egg/snapm
copying build/lib/snapm/command.py -> build/bdist.linux-x86_64/egg/snapm
copying build/lib/snapm/report.py -> build/bdist.linux-x86_64/egg/snapm
creating build/bdist.linux-x86_64/egg/snapm/manager
copying build/lib/snapm/manager/__init__.py -> build/bdist.linux-x86_64/egg/snapm/manager
copying build/lib/snapm/manager/_manager.py -> build/bdist.linux-x86_64/egg/snapm/manager
copying build/lib/snapm/manager/boot.py -> build/bdist.linux-x86_64/egg/snapm/manager
creating build/bdist.linux-x86_64/egg/snapm/manager/plugins
copying build/lib/snapm/manager/plugins/__init__.py -> build/bdist.linux-x86_64/egg/snapm/manager/plugins
copying build/lib/snapm/manager/plugins/_plugin.py -> build/bdist.linux-x86_64/egg/snapm/manager/plugins
copying build/lib/snapm/manager/plugins/lvm2.py -> build/bdist.linux-x86_64/egg/snapm/manager/plugins
byte-compiling build/bdist.linux-x86_64/egg/snapm/__init__.py to __init__.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/_snapm.py to _snapm.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/command.py to command.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/report.py to report.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/manager/__init__.py to __init__.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/manager/_manager.py to _manager.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/manager/boot.py to boot.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/manager/plugins/__init__.py to __init__.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/manager/plugins/_plugin.py to _plugin.cpython-312.pyc
byte-compiling build/bdist.linux-x86_64/egg/snapm/manager/plugins/lvm2.py to lvm2.cpython-312.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-3.12
copying and adjusting bin/snapm -> build/scripts-3.12
changing mode of build/scripts-3.12/snapm from 644 to 755
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-3.12/snapm -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/snapm to 755
copying snapm.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying snapm.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying snapm.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying snapm.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying snapm.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
snapm.manager.__pycache__._manager.cpython-312: module references __path__
creating dist
creating 'dist/snapm-0.3.0-py3.12.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing snapm-0.3.0-py3.12.egg
creating /usr/local/lib/python3.12/site-packages/snapm-0.3.0-py3.12.egg
Extracting snapm-0.3.0-py3.12.egg to /usr/local/lib/python3.12/site-packages
Adding snapm 0.3.0 to easy-install.pth file
Installing snapm script to /usr/local/bin

Installed /usr/local/lib/python3.12/site-packages/snapm-0.3.0-py3.12.egg
Processing dependencies for snapm==0.3.0
Searching for boom-boot>=1.6.4
Reading https://pypi.org/simple/boom-boot/
Downloading https://files.pythonhosted.org/packages/21/ac/380f5f648cb08a31aa02613726c62d5097fdba499ff07c3ee75d5a383b85/boom_boot-1.6.4-py3-none-any.whl#sha256=650ef7b5dc8cfab0c0f46b988be4b03423f2705b1799c92a15170065b3c5590b
Best match: boom-boot 1.6.4
Processing boom_boot-1.6.4-py3-none-any.whl
Installing boom_boot-1.6.4-py3-none-any.whl to /usr/local/lib/python3.12/site-packages
Adding boom-boot 1.6.4 to easy-install.pth file
detected new path './snapm-0.3.0-py3.12.egg'
Installing boom script to /usr/local/bin

Installed /usr/local/lib/python3.12/site-packages/boom_boot-1.6.4-py3.12.egg
Searching for dbus-python==1.3.2
Best match: dbus-python 1.3.2
Adding dbus-python 1.3.2 to easy-install.pth file
detected new path './boom_boot-1.6.4-py3.12.egg'

Using /usr/lib64/python3.12/site-packages
Finished processing dependencies for snapm==0.3.0

Yields:

root@localhost:~/src/git/snapm# boom list
/usr/local/bin/boom:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('boom-boot==1.6.4', 'boom')
BootID  Version                  Name                     RootDevice             
6b99618 6.8.5-301.fc40.x86_64    Fedora Linux             /dev/mapper/fedora-root
0925a1d 6.9.4-200.fc40.x86_64    Fedora Linux             /dev/mapper/fedora-root
root@localhost:~/src/git/snapm# snapm snapset list
/usr/local/bin/snapm:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('snapm==0.3.0', 'snapm')
SnapsetName  Time                 NrSnapshots Status  MountPoints             

This doesn't happen if you pip install snapm|boom-boot:

root@localhost:~/src/git/snapm# pip install boom-boot
Collecting boom-boot
  Using cached boom_boot-1.6.4-py3-none-any.whl.metadata (46 kB)
Requirement already satisfied: dbus-python>=1.2.16 in /usr/lib64/python3.12/site-packages (from boom-boot) (1.3.2)
Using cached boom_boot-1.6.4-py3-none-any.whl (126 kB)
Installing collected packages: boom-boot
Successfully installed boom-boot-1.6.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@localhost:~/src/git/snapm# boom list
BootID  Version                  Name                     RootDevice             
6b99618 6.8.5-301.fc40.x86_64    Fedora Linux             /dev/mapper/fedora-root
0925a1d 6.9.4-200.fc40.x86_64    Fedora Linux             /dev/mapper/fedora-root
@bmr-cymru
Copy link
Collaborator Author

This comes from the autogenerated EASY-INSTALL-SCRIPT content in /usr/local/bin/boom:

#!/usr/bin/python3
# EASY-INSTALL-SCRIPT: 'boom-boot==1.6.4','boom'
__requires__ = 'boom-boot==1.6.4'
__import__('pkg_resources').run_script('boom-boot==1.6.4', 'boom')

I'm not sure if that's avoidable or not when using the legacy setup.py install mechanism.

@bmr-cymru
Copy link
Collaborator Author

See: pypa/setuptools#3981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant