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

Fix and modernize installation #2

Open
tikank opened this issue Sep 29, 2024 · 0 comments
Open

Fix and modernize installation #2

tikank opened this issue Sep 29, 2024 · 0 comments

Comments

@tikank
Copy link
Owner

tikank commented Sep 29, 2024

Purpose

Deprecations

Readme says to do installation using ./setup.py install command, but using setup.py as a command tool is deprecated. Instead pip install should be used.

On Debian Bookworm, Python 3.11 installation works but gives deprecation warnings:

$ sudo ./setup.py install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:146: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
zip_safe flag not set; analyzing archive contents...
Mailnag.common.__pycache__.imaplib2.cpython-311: module references __file__
Mailnag.common.__pycache__.utils.cpython-311: module MAY be using inspect.stack

On Debian testing, Python 3.12 installation works but gives deprecation warnings:

$ sudo ./setup.py install
/usr/lib/python3/dist-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/dist-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()
zip_safe flag not set; analyzing archive contents...
Mailnag.common.__pycache__.imaplib2.cpython-312: module references __file__
Mailnag.common.__pycache__.utils.cpython-312: module MAY be using inspect.stack

In both cases python3-setuptools package was installed.

distutils package is deprecated also and is removed in Python 3.12. It still exists in Python 3.11 and Mailnag can be installe with it if setuptools (python3-setuptoos package in Debian) is not installed.

Wrong path

In Debian testing with Python 3.12 Mailnag can be mostly installed using command
sudo ./setup build install_data install --prefix=/usr/local/
but plugins do not work. Patched version of Mailnag/common/dist_cfg.py refers to path /usr/local/lib/python3/dist-packages/Mailnag but the software is actually in /usr/local/lib/python3.12/dist-packages/mailnag-2.2.0-py3.12.egg/Mailnag. In Debian Bookworm with Python 3.11 (using distutils) it is installed to /usr/local/lib/python3.11/dist-packages/Mailnag.

Extra

It would also be nice if program could be installed to virtualenv or with pipx.

Visio

Something like following should work:

  • pip install mailnagger
    • Installs from pypi repository
  • pip install --user mailnagger
  • python3 -m venv env ; ./env/bin/python3 -m pip install mailnagger
  • pipx install mailnagger
@tikank tikank changed the title Modernize installation Fix and modernize installation Oct 7, 2024
@tikank tikank transferred this issue from tikank/mailnag Oct 16, 2024
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