praiskup / argparse-manpage

Automatically build man-pages for your Python project
Apache License 2.0
40 stars 21 forks source link

`pip install argparse-manpage` fails on RHEL8 with system `pip3` #96

Open vashirov opened 1 year ago

vashirov commented 1 year ago
$ pip3 --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

$ pip3 install --user argparse-manpage
Collecting argparse-manpage
  Using cached https://files.pythonhosted.org/packages/d3/5f/3353e1dd33fcb3801cfe7e6412ad9d75202fc642679d105015e361aceef7/argparse-manpage-4.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/build_manpages.py", line 10, in <module>
        import tomllib
    ModuleNotFoundError: No module named 'tomllib'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/build_manpages.py", line 14, in <module>
        import tomli as tomllib
    ModuleNotFoundError: No module named 'tomli'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-dwy7230y/argparse-manpage/setup.py", line 11, in <module>
        from build_manpages import __version__
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/__init__.py", line 6, in <module>
        from .build_manpages import build_manpages, get_build_py_cmd, get_install_cmd
      File "/tmp/pip-build-dwy7230y/argparse-manpage/build_manpages/build_manpages.py", line 17, in <module>
        import toml as tomllib
    ModuleNotFoundError: No module named 'toml'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dwy7230y/argparse-manpage/

It installs fine in venv and latest versions of pip (at least starting with python38-pip-19.3.). So I suspect that pip-9.0.3 can't handle unresolved dependencies while importing build_manpages in setup.py: https://github.com/praiskup/argparse-manpage/blob/2856951732a850c8c7767146919b3d8bb1e3015c/setup.py#L11 https://github.com/praiskup/argparse-manpage/blob/2856951732a850c8c7767146919b3d8bb1e3015c/setup.py#L24-L27 https://github.com/praiskup/argparse-manpage/blob/2856951732a850c8c7767146919b3d8bb1e3015c/build_manpages/build_manpages.py#L9-L18

praiskup commented 1 year ago

Hm, thank you for the report! Do you see some possible solution?

vashirov commented 1 year ago

So this issue and PEP 668 made us re-evaluate how we install packages in our test systems. As a workaround, I added a step in our ansible playbook to install python3-tomli explicitly before installing argparse-manpage via pip. I'm switching our automation to use virtualenv, so the old pip (<10.0.0) won't be an issue.