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

setup.py: Do not fail when argparse-manpage is not available #186

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import sys
import sysconfig
from argcomplete import shell_integration
from build_manpages import build_manpages, get_build_py_cmd, get_install_cmd
try:
from build_manpages import build_manpages, get_build_py_cmd, get_install_cmd
except ModuleNotFoundError:
build_manpages = None
from setuptools import setup
from setuptools.command.build_py import build_py
from setuptools.command.egg_info import egg_info
Expand Down Expand Up @@ -106,8 +109,18 @@ def run(self):
data_files = [
("/etc", ["cfg/virtme-ng.conf"]),
("/usr/share/bash-completion/completions", ["virtme-ng-prompt", "vng-prompt"]),
("/usr/share/man/man1", ["man/vng.1"]),
]
if build_manpages:
data_files.append(("/usr/share/man/man1", ["man/vng.1"]))

cmdclass = {
"egg_info": EggInfo,
"build_py": BuildPy,
}
if build_manpages:
cmdclass["build_manpages"] = build_manpages
cmdclass["build_py"] = get_build_py_cmd(BuildPy)
cmdclass["install"] = get_install_cmd()

setup(
name="virtme-ng",
Expand Down Expand Up @@ -138,12 +151,7 @@ def run(self):
"virtme-mkinitramfs = virtme.commands.mkinitramfs:main",
]
},
cmdclass={
"build_manpages": build_manpages,
"build_py": get_build_py_cmd(BuildPy),
"install": get_install_cmd(),
"egg_info": EggInfo,
},
cmdclass=cmdclass,
packages=packages,
package_data={"virtme.guest": package_files},
data_files=data_files,
Expand Down