Skip to content

Commit 5343e74

Browse files
authored
git - Merge pull request #98 from DinoTools/type_hints
Add type hints
2 parents a4f62cf + 0ba3f85 commit 5343e74

File tree

8 files changed

+310
-261
lines changed

8 files changed

+310
-261
lines changed

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
# Optionally build your docs in additional formats such as PDF
13+
formats: all
14+
15+
# Optionally set the version of Python and requirements required to build your docs
16+
python:
17+
version: 3.7
18+
install:
19+
- requirements: docs/requirements.txt

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Install
3333

3434
Supported Python versions:
3535

36-
* Python >= 3.6
36+
* Python >= 3.6.2
3737
* PyPy3
3838

3939
**Install:**

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx
2+
sphinx-autodoc-typehints

docs/source/_static/.keep

Whitespace-only changes.

docs/source/conf.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import sys
88
from pathlib import Path
99

10-
from overpy import __about__ as overpy_about
1110

1211
# If extensions (or modules to document with autodoc) are in another directory,
1312
# add these directories to sys.path here. If the directory is relative to the
@@ -25,6 +24,7 @@
2524
# ones.
2625
extensions = [
2726
'sphinx.ext.autodoc',
27+
'sphinx_autodoc_typehints',
2828
'sphinx.ext.todo',
2929
'sphinx.ext.coverage',
3030
'sphinx.ext.viewcode',
@@ -50,10 +50,15 @@
5050
# |version| and |release|, also used in various other places throughout the
5151
# built documents.
5252
#
53-
# The short X.Y version.
54-
version = overpy_about.__version__
55-
# The full version, including alpha/beta/rc tags.
56-
release = overpy_about.__version__
53+
try:
54+
from overpy import __about__ as overpy_about
55+
# The short X.Y version.
56+
version = overpy_about.__version__
57+
# The full version, including alpha/beta/rc tags.
58+
release = overpy_about.__version__
59+
except ImportError:
60+
version = "unknown"
61+
release = version
5762

5863
# The language for content autogenerated by Sphinx. Refer to documentation
5964
# for a list of supported languages.
@@ -93,6 +98,9 @@
9398
# If true, keep warnings as "system message" paragraphs in the built documents.
9499
#keep_warnings = False
95100

101+
# sphinx-autodoc-typehints options
102+
# If True, add stub documentation for undocumented parameters to be able to add type info.
103+
always_document_param_types = True
96104

97105
# -- Options for HTML output ----------------------------------------------
98106

0 commit comments

Comments
 (0)