mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
python: run setup.py without pypandoc #1110
This commit is contained in:
parent
e4907855d2
commit
92add03a30
@ -2,7 +2,6 @@ from setuptools import setup
|
||||
from setuptools.command.install import install
|
||||
import os
|
||||
import sys
|
||||
import pypandoc
|
||||
|
||||
class ManPageGenerator(install):
|
||||
def run(self):
|
||||
@ -20,6 +19,16 @@ class ManPageGenerator(install):
|
||||
print("data_files: ", self.distribution.data_files)
|
||||
super().run()
|
||||
|
||||
try:
|
||||
import pypandoc
|
||||
except ImportError:
|
||||
print("warning: pypandoc module not found, won't generate man pages")
|
||||
manpageinstaller=dict()
|
||||
else:
|
||||
manpageinstaller=dict(
|
||||
install=ManPageGenerator,
|
||||
)
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
|
||||
@ -41,7 +50,7 @@ setup(
|
||||
long_description_content_type="text/markdown",
|
||||
data_files=[],
|
||||
install_requires=["cffi>=1.0.0"],
|
||||
setup_requires=["cffi>=1.0.0"],
|
||||
setup_requires=["cffi>=1.0.0", "pypandoc>=1.5"],
|
||||
cffi_modules=["src/notcurses/build_notcurses.py:ffibuild"],
|
||||
# see https://pypi.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers=[
|
||||
@ -52,7 +61,5 @@ setup(
|
||||
'Programming Language :: Python',
|
||||
],
|
||||
include_package_data=True,
|
||||
cmdclass=dict(
|
||||
install=ManPageGenerator,
|
||||
)
|
||||
cmdclass=manpageinstaller
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user