2020-02-10 04:34:51 +00:00
|
|
|
from setuptools import setup
|
2020-07-29 13:34:46 +00:00
|
|
|
from setuptools.command.install import install
|
2021-11-30 12:38:36 +00:00
|
|
|
from setuptools.command.sdist import sdist
|
|
|
|
from distutils.command.build import build
|
2020-01-05 13:08:22 +00:00
|
|
|
import os
|
2021-11-30 12:38:36 +00:00
|
|
|
import shutil
|
|
|
|
|
|
|
|
here = os.path.dirname(__file__) or '.'
|
|
|
|
|
|
|
|
|
|
|
|
def read(fname):
|
|
|
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
|
|
|
|
|
|
|
|
|
|
|
def copy_include_dir():
|
|
|
|
src = os.path.join(here, "../include")
|
|
|
|
dst = os.path.join(here, "include")
|
|
|
|
if os.path.exists(src):
|
|
|
|
if os.path.exists(dst):
|
|
|
|
shutil.rmtree(dst)
|
|
|
|
shutil.copytree(src, dst)
|
|
|
|
|
2020-07-29 13:34:46 +00:00
|
|
|
|
|
|
|
class ManPageGenerator(install):
|
|
|
|
def run(self):
|
|
|
|
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)
|
2021-02-27 22:50:41 +00:00
|
|
|
outfile = 'ncdirect-pydemo.1'
|
|
|
|
pypandoc.convert_file(os.path.join(here, 'ncdirect-pydemo.1.md'), 'man', outputfile=outfile, extra_args=['-s'])
|
2020-08-30 07:06:06 +00:00
|
|
|
files.append(outfile)
|
2020-07-29 13:34:46 +00:00
|
|
|
# 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
|
|
|
|
2021-11-30 12:38:36 +00:00
|
|
|
|
2021-11-30 14:21:20 +00:00
|
|
|
copy_include_dir()
|
2021-11-30 12:38:36 +00:00
|
|
|
|
|
|
|
|
2021-11-30 14:21:20 +00:00
|
|
|
cmdclass = {}
|
2020-11-12 14:10:18 +00:00
|
|
|
try:
|
|
|
|
import pypandoc
|
2021-11-30 12:38:36 +00:00
|
|
|
cmdclass["install"] = ManPageGenerator
|
2020-11-12 14:10:18 +00:00
|
|
|
except ImportError:
|
|
|
|
print("warning: pypandoc module not found, won't generate man pages")
|
2020-01-05 13:08:22 +00:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name="notcurses",
|
2021-12-02 09:41:48 +00:00
|
|
|
version="3.0.0",
|
2020-02-10 04:34:51 +00:00
|
|
|
packages=['notcurses'],
|
2021-02-27 22:50:41 +00:00
|
|
|
scripts=['notcurses-pydemo', 'ncdirect-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",
|
2020-07-29 13:34:46 +00:00
|
|
|
data_files=[],
|
2020-01-09 10:51:18 +00:00
|
|
|
install_requires=["cffi>=1.0.0"],
|
2020-11-22 05:48:31 +00:00
|
|
|
setup_requires=["cffi>=1.0.0", "pypandoc>=1.4"],
|
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',
|
|
|
|
],
|
2020-07-29 13:34:46 +00:00
|
|
|
include_package_data=True,
|
2021-11-30 12:38:36 +00:00
|
|
|
cmdclass=cmdclass,
|
2020-01-05 13:08:22 +00:00
|
|
|
)
|