Skip to content

Commit ef326ac

Browse files
committed
Change sphinx theme.
1 parent f4112ab commit ef326ac

File tree

6 files changed

+46
-13
lines changed

6 files changed

+46
-13
lines changed

MANIFEST.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
include LICENSE
2+
include tox.ini
23
include requirements.txt
34
include requirements-test.txt
45
include requirements-dev.txt
5-
include tox.ini
6+
prune *.pyc
7+
recursive-include docs *.rst *.py Makefile
8+
recursive-include tests *.py *.json
9+
prune docs/_build

docs/conf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
master_doc = 'index'
5353

5454
# General information about the project.
55-
project = u'linebot'
55+
project = u'lline-bot-sdk-python'
5656
copyright = u'2016, Author'
5757
author = u'Author'
5858

@@ -123,7 +123,7 @@
123123
# The theme to use for HTML and HTML Help pages. See the documentation for
124124
# a list of builtin themes.
125125
#
126-
html_theme = 'alabaster'
126+
html_theme = 'sphinx_rtd_theme'
127127

128128
# Theme options are theme-specific and customize the look and feel of a theme
129129
# further. For a list of options available for each theme, see the
@@ -237,7 +237,7 @@
237237
# html_search_scorer = 'scorer.js'
238238

239239
# Output file base name for HTML help builder.
240-
htmlhelp_basename = 'linebotdoc'
240+
htmlhelp_basename = 'line-bot-sdk-python-doc'
241241

242242
# -- Options for LaTeX output ---------------------------------------------
243243

@@ -263,7 +263,7 @@
263263
# (source start file, target name, title,
264264
# author, documentclass [howto, manual, or own class]).
265265
latex_documents = [
266-
(master_doc, 'linebot.tex', u'linebot Documentation',
266+
(master_doc, 'line-bot-sdk-python.tex', u'line-bot-sdk-python Documentation',
267267
u'Author', 'manual'),
268268
]
269269

@@ -305,7 +305,7 @@
305305
# One entry per manual page. List of tuples
306306
# (source start file, name, description, authors, manual section).
307307
man_pages = [
308-
(master_doc, 'linebot', u'linebot Documentation',
308+
(master_doc, 'line-bot-sdk-python', u'line-bot-sdk-python Documentation',
309309
[author], 1)
310310
]
311311

@@ -320,8 +320,8 @@
320320
# (source start file, target name, title, author,
321321
# dir menu entry, description, category)
322322
texinfo_documents = [
323-
(master_doc, 'linebot', u'linebot Documentation',
324-
author, 'linebot', 'One line description of project.',
323+
(master_doc, 'line-bot-sdk-python', u'line-bot-sdk-python Documentation',
324+
author, 'line-bot-sdk-python', 'One line description of project.',
325325
'Miscellaneous'),
326326
]
327327

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. linebot documentation master file, created by
1+
.. line-bot-sdk-python documentation master file, created by
22
sphinx-quickstart on Thu Oct 13 19:26:47 2016.
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to linebot's documentation!
6+
line-bot-sdk-python API document
77
===================================
88

99
Contents:

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
-r requirements-test.txt
33
tox
44
wheel
5+
sphinx_rtd_theme
6+
pypandoc

setup.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
[flake8]
22
max-line-length = 99
3+
4+
[wheel]
5+
universal = 1
6+
7+
[upload_docs]
8+
upload-dir = docs/_build/html

setup.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414

1515

1616
import re
17+
import sys
1718

19+
from pypandoc import convert
1820
from setuptools import setup
21+
from setuptools.command.test import test as TestCommand
1922

2023
__version__ = ''
2124
with open('linebot/__about__.py', 'r') as fd:
@@ -28,13 +31,30 @@
2831

2932

3033
def _requirements():
31-
return [name.strip() for name in open('requirements.txt').readlines()]
34+
with open('requirements.txt') as fd:
35+
return [name.strip() for name in fd.readlines()]
3236

3337

3438
def _requirements_test():
35-
return [name.strip() for name in open('requirements-test.txt').readlines()]
39+
with open('requirements-test.txt') as fd:
40+
return [name.strip() for name in fd.readlines()]
3641

3742

43+
class PyTest(TestCommand):
44+
def finalize_options(self):
45+
TestCommand.finalize_options(self)
46+
self.test_args = []
47+
self.test_suite = True
48+
49+
def run_tests(self):
50+
# import here, cause outside the eggs aren't loaded
51+
import pytest
52+
errno = pytest.main(self.test_args)
53+
sys.exit(errno)
54+
55+
56+
read_md = lambda f: convert(f, 'rst')
57+
3858
setup(
3959
name="line-bot-sdk",
4060
version=__version__,
@@ -44,12 +64,13 @@ def _requirements_test():
4464
maintainer_email="hsb.1014@gmail.com",
4565
url="https://github.com/line/line-bot-sdk-python",
4666
description="LINE Messaging API SDK for Python",
47-
long_description="LINE Messaging API SDK for Python",
67+
long_description=read_md('README.md'),
4868
packages=[
4969
"linebot", "linebot.models"
5070
],
5171
install_requires=_requirements(),
5272
tests_require=_requirements_test(),
73+
cmdclass={'test': PyTest},
5374
classifiers=[
5475
"Development Status :: 1 - Planning",
5576
# "Development Status :: 5 - Production/Stable",

0 commit comments

Comments
 (0)