notcurses/python/setup.py

59 lines
2.1 KiB
Python
Raw Normal View History

from setuptools import setup
from setuptools.command.install import install
2020-01-05 13:08:22 +00:00
import os
import sys
import pypandoc
class ManPageGenerator(install):
def run(self):
here = os.path.dirname(__file__) or '.'
files = []
outfile = 'notcurses-pydemo.1'
pypandoc.convert_file(os.path.join(here, 'notcurses-pydemo.1.md'), 'man', outputfile=outfile, extra_args=['-s'])
files.append(outfile)
2020-08-30 07:06:06 +00:00
outfile = 'notcurses-direct-pydemo.1'
pypandoc.convert_file(os.path.join(here, 'notcurses-direct-pydemo.1.md'), 'man', outputfile=outfile, extra_args=['-s'])
files.append(outfile)
# this breaks when using --user without --prefix
ipage = (os.path.join(self.prefix, 'share', 'man', 'man1'), files)
self.distribution.data_files.append(ipage)
print("data_files: ", self.distribution.data_files)
super().run()
2020-01-05 13:08:22 +00:00
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="notcurses",
2020-10-25 14:10:50 +00:00
version="2.0.2",
packages=['notcurses'],
2020-08-30 07:06:06 +00:00
scripts=['notcurses-pydemo', 'notcurses-direct-pydemo'],
2020-01-05 13:08:22 +00:00
package_dir={'': 'src'},
author="Nick Black",
author_email="nickblack@linux.com",
2020-01-07 18:43:57 +00:00
description="Blingful TUI construction library (python bindings)",
2020-01-05 13:08:22 +00:00
keywords="ncurses curses tui console graphics",
license='Apache License, Version 2.0',
url='https://github.com/dankamongmen/notcurses',
zip_safe=True,
platforms=["any"],
long_description=read('README.md'),
long_description_content_type="text/markdown",
data_files=[],
install_requires=["cffi>=1.0.0"],
setup_requires=["cffi>=1.0.0"],
2020-01-07 18:43:57 +00:00
cffi_modules=["src/notcurses/build_notcurses.py:ffibuild"],
2020-01-05 13:08:22 +00:00
# see https://pypi.org/pypi?%3Aaction=list_classifiers
classifiers=[
2020-01-28 04:12:54 +00:00
'Development Status :: 4 - Beta',
2020-01-05 13:08:22 +00:00
'Environment :: Console',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python',
],
include_package_data=True,
cmdclass=dict(
install=ManPageGenerator,
)
2020-01-05 13:08:22 +00:00
)