Skip to content

Fix and modernize installation #2

@tikank

Description

@tikank

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions