Skip to content

Commit 4502055

Browse files
authored
Merge pull request #1784 from AyanSinhaMahapatra/develop
Add Travis-CI tests for docs
2 parents 0473956 + f276398 commit 4502055

File tree

50 files changed

+427
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+427
-6
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ addons:
9090
- pyenv
9191
update: true
9292

93+
before_install:
94+
- chmod +x ./docs/scripts/sphinx_build_link_check.sh
95+
- chmod +x ./docs/scripts/doc8_style_check.sh
9396

9497
install:
9598
- ./configure
@@ -99,6 +102,11 @@ script:
99102
# - ./bin/py.test -n 2 -vvs --cov=src tests/scancode
100103
# - echo $TEST_SUITE
101104
- $TEST_SUITE
105+
# Documentation Test Scripts
106+
- source bin/activate
107+
- cd docs
108+
- "./scripts/sphinx_build_link_check.sh"
109+
- "./scripts/doc8_style_check.sh"
102110

103111
# Pay attention to both calls below. They will succeed even if there
104112
# is no coverage information or connection to reporting website fails.

docs/requirements.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
alabaster==0.7.12
2+
Babel==2.7.0
3+
certifi==2019.9.11
4+
chardet==3.0.4
5+
doc8==0.8.0
6+
docutils==0.15.2
7+
idna==2.8
8+
imagesize==1.1.0
9+
Jinja2==2.10.3
10+
MarkupSafe==1.1.1
11+
packaging==19.2
12+
pbr==5.4.3
13+
Pygments==2.4.2
14+
pyparsing==2.4.2
15+
pytz==2019.3
16+
requests==2.22.0
17+
restructuredtext-lint==1.3.0
18+
six==1.12.0
19+
snowballstemmer==2.0.0
20+
Sphinx==2.2.0
21+
sphinx-rtd-theme==0.4.3
22+
sphinxcontrib-applehelp==1.0.1
23+
sphinxcontrib-devhelp==1.0.1
24+
sphinxcontrib-htmlhelp==1.0.2
25+
sphinxcontrib-jsmath==1.0.1
26+
sphinxcontrib-qthelp==1.0.2
27+
sphinxcontrib-serializinghtml==1.1.3
28+
stevedore==1.31.0
29+
urllib3==1.25.6

docs/scripts/doc8_style_check.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# halt script on error
3+
set -e
4+
# Check for Style Code Violations
5+
doc8 --max-line-length 100 source --ignore D000 --quiet
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# halt script on error
3+
set -e
4+
# Build locally, and then check links
5+
sphinx-build -E -W -b linkcheck source build

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
# Add any paths that contain custom static files (such as style sheets) here,
5050
# relative to this directory. They are copied after the builtin static files,
5151
# so a file named "default.css" will overwrite the builtin "default.css".
52-
html_static_path = ['_static']
52+
html_static_path = []
5353

5454
master_doc = 'index'

docs/source/doc_maintenance.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Now you can build the HTML documents locally::
4444
cd docs
4545
make html
4646

47-
Assuming that your Sphinx installation was successful, Sphinx should build a local instance of the documentation .html files::
47+
Assuming that your Sphinx installation was successful, Sphinx should build a local instance of the
48+
documentation .html files::
4849

4950
open build/html/index.html
5051

@@ -60,7 +61,8 @@ Ensure that you have the latest ScanCode Toolkit files::
6061
git pull
6162
git status
6263

63-
Use your favorite text editor to create and modify .rst files to make your documentation improvements.
64+
Use your favorite text editor to create and modify .rst files to make your documentation
65+
improvements.
6466

6567
Review your work::
6668

@@ -71,7 +73,8 @@ Review your work::
7173
Share ScanCode Toolkit Document Improvements
7274
--------------------------------------------
7375

74-
Follow standard git procedures to upload your new and modified files. The following commands are examples::
76+
Follow standard git procedures to upload your new and modified files. The following commands are
77+
examples::
7578

7679
git status
7780
git add source/index.rst
@@ -82,4 +85,5 @@ Follow standard git procedures to upload your new and modified files. The follow
8285
git push
8386
git status
8487

85-
The ScanCode Toolkit webhook with ReadTheDocs should rebuild the documentation. You can review your results online.
88+
The ScanCode Toolkit webhook with ReadTheDocs should rebuild the documentation. You can review your
89+
results online.

docs/source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Reference documents describe application concepts in depth.
3333
Discussion Documents
3434
====================
3535

36-
Discussion documents provide insights into integration of the application into your own software development life cycle.
36+
Discussion documents provide insights into integration of the application into your own software
37+
development life cycle.
3738

3839

3940
Indices and Tables

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ def read(*names, **kwargs):
221221
'spdx_tools >= 0.6.0',
222222
'unicodecsv',
223223

224+
# ScanCode Docs
225+
'Sphinx < 2.0; python_version == "2.7"',
226+
'Sphinx >= 2.0; python_version > "3"',
227+
'sphinx_rtd_theme >= 0.4.3',
228+
'doc8 >= 0.8.0',
229+
224230
# ScanCode caching and locking
225231
'yg.lockfile >= 2.3, < 3.0.0',
226232
# used by yg.lockfile
8.03 MB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
about_resource: Babel-2.7.0-py2.py3-none-any.whl
2+
name: Babel
3+
version: 2.7.0
4+
checksum_md5: b96fe47047fd07bc5797779d903d4fe2
5+
checksum_sha1: 6145459f9d7a875b10695874588044157cff58be
6+
package_url: pkg:pypi/[email protected]
7+
download_url: https://files.pythonhosted.org/packages/2c/60/f2af68eb046c5de5b1fe6dd4743bf42c074f7141fe7b2737d3061533b093/Babel-2.7.0-py2.py3-none-any.whl
8+
notice_url: https://github.com/babel/babel/blob/master/LICENSE
9+
homepage_url: http://babel.pocoo.org/en/latest/
10+
owner_url: https://github.com/babel
11+
owner: Armin Ronacher
12+
13+
license_expression: bsd-new
14+
licenses:
15+
- key: bsd-new
16+
name: BSD-3-Clause
17+
copyright: Copyright (c) 2014-present Sebastian McKenzie and other contributors

0 commit comments

Comments
 (0)