Skip to content

Commit dd2a628

Browse files
authored
[mypyc] Various small doc updates (#10177)
Update the index page. Configure mypyc version in conf.py.
1 parent 7e9b57c commit dd2a628

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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 Mypy documentation!
6+
Welcome to mypy documentation!
77
==============================
88

99
Mypy is a static type checker for Python 3 and Python 2.7.

mypyc/doc/conf.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,30 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7-
# -- Path setup --------------------------------------------------------------
7+
import sys
8+
import os
89

910
# If extensions (or modules to document with autodoc) are in another directory,
1011
# add these directories to sys.path here. If the directory is relative to the
1112
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
13-
# import os
14-
# import sys
15-
# sys.path.insert(0, os.path.abspath('.'))
13+
sys.path.insert(0, os.path.abspath('../..'))
1614

15+
from mypy.version import __version__ as mypy_version
1716

1817
# -- Project information -----------------------------------------------------
1918

2019
project = 'mypyc'
2120
copyright = '2020, mypyc team'
2221
author = 'mypyc team'
2322

23+
# The version info for the project you're documenting, acts as replacement for
24+
# |version| and |release|, also used in various other places throughout the
25+
# built documents.
26+
#
27+
# The short X.Y version.
28+
version = mypy_version.split('-')[0]
29+
# The full version, including alpha/beta/rc tags.
30+
release = mypy_version
2431

2532
# -- General configuration ---------------------------------------------------
2633

mypyc/doc/index.rst

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,34 @@
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 mypyc's documentation!
7-
=================================
6+
Welcome to mypyc documentation!
7+
===============================
8+
9+
Mypyc compiles Python modules to C extensions. It uses standard Python
10+
`type hints
11+
<https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html>`_ to
12+
generate fast code.
813

914
.. toctree::
1015
:maxdepth: 2
11-
:caption: Contents:
16+
:caption: First steps
1217

1318
introduction
1419
getting_started
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
:caption: Using mypyc
24+
1525
using_type_annotations
1626
native_classes
1727
differences_from_python
1828
compilation_units
1929

30+
.. toctree::
31+
:maxdepth: 2
32+
:caption: Native operations reference
33+
2034
native_operations
2135
int_operations
2236
bool_operations
@@ -27,6 +41,10 @@ Welcome to mypyc's documentation!
2741
set_operations
2842
tuple_operations
2943

44+
.. toctree::
45+
:maxdepth: 2
46+
:caption: Advanced topics
47+
3048
performance_tips_and_tricks
3149

3250
Indices and tables

mypyc/doc/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ runtime):
2626

2727
* Existing code with type annotations often gets **1.5x to 5x** faster.
2828

29-
* Code tuned for mypyc can be **5x to 15x** faster.
29+
* Code tuned for mypyc can be **5x to 10x** faster.
3030

3131
There is no simple answer to how fast your code will be when compiled.
3232
You should try it out!

0 commit comments

Comments
 (0)