Skip to content

Commit 6ae571e

Browse files
Merge pull request #1122 from adamtheturtle/sphinx-substitution
Use sphinx-substitution-extensions to have fewer references to the gi…
2 parents eeb0aca + fb8068f commit 6ae571e

File tree

5 files changed

+27
-19
lines changed

5 files changed

+27
-19
lines changed

dev-requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
PyYAML==5.2
2+
Pygments==2.5.2
3+
Sphinx-Substitution-Extensions==2019.6.15.0
4+
Sphinx==2.2.2
5+
VWS-Python-Mock==2019.9.28.0
16
autoflake==1.3.1
27
check-manifest==0.40
38
codecov==2.0.15 # Upload coverage data
@@ -14,17 +19,13 @@ pip_check_reqs==2.0.3
1419
pydocstyle==4.0.1 # Lint docstrings
1520
pyenchant==2.0.0 # Bindings for a spellchecking sytem
1621
pygithub==1.44.1
17-
Pygments==2.5.2
1822
pylint==2.4.4 # Lint
1923
pyroma==2.6 # Packaging best practices checker
2024
pytest-cov==2.8.1 # Measure code coverage
2125
pytest==5.3.1 # Test runners
22-
PyYAML==5.2
23-
Sphinx==2.2.2
2426
sphinx-autodoc-typehints==1.10.3
2527
sphinxcontrib-spelling==4.3.0
2628
twine==3.1.1
2729
versioneer==0.18
2830
vulture==1.2
29-
VWS-Python-Mock==2019.9.28.0
3031
yapf==0.29.0 # Automatic formatting for Python

docs/source/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'sphinx.ext.intersphinx',
2626
'sphinx.ext.napoleon',
2727
'sphinx_autodoc_typehints',
28+
'sphinx_substitution_extensions',
2829
'sphinxcontrib.spelling',
2930
]
3031

@@ -57,6 +58,12 @@
5758
version = vws.__version__
5859
release = version.split('+')[0]
5960

61+
substitutions = [
62+
('|release|', release),
63+
('|github-owner|', 'adamtheturtle'),
64+
('|github-repository|', 'vws-python'),
65+
]
66+
6067
language = None
6168

6269
# The name of the syntax highlighting style to use.

docs/source/contributing.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ Install contribution dependencies
1212

1313
Install Python dependencies in a virtual environment.
1414

15-
.. code:: sh
15+
.. substitution-prompt:: bash
1616

1717
pip install --editable '.[dev]'
1818

1919
Spell checking requires ``enchant``.
2020
This can be installed on macOS, for example, with `Homebrew <https://brew.sh>`__:
2121

22-
.. code:: sh
22+
.. substitution-prompt:: bash
2323

2424
brew install enchant
2525

2626
and on Ubuntu with ``apt``:
2727

28-
.. code:: sh
28+
.. substitution-prompt:: bash
2929

3030
apt-get install -y enchant
3131

@@ -34,13 +34,13 @@ Linting
3434

3535
Run lint tools:
3636

37-
.. code:: sh
37+
.. substitution-prompt:: bash
3838

3939
make lint
4040

4141
To fix some lint errors, run the following:
4242

43-
.. code:: sh
43+
.. substitution-prompt:: bash
4444

4545
make fix-lint
4646

@@ -49,7 +49,7 @@ Running tests
4949

5050
Run ``pytest``:
5151

52-
.. code:: sh
52+
.. substitution-prompt:: bash
5353

5454
pytest
5555

@@ -60,7 +60,7 @@ Documentation is built on Read the Docs.
6060

6161
Run the following commands to build and view documentation locally:
6262

63-
.. code:: sh
63+
.. substitution-prompt:: bash
6464

6565
make docs
6666
make open-docs

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Installation
55
------------
66

7-
.. code:: sh
7+
.. substitution-prompt:: bash
88

99
pip3 install vws-python
1010

@@ -57,7 +57,7 @@ Testing
5757

5858
To write unit tests for code which uses this library, without using your Vuforia quota, you can use the `VWS Python Mock`_ tool:
5959

60-
.. code:: sh
60+
.. substitution-prompt:: bash
6161

6262
pip3 install vws-python-mock
6363

docs/source/release-process.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Perform a Release
2424

2525
E.g.:
2626

27-
.. code:: sh
27+
.. substitution-prompt:: bash
2828

2929
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python
3030
pipsi install keyring
@@ -46,7 +46,7 @@ Add the following information to :file:`~/.pypirc`.
4646
4747
Store your PyPI password:
4848

49-
.. code:: sh
49+
.. substitution-prompt:: bash
5050

5151
keyring set https://upload.pypi.org/legacy/ <Your PyPI username>
5252

@@ -56,15 +56,15 @@ Store your PyPI password:
5656

5757
#. Set environment variables to GitHub credentials, e.g.:
5858

59-
.. code:: sh
59+
.. substitution-prompt:: bash
6060

6161
export GITHUB_TOKEN=75c72ad718d9c346c13d30ce762f121647b502414
62-
export GITHUB_OWNER=adamtheturtle
6362

6463
#. Perform a release:
6564

66-
.. code:: sh
65+
.. substitution-prompt:: bash
6766

68-
curl https://raw.githubusercontent.com/"$GITHUB_OWNER"/vws-python/master/admin/release.sh | bash
67+
export GITHUB_OWNER=|github-owner|
68+
curl https://raw.githubusercontent.com/"$GITHUB_OWNER"/|github-repository|/master/admin/release.sh | bash
6969

7070
.. _GitHub access token instructions: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line/

0 commit comments

Comments
 (0)