Skip to content

Commit

Permalink
[mypyc] Various small doc updates (#10177)
Browse files Browse the repository at this point in the history
Update the index page. Configure mypyc version in conf.py.
  • Loading branch information
JukkaL authored Mar 7, 2021
1 parent 7e9b57c commit dd2a628
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Mypy documentation!
Welcome to mypy documentation!
==============================

Mypy is a static type checker for Python 3 and Python 2.7.
Expand Down
17 changes: 12 additions & 5 deletions mypyc/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------
import sys
import os

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

from mypy.version import __version__ as mypy_version

# -- Project information -----------------------------------------------------

project = 'mypyc'
copyright = '2020, mypyc team'
author = 'mypyc team'

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

# -- General configuration ---------------------------------------------------

Expand Down
24 changes: 21 additions & 3 deletions mypyc/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,34 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to mypyc's documentation!
=================================
Welcome to mypyc documentation!
===============================

Mypyc compiles Python modules to C extensions. It uses standard Python
`type hints
<https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html>`_ to
generate fast code.

.. toctree::
:maxdepth: 2
:caption: Contents:
:caption: First steps

introduction
getting_started

.. toctree::
:maxdepth: 2
:caption: Using mypyc

using_type_annotations
native_classes
differences_from_python
compilation_units

.. toctree::
:maxdepth: 2
:caption: Native operations reference

native_operations
int_operations
bool_operations
Expand All @@ -27,6 +41,10 @@ Welcome to mypyc's documentation!
set_operations
tuple_operations

.. toctree::
:maxdepth: 2
:caption: Advanced topics

performance_tips_and_tricks

Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion mypyc/doc/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runtime):

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

* Code tuned for mypyc can be **5x to 15x** faster.
* Code tuned for mypyc can be **5x to 10x** faster.

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

0 comments on commit dd2a628

Please sign in to comment.