2013-11-02 22:26:36 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
2013-11-03 18:32:45 -06:00
|
|
|
"""`sphinx_rtd_theme` lives on `Github`_.
|
2013-11-02 22:26:36 -05:00
|
|
|
|
2018-03-19 06:56:34 -05:00
|
|
|
.. _github: https://github.com/rtfd/sphinx_rtd_theme
|
2013-11-02 22:26:36 -05:00
|
|
|
|
|
|
|
"""
|
2019-07-24 19:39:35 -05:00
|
|
|
|
2019-07-29 11:56:44 -05:00
|
|
|
import os
|
2019-07-24 19:39:35 -05:00
|
|
|
import subprocess
|
|
|
|
import distutils.cmd
|
2019-07-26 18:14:36 -05:00
|
|
|
import setuptools.command.build_py
|
2017-08-06 22:03:12 -05:00
|
|
|
from io import open
|
2013-11-03 21:00:44 -06:00
|
|
|
from setuptools import setup
|
2019-07-24 19:39:35 -05:00
|
|
|
|
2019-07-25 00:42:25 -05:00
|
|
|
|
2019-07-26 18:14:36 -05:00
|
|
|
class WebpackBuildCommand(setuptools.command.build_py.build_py):
|
|
|
|
|
|
|
|
"""Prefix Python build with Webpack asset build"""
|
|
|
|
|
|
|
|
def run(self):
|
2019-07-29 11:56:44 -05:00
|
|
|
if not 'CI' in os.environ:
|
2019-08-22 13:33:05 -05:00
|
|
|
subprocess.run(['node_modules/.bin/webpack', '--config', 'webpack.prod.js'], check=True)
|
2019-07-29 12:29:49 -05:00
|
|
|
setuptools.command.build_py.build_py.run(self)
|
2019-07-26 18:14:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
class WebpackDevelopCommand(distutils.cmd.Command):
|
|
|
|
|
|
|
|
description = "Run Webpack dev server"
|
|
|
|
|
|
|
|
user_options = []
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
subprocess.run(
|
2019-08-22 13:33:15 -05:00
|
|
|
["node_modules/.bin/webpack-dev-server", "--open", "--config", "webpack.dev.js"],
|
2019-07-26 18:14:36 -05:00
|
|
|
check=True
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-07-25 00:42:25 -05:00
|
|
|
class UpdateTranslationsCommand(distutils.cmd.Command):
|
2019-07-24 19:39:35 -05:00
|
|
|
|
|
|
|
description = "Run all localization commands"
|
|
|
|
|
|
|
|
user_options = []
|
|
|
|
sub_commands = [
|
|
|
|
('extract_messages', None),
|
|
|
|
('update_catalog', None),
|
|
|
|
('transifex', None),
|
|
|
|
('compile_catalog', None),
|
|
|
|
]
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
for cmd_name in self.get_sub_commands():
|
|
|
|
self.run_command(cmd_name)
|
|
|
|
|
|
|
|
|
|
|
|
class TransifexCommand(distutils.cmd.Command):
|
|
|
|
|
|
|
|
description = "Update translation files through Transifex"
|
|
|
|
|
|
|
|
user_options = []
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
2019-07-26 18:14:36 -05:00
|
|
|
subprocess.run(['tx', 'push', '--source'], check=True)
|
|
|
|
subprocess.run(['tx', 'pull'], check=True)
|
2019-07-24 19:39:35 -05:00
|
|
|
|
|
|
|
|
2013-11-02 22:26:36 -05:00
|
|
|
setup(
|
2013-11-03 18:32:45 -06:00
|
|
|
name='sphinx_rtd_theme',
|
2019-07-25 15:08:56 -05:00
|
|
|
version='0.4.3.dev0',
|
2017-03-06 17:23:16 -06:00
|
|
|
url='https://github.com/rtfd/sphinx_rtd_theme/',
|
2013-11-02 22:26:36 -05:00
|
|
|
license='MIT',
|
2018-03-19 06:56:34 -05:00
|
|
|
author='Dave Snider, Read the Docs, Inc. & contributors',
|
|
|
|
author_email='dev@readthedocs.org',
|
2017-03-06 17:23:16 -06:00
|
|
|
description='Read the Docs theme for Sphinx',
|
2017-08-06 22:03:12 -05:00
|
|
|
long_description=open('README.rst', encoding='utf-8').read(),
|
2019-07-24 19:39:35 -05:00
|
|
|
cmdclass={
|
2019-07-25 00:42:25 -05:00
|
|
|
'update_translations': UpdateTranslationsCommand,
|
2019-07-24 19:39:35 -05:00
|
|
|
'transifex': TransifexCommand,
|
2019-07-26 18:14:36 -05:00
|
|
|
'build_py': WebpackBuildCommand,
|
|
|
|
'watch': WebpackDevelopCommand,
|
2019-07-24 19:39:35 -05:00
|
|
|
},
|
2013-11-02 22:26:36 -05:00
|
|
|
zip_safe=False,
|
2013-11-03 21:00:44 -06:00
|
|
|
packages=['sphinx_rtd_theme'],
|
|
|
|
package_data={'sphinx_rtd_theme': [
|
|
|
|
'theme.conf',
|
|
|
|
'*.html',
|
|
|
|
'static/css/*.css',
|
|
|
|
'static/js/*.js',
|
2019-02-13 13:54:51 -06:00
|
|
|
'static/fonts/*.*'
|
2013-11-03 21:00:44 -06:00
|
|
|
]},
|
|
|
|
include_package_data=True,
|
2017-06-14 00:07:35 -05:00
|
|
|
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
|
2017-05-30 05:41:29 -05:00
|
|
|
entry_points = {
|
|
|
|
'sphinx.html_themes': [
|
|
|
|
'sphinx_rtd_theme = sphinx_rtd_theme',
|
|
|
|
]
|
|
|
|
},
|
2018-06-18 21:16:44 -05:00
|
|
|
install_requires=[
|
2019-07-25 00:42:25 -05:00
|
|
|
'sphinx'
|
2018-06-18 21:16:44 -05:00
|
|
|
],
|
2019-07-19 13:45:34 -05:00
|
|
|
extras_require={
|
|
|
|
'dev': [
|
|
|
|
'transifex-client',
|
|
|
|
'sphinxcontrib-httpdomain',
|
|
|
|
],
|
|
|
|
},
|
2013-11-02 22:26:36 -05:00
|
|
|
classifiers=[
|
2017-10-02 17:07:24 -05:00
|
|
|
'Framework :: Sphinx',
|
|
|
|
'Framework :: Sphinx :: Theme',
|
2017-03-06 17:26:37 -06:00
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
'License :: OSI Approved :: MIT License',
|
2013-11-02 22:26:36 -05:00
|
|
|
'Environment :: Console',
|
|
|
|
'Environment :: Web Environment',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
2017-03-06 17:26:37 -06:00
|
|
|
'Programming Language :: Python :: 3.3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
'Programming Language :: Python :: 3.6',
|
2013-11-02 22:26:36 -05:00
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Topic :: Documentation',
|
|
|
|
'Topic :: Software Development :: Documentation',
|
|
|
|
],
|
|
|
|
)
|