Skip to content

build: include man page in wheels #3459

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

Merged
merged 1 commit into from
Dec 30, 2020

Conversation

bastimeyer
Copy link
Member

Resolves #1753

This adds the man page, if it exists, to wheels via the data_files keyword:
https://setuptools.readthedocs.io/en/latest/references/keywords.html

The data_files keyword is marked as deprecated, but there doesn't seem to be another way of mapping files from one path to another in the distribution file. What it says about not being supported by wheels is wrong. package_data doesn't seem to work here without changing build scripts. At least I wasn't able to make it work.

sdist does not include any data_files.

Regarding the manpages themselves, it might be necessary on some systems to extend the MANPATH env var with MANPATH="${XDG_DATA_HOME:-$HOME/.local/share}/man:$MANPATH" so that it looks up man pages in $XDG_DATA_HOME/man (which defaults to $HOME/.local/share/man) too.

To validate the changes:

$ make --directory=docs clean
$ python setuptools.py bdist_wheel
$ unzip -l dist/streamlink-2.0.0+10.gc6a1806-py3-none-any.whl | grep share/man/man1/streamlink.1

$ make --directory=docs clean man
$ python setuptools.py bdist_wheel
$ unzip -l dist/streamlink-2.0.0+10.gc6a1806-py3-none-any.whl | grep share/man/man1/streamlink.1
    49409  2020-12-28 12:05   streamlink-2.0.0+10.gc6a1806.data/data/share/man/man1/streamlink.1
$ pip install ./dist/streamlink-2.0.0+10.gc6a1806-py3-none-any.whl
$ ls ~/.local/share/man/man1/streamlink.1 
/home/basti/.local/share/man/man1/streamlink.1

@bastimeyer
Copy link
Member Author

Btw, the man page itself should probably be changed, as it currently includes the entire cli.rst docs page, which is technically not a man page:

streamlink/docs/conf.py

Lines 184 to 186 in 009bbd8

man_pages = [
('cli', 'streamlink', 'extracts streams from various services and pipes them into a video player of choice', ['Streamlink Contributors'], 1)
]

@back-to back-to merged commit 97205d2 into streamlink:master Dec 30, 2020
@bastimeyer bastimeyer deleted the wheels/manpage branch January 19, 2021 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No man page with pip install
2 participants