Skip to main content

setuptools command for uploading Sphinx documentation to PyPI

Project description

This package contains a setuptools command for uploading Sphinx documentation to the Python Package Index (PyPI) at the dedicated URL packages.python.org.

The upload_sphinx command

upload_sphinx will create the necessary zip file out of an arbitrary documentation directory and posts it to the correct URL.

It’s also loosely based on Sphinx’ own setuptools command build_sphinx which allows to easily build documentation from the command line.

The upload_sphinx command has the following options:

  • --repository (-r): url of repository [default: http://pypi.python.org/pypi]

  • --show-response: display full response text from server

  • --upload-dir: directory to upload

Example

Assuming there is an Example package with Sphinx documentation to be uploaded to http://packages.python.org, with the following structure:

Example/
|-- example.py
|-- setup.cfg
|-- setup.py
|-- docs
|   |-- build
|   |   `-- html
|   |-- conf.py
|   |-- index.txt
|   `-- tips_tricks.txt

As with any other setuptools based command, you can define useful defaults in the setup.cfg of your Python package. The following snippet shows how to set the option defaults of the build_sphinx and upload_sphinx setup.py commands:

[build_sphinx]
source-dir = docs/
build-dir  = docs/build
all_files  = 1

[upload_sphinx]
upload-dir = docs/build/html

To build and upload the Sphinx documentation you are now able to run:

$ python setup.py build_sphinx
$ python setup.py upload_sphinx

Alternatively, you can of course just pass the appropriate options directly to the commands:

$ python setup.py build_sphinx --source-dir=docs/ --build-dir=docs/build --all-files
$ python setup.y upload_sphinx --upload-dir=docs/build/html

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

ATD_document-0.1.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file ATD_document-0.1.1.tar.gz.

File metadata

File hashes

Hashes for ATD_document-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55ed2b0cd5911600e8d1253fbdef17ed6327cd81371b451092940ffa9039fd12
MD5 64394ba8203c5a6afb962dc4208f7c9f
BLAKE2b-256 66b5fd0d5ca92b5b6c2a591a1a7ceccacab82e57f1db4009fedec2ada304c3c0

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