Skip to content

Commit f3bebb5

Browse files
authored
Merge pull request #459 from requests/tox-docs
Fix Docs generation - Improve Pipeline
2 parents d8f7100 + e67933c commit f3bebb5

File tree

9 files changed

+82
-31
lines changed

9 files changed

+82
-31
lines changed

.readthedocs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2+
version: 2
3+
build:
4+
os: ubuntu-20.04
5+
tools:
6+
python: "3.7"
7+
sphinx:
8+
builder: html
9+
configuration: docs/conf.py
10+
# fail_on_warning: true
11+
# the requirements.txt override some RTD defaults.
12+
# ideally it has to be updated from time to time
13+
# with latest libraries versions.
14+
python:
15+
install:
16+
- requirements: docs/requirements.txt
17+
- method: setuptools
18+
path: .

.travis.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
dist: xenial
1+
dist: bionic
22
sudo: false
33
language: python
44
cache: pip
5-
python:
6-
- 2.7
7-
- 3.4
8-
- 3.5
9-
- 3.6
10-
- 3.7
11-
- pypy2.7-6.0
12-
- pypy3.5-6.0
13-
install:
14-
- pip install -r requirements.txt
15-
- pip install requests-mock
16-
- pip install coveralls
17-
script:
18-
- coverage run --source=requests_oauthlib -m unittest discover
19-
after_success:
20-
- coveralls
21-
225
matrix:
236
include:
24-
- name: "Black"
25-
python: 3.7
26-
install: travis_retry pip install black
27-
script: black --check .
7+
- python: 2.7
8+
env: TOXENV=py27
9+
- python: 3.4
10+
env: TOXENV=py34
11+
- python: 3.5
12+
env: TOXENV=py35
13+
- python: 3.6
14+
env: TOXENV=py36
15+
- python: 3.7
16+
env: TOXENV=py37,docs,readme
17+
- python: 3.7
18+
env: TOXENV=black
2819
after_success: skip
20+
- python: pypy2.7-6.0
21+
env: TOXENV=pypy
22+
- python: pypy3.5-6.0
23+
env: TOXENV=pypy3
24+
before_install:
25+
- python -m pip install --upgrade pip setuptools
26+
- python -m pip install tox coveralls
27+
script:
28+
- tox
29+
after_success:
30+
- COVERALLS_PARALLEL=true coveralls

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
# Add any paths that contain custom static files (such as style sheets) here,
125125
# relative to this directory. They are copied after the builtin static files,
126126
# so a file named "default.css" will overwrite the builtin "default.css".
127-
html_static_path = ["_static"]
127+
# html_static_path = ["_static"]
128128

129129
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
130130
# using the given strftime format.

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx<2
2+
docutils<=0.15 # docutils 0.16 has an error when generating in api.rst
3+
sphinx_rtd_theme<0.5
4+
readthedocs-sphinx-ext

requirements-test.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r requirements.txt
2+
coveralls==3.2.0
3+
mock==4.0.3
4+
requests-mock==1.9.3

requirements.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
requests>=2.0.0
2+
oauthlib[signedtoken]>=3.0.0

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
requests>=2.0.0
2-
oauthlib[signedtoken]>=3.0.0
1+
requests==2.26.0
2+
oauthlib[signedtoken]==3.1.1

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def readall(path):
3838
version=VERSION,
3939
description="OAuthlib authentication support for Requests.",
4040
long_description=readall("README.rst") + "\n\n" + readall("HISTORY.rst"),
41+
long_description_content_type="text/x-rst",
4142
author="Kenneth Reitz",
4243
author_email="[email protected]",
4344
url="https://github.com/requests/requests-oauthlib",

tox.ini

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
[tox]
2-
envlist = py27, py34, py35, py36, py37, pypy, pypy3
2+
envlist=py27,py34,py35,py36,py37,pypy,pypy3,docs,readme,black
33

44
[testenv]
55
deps=
6-
-r{toxinidir}/requirements.txt
7-
mock
8-
coveralls
9-
requests-mock
10-
commands= coverage run --source=requests_oauthlib -m unittest discover
6+
-r{toxinidir}/requirements-test.txt
7+
commands=coverage run --source=requests_oauthlib -m unittest discover
8+
9+
# tox -e docs to mimick readthedocs build.
10+
# should be similar to .readthedocs.yaml pipeline
11+
[testenv:docs]
12+
basepython=python3.7
13+
skipsdist=True
14+
deps=
15+
-r{toxinidir}/docs/requirements.txt
16+
changedir=docs
17+
whitelist_externals=make
18+
commands=make clean html
19+
20+
# tox -e readme to mimick pypi validation of readme/rst files.
21+
[testenv:readme]
22+
basepython=python3.7
23+
deps=twine>=1.12.0
24+
commands=
25+
twine check .tox/dist/*
26+
27+
[testenv:black]
28+
basepython=python3.7
29+
deps=black
30+
commands=black --check .

0 commit comments

Comments
 (0)