qutebrowser/setup.py
2014-09-22 07:07:09 +02:00

74 lines
2.5 KiB
Python
Executable File

#!/usr/bin/python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""setuptools installer script for qutebrowser"""
import os
import os.path
from scripts import setupcommon as common
from scripts import ez_setup
ez_setup.use_setuptools()
import setuptools
from setuptools.command.sdist import sdist as cmd_sdist
from setuptools.command.bdist_rpm import bdist_rpm as cmd_bdist_rpm
from setuptools.command.bdist_wininst import bdist_wininst as cmd_bdist_wininst
from setuptools.command.bdist_egg import bdist_egg as cmd_bdist_egg
from setuptools.command.develop import develop as cmd_develop
try:
BASEDIR = os.path.dirname(os.path.realpath(__file__))
except NameError:
BASEDIR = None
command_classes = {}
command_classes['sdist'] = common.patch_docgen(cmd_sdist)
command_classes['bdist_rpm'] = common.patch_docgen(cmd_bdist_rpm)
command_classes['bdist_wininst'] = common.patch_docgen(cmd_bdist_wininst)
command_classes['bdist_egg'] = common.patch_docgen(cmd_bdist_egg)
command_classes['develop'] = common.patch_docgen(cmd_develop)
try:
common.write_git_file()
setuptools.setup(
packages=setuptools.find_packages(exclude=['qutebrowser.test']),
include_package_data=True,
entry_points={'gui_scripts':
['qutebrowser = qutebrowser.qutebrowser:main']},
test_suite='qutebrowser.test',
zip_safe=True,
install_requires=['pypeg2', 'jinja2'],
extras_require={'nice-debugging': ['colorlog', 'colorama'],
'checks': ['flake8', 'pylint', 'check-manifest',
'pyroma']},
cmdclass=command_classes,
**common.setupdata
)
finally:
if BASEDIR is not None:
path = os.path.join(BASEDIR, 'qutebrowser', 'git-commit-id')
if os.path.exists(path):
os.remove(path)