Skip to main content

Python Deployment

Project description

Python-Deployment

Documentation Status

Examples of Python Deployment Workflows

Documentation with Sphinx and Read the Docs

Setting up Sphinx

In order to generate a documentation from the docstrings we are going to use Sphinx.

  1. Create a docs directory in your projects main directory.
mkdir docs
cd docs
  1. Use the quickstart script provided by Sphinx.
sphinx-quickstart

And use the following settings.

sphinx-quickstart

  1. Change source/conf.py. The first thing to do is to uncomment and change following lines at the top of the file.
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))

A few extra extensions should also be added. The autosummary extension generates function/method/attribute summary lists from the docstrings, napoleon enables Sphinx to parse Numpy and Google style docstrings. Finally, the numpydoc extension loads several extensions for better support of Numpy.

extensions = ['sphinx.ext.autodoc',
    'sphinx.ext.intersphinx',
    'sphinx.ext.coverage',
    'sphinx.ext.imgmath',
    'sphinx.ext.ifconfig',
    'sphinx.ext.viewcode',
    'sphinx.ext.autosummery',
    'sphinx.ext.napoleon',
    'numpydoc']

And some more changes:

  • master_doc = 'contents' for a better overview page, which we will later add.
  • html_style = 'sphinx_rtd_theme' for a nicer theme.
  • For compatibility with Read the Docs:
html_theme_options = {
    #    'canonical_url': '',
    #    'analytics_id': '',
    'logo_only': False,
    'display_version': True,
    'prev_next_buttons_location': "top",
    #    'style_external_links': False,
    #    'vcs_pageview_mode': '',
    # Toc options
    'collapse_navigation': False,
    'sticky_navigation': True,
    'navigation_depth': 4,
    'includehidden': True,
    'titles_only': False,
}
  • Comment out # html_static_path = ['_static']
  • In case you use pictures hosted somewhere, add
suppress_warnings = [
    "image.nonlocal_uri",
    #    'app.add_directive',  # this evtl. suppresses the numpydoc induced warning
]
  • And finally add some intersphinx mappings for links:
intersphinx_mapping = {
    "Python 3.7": ("https://docs.python.org/3.6", None),
    "Python": ("https://docs.python.org/", None),
    "NumPy": ("http://docs.scipy.org/doc/numpy/", None),
    "SciPy": ("http://docs.scipy.org/doc/scipy/reference", None),
    "matplotlib": ("http://matplotlib.org", None),
}

Now you are ready to create your docs. Have a look at the docs/source/ folder for an example and how to use autosummary in the source files.

Publishing on Read the Docs

  1. In the docs/ folder create a file requirements.txt with a content like
numpy>=1.14.5
numpydoc
  1. Log in or sign up on Read the Docs
  2. Click on Import a Project and select your repository on GitHub and activate advanced options.
  3. Select Python as the programming language.
  4. Add docs/requirements.txt path to the Requirements file field.
  5. Tick Use system packages.

Now, your documentation should be ready and hosted on Read the Docs. With every push to your repo, the documentation will automatically be built by Read the Docs.

In case you want to add a readthedocs badge, have a look at the first line after the heading of the README.md of this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-deployment-0.0.1.tar.gz (118.9 kB view details)

Uploaded Source

Built Distributions

python_deployment-0.0.1-cp36-cp36m-manylinux1_x86_64.whl (397.9 kB view details)

Uploaded CPython 3.6m

python_deployment-0.0.1-cp36-cp36m-manylinux1_i686.whl (377.8 kB view details)

Uploaded CPython 3.6m

python_deployment-0.0.1-cp27-cp27mu-manylinux1_x86_64.whl (395.9 kB view details)

Uploaded CPython 2.7mu

python_deployment-0.0.1-cp27-cp27mu-manylinux1_i686.whl (378.4 kB view details)

Uploaded CPython 2.7mu

python_deployment-0.0.1-cp27-cp27m-manylinux1_x86_64.whl (396.0 kB view details)

Uploaded CPython 2.7m

python_deployment-0.0.1-cp27-cp27m-manylinux1_i686.whl (378.4 kB view details)

Uploaded CPython 2.7m

File details

Details for the file python-deployment-0.0.1.tar.gz.

File metadata

  • Download URL: python-deployment-0.0.1.tar.gz
  • Upload date:
  • Size: 118.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for python-deployment-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e696ef79a10675bd2be823650e7c48b1031fbc42685061806fdad751dcc5e45f
MD5 098ad0c03a1b754136347f062725aee5
BLAKE2b-256 fa795c17dab5671d0a7bd4e389b5927080437eca089f693ee3612e1feecf54e6

See more details on using hashes here.

File details

Details for the file python_deployment-0.0.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_deployment-0.0.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 397.9 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for python_deployment-0.0.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0430d690528eb474359fba19a52f2c4b5c6ff3a529bb836b79fb28ce21928d47
MD5 e5d4af3d910cbb1f97a3ecafe1832e53
BLAKE2b-256 244492b412fd34beea3a363a9fad525d298dd4a1211397d07ecf2d75a9fe5ea1

See more details on using hashes here.

File details

Details for the file python_deployment-0.0.1-cp36-cp36m-manylinux1_i686.whl.

File metadata

  • Download URL: python_deployment-0.0.1-cp36-cp36m-manylinux1_i686.whl
  • Upload date:
  • Size: 377.8 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for python_deployment-0.0.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 6dfdfe9979689c731795e160823c115cfae3582f5813646d892569dc98d0a839
MD5 4083ecb9434b61e484dd42309b607668
BLAKE2b-256 1b08f9812e71eac228c6fe5f2afef8f1e071351811805476d8935d4dadfc0e4b

See more details on using hashes here.

File details

Details for the file python_deployment-0.0.1-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_deployment-0.0.1-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 395.9 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for python_deployment-0.0.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3d45085a47e2b0adf7368c051a048b376aa9a91e5a2b14250888ffe83413cfc1
MD5 bd47029a01efbc1bc0a6b6c7dfc41166
BLAKE2b-256 f22d3e77b09a077e7d0d5e2e215a55416ebb5362f25510ab3e6300c1bb32ec1b

See more details on using hashes here.

File details

Details for the file python_deployment-0.0.1-cp27-cp27mu-manylinux1_i686.whl.

File metadata

  • Download URL: python_deployment-0.0.1-cp27-cp27mu-manylinux1_i686.whl
  • Upload date:
  • Size: 378.4 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for python_deployment-0.0.1-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 016f3aeec0b337ea1da150ef8d61eb56974fdad2a26e9f53abb741e7c719e6c3
MD5 32abc46b36288e89912b15d0f1ec8da9
BLAKE2b-256 9127deff1e05a8cf2dc41c7eaf7b394b3b7a42b4f75a0e1904a4b091a7c3ec05

See more details on using hashes here.

File details

Details for the file python_deployment-0.0.1-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: python_deployment-0.0.1-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 396.0 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for python_deployment-0.0.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4272985f7682022707c48308a3e42fd8fd84876484e29ee66b24a72b6044bed2
MD5 5d0683c7e8a9c93fbf176669e368ae7b
BLAKE2b-256 abeaf824e8c77da70e0d0d9af3e268045756c9351e4fa788bf51871270443ca1

See more details on using hashes here.

File details

Details for the file python_deployment-0.0.1-cp27-cp27m-manylinux1_i686.whl.

File metadata

  • Download URL: python_deployment-0.0.1-cp27-cp27m-manylinux1_i686.whl
  • Upload date:
  • Size: 378.4 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for python_deployment-0.0.1-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 95f41f6550ec4f9f8b10d3cdd69e279bf0fbad52e3bdb572b46240e4d4c5fac9
MD5 74cf1b02b707f4d7be4a567031050b34
BLAKE2b-256 aa59d51c680c5ca2b8f66ad28ee2476dc8918b0a7df804b67eb4a4231ad1d141

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page