pypa / pipx

Install and Run Python Applications in Isolated Environments
https://pipx.pypa.io
MIT License
10.67k stars 419 forks source link

No man pages for ansible-core #1527

Open seven-beep opened 3 months ago

seven-beep commented 3 months ago

Describe the bug

When installing ansible-core with pipx, no man pages are installed.

# pipx --version 1.7.1

How to reproduce

# pipx install ansible-core --include-deps --verbose
pipx >(setup:1110): pipx version is 1.7.1
pipx >(setup:1111): Default python interpreter is '/usr/bin/python3.11'
pipx >(package_name_from_spec:378): Determined package name: ansible-core
pipx >(package_name_from_spec:379): Package name determined in 0.0s
pipx >(create_venv:164): Creating virtual environment
creating virtual environment...
pipx >(run_subprocess:175): running /usr/bin/python3.11 -m venv --without-pip /home/user/.local/pipx/venvs/ansible-core
pipx >(run_subprocess:175): running <checking pip's availability>
pipx >(run_subprocess:175): running /home/user/.local/pipx/venvs/ansible-core/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:175): running /home/user/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:175): running /home/user/.local/pipx/venvs/ansible-core/bin/python --version
pipx >(_parsed_package_to_package_or_url:139): cleaned package spec: ansible-core
pipx >(install_package:247): Installing ansible-core
installing ansible-core...
pipx >(run_subprocess:175): running /home/user/.local/pipx/venvs/ansible-core/bin/python -m pip --no-input install ansible-core
pipx >(run_subprocess:175): running <fetch_info_in_venv commands>
pipx >(get_venv_metadata_for_package:351): get_venv_metadata_for_package: 47ms
pipx >(_parsed_package_to_package_or_url:139): cleaned package spec: ansible-core
  installed package ansible-core 2.17.3, installed using Python 3.11.2
  These apps are now globally available
    - ansible
    - ansible-config
    - ansible-connection
    - ansible-console
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
    - ansible-playbook
    - ansible-pull
    - ansible-test
    - ansible-vault
done! ✨ 🌟 ✨

# man ansible
No manual entry for ansible

There is no share folder in the venv of ansible-core.

The pipx_metadata.json does not include man data:

        "apps_of_dependencies": [],
        "include_apps": true,
        "include_dependencies": true,
        "man_pages": [],
        "man_pages_of_dependencies": [],
        "man_paths": [],
        "man_paths_of_dependencies": {},

Expected behavior

Ansible come with a few man pages for its commands, I expected that they were installed by pipx.

chrysle commented 3 months ago

They're not included in ansible's SDist since ansible/ansible#81395 (v2.17.3rc1). @mattclay could you comment on this?

mattclay commented 2 months ago

We don't have any plans to include man pages in the ansible-core sdist at this time, in part because doing so requires the use of the "data files" feature of setuptools -- the use of which is discouraged.

chrysle commented 2 months ago

in part because doing so requires the use of the "data files" feature of setuptools -- the use of which is discouraged.

But you do know that this advice is merely meant for people trying to install files outside of the installation directory selected by the installer? It's not discouraged to install man pages in the same directory (https://setuptools.pypa.io/en/latest/references/keywords.html#manpages). pipx does the moving for the user; see its documentation.