forked from readthedocs/sphinx_rtd_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
157 lines (125 loc) · 4.16 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# -*- coding: utf-8 -*-
import distutils.cmd
import os
import subprocess
from io import open
from setuptools import setup
class WebpackBuildCommand(distutils.cmd.Command):
description = "Generate static assets"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if not 'CI' in os.environ and not 'TOX_ENV_NAME' in os.environ:
subprocess.run(['npm', 'install'], check=True)
subprocess.run(['node_modules/.bin/webpack', '--config', 'webpack.prod.js'], check=True)
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(
["node_modules/.bin/webpack-dev-server", "--open", "--config", "webpack.dev.js"],
check=True
)
class UpdateTranslationsCommand(distutils.cmd.Command):
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):
subprocess.run(['tx', 'push', '--source'], check=True)
subprocess.run(['tx', 'pull', '--mode', 'onlyreviewed', '-f', '-a'], check=True)
setup(
name='sphinx_rtd_theme',
version='1.0.1alpha1',
url='https://github.com/readthedocs/sphinx_rtd_theme',
license='MIT',
author='Dave Snider, Read the Docs, Inc. & contributors',
author_email='[email protected]',
description='Read the Docs theme for Sphinx',
long_description=open('README.rst', encoding='utf-8').read(),
cmdclass={
'update_translations': UpdateTranslationsCommand,
'transifex': TransifexCommand,
'build_assets': WebpackBuildCommand,
'watch': WebpackDevelopCommand,
},
zip_safe=False,
packages=['sphinx_rtd_theme'],
package_data={'sphinx_rtd_theme': [
'theme.conf',
'*.html',
'static/css/*.css',
'static/css/fonts/*.*',
'static/js/*.js',
]},
include_package_data=True,
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
entry_points = {
'sphinx.html_themes': [
'sphinx_rtd_theme = sphinx_rtd_theme',
]
},
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
install_requires=[
'sphinx>=1.6',
'docutils<0.18',
],
tests_require=[
'pytest',
],
extras_require={
'dev': [
'transifex-client',
'sphinxcontrib-httpdomain',
'bump2version',
],
},
classifiers=[
'Framework :: Sphinx',
'Framework :: Sphinx :: Theme',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Operating System :: OS Independent',
'Topic :: Documentation',
'Topic :: Software Development :: Documentation',
],
project_urls={
'Homepage': 'https://sphinx-rtd-theme.readthedocs.io/',
'Source Code': 'https://github.com/readthedocs/sphinx_rtd_theme',
'Issue Tracker': 'https://github.com/readthedocs/sphinx_rtd_theme/issues',
},
)