[Python-modules-commits] [sphinx-celery] 01/02: Initial import

Christopher Stuart Hoskin mans0954 at moszumanska.debian.org
Fri Aug 18 07:00:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

mans0954 pushed a commit to tag v1.0.0
in repository sphinx-celery.

commit 5a9730ae2f785cfb8cb31ca1569dcfdceb8eefb7
Author: Ask Solem <ask at celeryproject.org>
Date:   Thu Apr 7 17:19:14 2016 -0700

    Initial import
---
 .coveragerc                          |  11 +
 .gitignore                           |  28 +++
 .travis.yml                          |  22 ++
 AUTHORS                              |   5 +
 Changelog                            |  11 +
 LICENSE                              |  52 +++++
 MANIFEST.in                          |   8 +
 Makefile                             |  36 ++++
 README.rst                           |  61 ++++++
 appveyor.yml                         |  53 +++++
 extra/appveyor/install.ps1           |  85 ++++++++
 extra/appveyor/run_with_compiler.cmd |  47 ++++
 extra/release/removepyc.sh           |   3 +
 requirements/default.txt             |   2 +
 requirements/pkgutils.txt            |   5 +
 requirements/test.txt                |   1 +
 setup.cfg                            |   5 +
 setup.py                             | 152 +++++++++++++
 sphinx_celery/__init__.py            |  33 +++
 sphinx_celery/autodocargspec.py      |  21 ++
 sphinx_celery/conf.py                | 303 ++++++++++++++++++++++++++
 sphinx_celery/github_issues.py       | 110 ++++++++++
 sphinx_celery/setting_crossref.py    |  11 +
 sphinx_celery/signal_crossref.py     |  11 +
 sphinx_celery/static/celery.css_t    | 401 +++++++++++++++++++++++++++++++++++
 sphinx_celery/templates/page.html    |  22 ++
 sphinx_celery/tests/__init__.py      |   0
 sphinx_celery/theme.conf             |   5 +
 sphinx_celery/utils.py               |  16 ++
 tox.ini                              |  36 ++++
 30 files changed, 1556 insertions(+)

diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..6581086
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,11 @@
+[run]
+branch = 1
+cover_pylib = 0
+include=*sphinx_celery/*
+omit = sphinx_celery.tests.*
+
+[report]
+omit =
+    */python?.?/*
+    */site-packages/*
+    */pypy/*
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..23278d6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,28 @@
+.DS_Store
+*.pyc
+*$py.class
+*~
+.*.sw[pon]
+dist/
+*.egg-info
+*.egg
+*.egg/
+doc/__build/*
+build/
+.build/
+pip-log.txt
+.directory
+erl_crash.dump
+*.db
+Documentation/
+.tox/
+.ropeproject/
+.project
+.pydevproject
+.idea/
+.coverage
+celery/tests/cover/
+.ve*
+cover/
+.vagrant/
+*.sqlite3
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..612f9e0
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,22 @@
+language: python
+sudo: false
+cache: false
+python:
+    - '3.5'
+env:
+  global:
+    PYTHONUNBUFFERED=yes
+  matrix:
+    - TOXENV=2.6
+    - TOXENV=2.7
+    - TOXENV=3.3
+    - TOXENV=3.4
+    - TOXENV=3.4
+    - TOXENV=pypy
+    - TOXENV=3.5
+    - TOXENV=pypy3
+install: travis_retry pip install -U tox
+script: tox -v -- -v
+after_success:
+  - .tox/$TRAVIS_PYTHON_VERSION/bin/coverage xml
+  - .tox/$TRAVIS_PYTHON_VERSION/bin/codecov -e TOXENV
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..7e42a5f
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,5 @@
+The Celery theme was created by Armin Ronacher.
+
+Rest of contributors:
+- Ask Solem <ask at celeryproject.org>
+
diff --git a/Changelog b/Changelog
new file mode 100644
index 0000000..ba23946
--- /dev/null
+++ b/Changelog
@@ -0,0 +1,11 @@
+Changes
+=======
+
+.. _version-1.0.0:
+
+1.0.0
+=====
+:release-date: TBA
+:release-by: Ask Solem
+
+- Initial release
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..3fced97
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,52 @@
+Copyright (c) 2012-2016 Ask Solem & contributors.  All rights reserved.
+
+SPHINX_CELERY is licensed under The BSD License (3 Clause, also known as
+the new BSD license).  The license is an OSI approved Open Source
+license and is GPL-compatible(1).
+
+The license text can also be found here:
+http://www.opensource.org/licenses/BSD-3-Clause
+
+License
+=======
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Ask Solem, nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Ask Solem OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Documentation License
+=====================
+
+The documentation portion of SPHINX_CELERY (the rendered contents of the
+"docs" directory of a software distribution or checkout) is supplied
+under the "Creative Commons Attribution-ShareAlike 4.0
+International" (CC BY-SA 4.0) License as described by
+http://creativecommons.org/licenses/by-sa/4.0/
+
+Footnotes
+=========
+(1) A GPL-compatible license makes it possible to
+    combine SPHINX_CELERY with other software that is released
+    under the GPL, it does not mean that we're distributing
+    SPHINX_CELERY under the GPL license.  The BSD license, unlike the GPL,
+    let you distribute a modified version without making your
+    changes open source.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..36cafd9
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,8 @@
+include README.rst Changelog LICENSE
+recursive-include extra README *.py
+recursive-include requirements *.txt
+recursive-include sphinx_celery *.conf
+recursive-include sphinx_celery *.css_t
+recursive-include sphinx_celery *.html
+recursive-include sphinx_celery *.js
+recursive-include sphinx_celery *.css
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7f2e88d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+PROJ=sphinx_celery
+PYTHON=python
+
+flakecheck:
+	flake8 "$(PROJ)"
+
+flakediag:
+	-$(MAKE) flakecheck
+
+flakepluscheck:
+	flakeplus --2.7 "$(PROJ)"
+
+flakeplusdiag:
+	-$(MAKE) flakepluscheck
+
+flakes: flakediag flakeplusdiag
+
+test:
+	nosetests -x
+
+cov:
+	nosetests -x --with-coverage --cover-html --cover-branch
+
+removepyc:
+	-find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
+	-find . -type d -name "__pycache__" | xargs rm -r
+
+gitclean: removepyc
+	git clean -xdn
+
+gitcleanforce:
+	git clean -xdf
+
+distcheck: flakecheck test gitclean
+
+dist: gitcleanforce removepyc
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..b201467
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,61 @@
+=====================================================================
+ Celery Sphinx Utilities
+=====================================================================
+
+:Version: 1.0.0
+:Download: http://pypi.python.org/pypi/sphinx_celery/
+:Source: http://github.com/celery/sphinx_celery/
+:Keywords: Sphinx, documentation, python
+
+About
+=====
+
+This project provides the Celery sphinx theme and common Sphinx utilities.
+
+.. _installation:
+
+Installation
+============
+
+You can install sphinx_celery either via the Python Package Index (PyPI)
+or from source.
+
+To install using `pip`,::
+
+    $ pip install -U sphinx_celery
+
+To install using `easy_install`,::
+
+    $ easy_install -U sphinx_celery
+
+.. _installing-from-source:
+
+Downloading and installing from source
+--------------------------------------
+
+Download the latest version of sphinx_celery from
+http://pypi.python.org/pypi/sphinx_celery/
+
+You can install it by doing the following,::
+
+    $ tar xvfz sphinx_celery.0.0.tar.gz
+    $ cd sphinx_celery.0.0
+    $ python setup.py build
+    # python setup.py install
+
+The last command must be executed as a privileged user if
+you are not currently using a virtualenv.
+
+.. _installing-from-git:
+
+Using the development version
+-----------------------------
+
+With pip
+~~~~~~~~
+
+You can install the latest snapshot of sphinx_celery using the following
+pip command::
+
+    $ pip install https://github.com/celery/sphinx_celery#egg=sphinx_celery
+
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..8677155
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,53 @@
+environment:
+
+  global:
+    # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
+    # /E:ON and /V:ON options are not enabled in the batch script intepreter
+    # See: http://stackoverflow.com/a/13751649/163740
+    WITH_COMPILER: "cmd /E:ON /V:ON /C .\\extra\\appveyor\\run_with_compiler.cmd"
+
+  matrix:
+
+    # Pre-installed Python versions, which Appveyor may upgrade to
+    # a later point release.
+    # See: http://www.appveyor.com/docs/installed-software#python
+
+    - PYTHON: "C:\\Python27"
+      PYTHON_VERSION: "2.7.x"
+      PYTHON_ARCH: "32"
+
+    - PYTHON: "C:\\Python34"
+      PYTHON_VERSION: "3.4.x"
+      PYTHON_ARCH: "32"
+
+    - PYTHON: "C:\\Python27-x64"
+      PYTHON_VERSION: "2.7.x"
+      PYTHON_ARCH: "64"
+      WINDOWS_SDK_VERSION: "v7.0"
+
+    - PYTHON: "C:\\Python34-x64"
+      PYTHON_VERSION: "3.4.x"
+      PYTHON_ARCH: "64"
+      WINDOWS_SDK_VERSION: "v7.1"
+
+
+init:
+  - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
+
+install:
+  - "powershell extra\\appveyor\\install.ps1"
+  - "%PYTHON%/Scripts/pip.exe install -U setuptools"
+
+build: off
+
+test_script:
+  - "%WITH_COMPILER% %PYTHON%/python setup.py test"
+
+after_test:
+  - "%WITH_COMPILER% %PYTHON%/python setup.py bdist_wheel"
+
+artifacts:
+  - path: dist\*
+
+#on_success:
+#  - TODO: upload the content of dist/*.whl to a public wheelhouse
diff --git a/extra/appveyor/install.ps1 b/extra/appveyor/install.ps1
new file mode 100644
index 0000000..3f05628
--- /dev/null
+++ b/extra/appveyor/install.ps1
@@ -0,0 +1,85 @@
+# Sample script to install Python and pip under Windows
+# Authors: Olivier Grisel and Kyle Kastner
+# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
+
+$BASE_URL = "https://www.python.org/ftp/python/"
+$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
+$GET_PIP_PATH = "C:\get-pip.py"
+
+
+function DownloadPython ($python_version, $platform_suffix) {
+    $webclient = New-Object System.Net.WebClient
+    $filename = "python-" + $python_version + $platform_suffix + ".msi"
+    $url = $BASE_URL + $python_version + "/" + $filename
+
+    $basedir = $pwd.Path + "\"
+    $filepath = $basedir + $filename
+    if (Test-Path $filename) {
+        Write-Host "Reusing" $filepath
+        return $filepath
+    }
+
+    # Download and retry up to 5 times in case of network transient errors.
+    Write-Host "Downloading" $filename "from" $url
+    $retry_attempts = 3
+    for($i=0; $i -lt $retry_attempts; $i++){
+        try {
+            $webclient.DownloadFile($url, $filepath)
+            break
+        }
+        Catch [Exception]{
+            Start-Sleep 1
+        }
+   }
+   Write-Host "File saved at" $filepath
+   return $filepath
+}
+
+
+function InstallPython ($python_version, $architecture, $python_home) {
+    Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
+    if (Test-Path $python_home) {
+        Write-Host $python_home "already exists, skipping."
+        return $false
+    }
+    if ($architecture -eq "32") {
+        $platform_suffix = ""
+    } else {
+        $platform_suffix = ".amd64"
+    }
+    $filepath = DownloadPython $python_version $platform_suffix
+    Write-Host "Installing" $filepath "to" $python_home
+    $args = "/qn /i $filepath TARGETDIR=$python_home"
+    Write-Host "msiexec.exe" $args
+    Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru
+    Write-Host "Python $python_version ($architecture) installation complete"
+    return $true
+}
+
+
+function InstallPip ($python_home) {
+    $pip_path = $python_home + "/Scripts/pip.exe"
+    $python_path = $python_home + "/python.exe"
+    if (-not(Test-Path $pip_path)) {
+        Write-Host "Installing pip..."
+        $webclient = New-Object System.Net.WebClient
+        $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
+        Write-Host "Executing:" $python_path $GET_PIP_PATH
+        Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
+    } else {
+        Write-Host "pip already installed."
+    }
+}
+
+function InstallPackage ($python_home, $pkg) {
+    $pip_path = $python_home + "/Scripts/pip.exe"
+    & $pip_path install $pkg
+}
+
+function main () {
+    InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
+    InstallPip $env:PYTHON
+    InstallPackage $env:PYTHON wheel
+}
+
+main
diff --git a/extra/appveyor/run_with_compiler.cmd b/extra/appveyor/run_with_compiler.cmd
new file mode 100644
index 0000000..3a472bc
--- /dev/null
+++ b/extra/appveyor/run_with_compiler.cmd
@@ -0,0 +1,47 @@
+:: To build extensions for 64 bit Python 3, we need to configure environment
+:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
+::
+:: To build extensions for 64 bit Python 2, we need to configure environment
+:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
+::
+:: 32 bit builds do not require specific environment configurations.
+::
+:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
+:: cmd interpreter, at least for (SDK v7.0)
+::
+:: More details at:
+:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
+:: http://stackoverflow.com/a/13751649/163740
+::
+:: Author: Olivier Grisel
+:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
+ at ECHO OFF
+
+SET COMMAND_TO_RUN=%*
+SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
+
+SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
+IF %MAJOR_PYTHON_VERSION% == "2" (
+    SET WINDOWS_SDK_VERSION="v7.0"
+) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
+    SET WINDOWS_SDK_VERSION="v7.1"
+) ELSE (
+    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
+    EXIT 1
+)
+
+IF "%PYTHON_ARCH%"=="64" (
+    ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
+    SET DISTUTILS_USE_SDK=1
+    SET MSSdk=1
+    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
+    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
+    ECHO Executing: %COMMAND_TO_RUN%
+    call %COMMAND_TO_RUN% || EXIT 1
+) ELSE (
+    ECHO Using default MSVC build environment for 32 bit architecture
+    ECHO Executing: %COMMAND_TO_RUN%
+    call %COMMAND_TO_RUN% || EXIT 1
+)
diff --git a/extra/release/removepyc.sh b/extra/release/removepyc.sh
new file mode 100755
index 0000000..9aaf365
--- /dev/null
+++ b/extra/release/removepyc.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+(cd "${1:-.}";
+        find . -name "*.pyc" | xargs rm -- 2>/dev/null) || echo "ok"
diff --git a/requirements/default.txt b/requirements/default.txt
new file mode 100644
index 0000000..4765b9b
--- /dev/null
+++ b/requirements/default.txt
@@ -0,0 +1,2 @@
+Sphinx>=1.4
+sphinxcontrib-cheeseshop
diff --git a/requirements/pkgutils.txt b/requirements/pkgutils.txt
new file mode 100644
index 0000000..ff0c55b
--- /dev/null
+++ b/requirements/pkgutils.txt
@@ -0,0 +1,5 @@
+setuptools>=20.6.7
+wheel>=0.29.0
+flake8>=2.5.4
+flakeplus>=1.1
+tox>=2.3.1
diff --git a/requirements/test.txt b/requirements/test.txt
new file mode 100644
index 0000000..65c3149
--- /dev/null
+++ b/requirements/test.txt
@@ -0,0 +1 @@
+case>=1.0.3
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..a4a39bb
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[nosetests]
+where = sphinx_celery/tests
+
+[wheel]
+universal = 1
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..e306edd
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+try:
+    from setuptools import setup, find_packages
+    from setuptools.command.test import test
+except ImportError:
+    raise
+    from ez_setup import use_setuptools
+    use_setuptools()
+    from setuptools import setup, find_packages  # noqa
+    from setuptools.command.test import test              # noqa
+
+import os
+import re
+import sys
+import codecs
+
+NAME = 'sphinx_celery'
+extra = {}
+
+# -*- Classifiers -*-
+
+classes = """
+    Development Status :: 5 - Production/Stable
+    Programming Language :: Python
+    Programming Language :: Python :: 2
+    Programming Language :: Python :: 2.7
+    Programming Language :: Python :: 2.6
+    Programming Language :: Python :: 3
+    Programming Language :: Python :: 3.3
+    Programming Language :: Python :: 3.4
+    Programming Language :: Python :: 3.5
+    License :: OSI Approved :: BSD License
+    Intended Audience :: Developers
+    Operating System :: OS Independent
+"""
+classifiers = [s.strip() for s in classes.split('\n') if s]
+
+# -*- Distribution Meta -*-
+
+re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)')
+re_vers = re.compile(r'VERSION\s*=.*?\((.*?)\)')
+re_doc = re.compile(r'^"""(.+?)"""')
+
+
+def rq(s):
+    return s.strip("\"'")
+
+
+def add_default(m):
+    attr_name, attr_value = m.groups()
+    return ((attr_name, rq(attr_value)),)
+
+
+def add_version(m):
+    v = list(map(rq, m.groups()[0].split(', ')))
+    return (('VERSION', '.'.join(v[0:3]) + ''.join(v[3:])),)
+
+
+def add_doc(m):
+    return (('doc', m.groups()[0]),)
+
+pats = {re_meta: add_default,
+        re_vers: add_version,
+        re_doc: add_doc}
+here = os.path.abspath(os.path.dirname(__file__))
+with open(os.path.join(here, 'sphinx_celery', '__init__.py')) as meta_fh:
+    meta = {}
+    for line in meta_fh:
+        if line.strip() == '# -eof meta-':
+            break
+        for pattern, handler in pats.items():
+            m = pattern.match(line.strip())
+            if m:
+                meta.update(handler(m))
+
+# -*- Installation Requires -*-
+
+py_version = sys.version_info
+is_jython = sys.platform.startswith('java')
+is_pypy = hasattr(sys, 'pypy_version_info')
+
+
+def strip_comments(l):
+    return l.split('#', 1)[0].strip()
+
+
+def _pip_requirement(req):
+    if req.startswith('-r '):
+        _, path = req.split()
+        return reqs(*path.split('/'))
+    return [req]
+
+
+def _reqs(*f):
+    return [
+        _pip_requirement(r) for r in (
+            strip_comments(l) for l in open(
+                os.path.join(os.getcwd(), 'requirements', *f)).readlines()
+        ) if r]
+
+
+def reqs(*f):
+    return [req for subreq in _reqs(*f) for req in subreq]
+
+# -*- Long Description -*-
+
+if os.path.exists('README.rst'):
+    long_description = codecs.open('README.rst', 'r', 'utf-8').read()
+else:
+    long_description = 'See http://pypi.python.org/pypi/sphinx_celery/'
+
+# -*- Entry Points -*- #
+
+# -*- %%% -*-
+
+
+setup(
+    name=NAME,
+    version=meta['VERSION'],
+    description=meta['doc'],
+    author=meta['author'],
+    author_email=meta['contact'],
+    url=meta['homepage'],
+    platforms=['any'],
+    license='BSD',
+    packages=find_packages(exclude=['ez_setup', 'tests', 'tests.*']),
+    package_data={
+        'sphinx_celery': [
+            'theme.conf',
+        ],
+        os.path.join('sphinx_celery', 'static'): [
+            'celery.css_t',
+        ],
+        os.path.join('sphinx_celery', 'templates'): [
+            'page.html',
+        ],
+    },
+    include_package_data=True,
+    zip_safe=False,
+    install_requires=reqs('default.txt'),
+    tests_require=reqs('test.txt'),
+    test_suite='nose.collector',
+    classifiers=classifiers,
+    entry_points={
+        'sphinx_themes': [
+            'path = sphinx_celery:get_html_theme_path',
+        ],
+    },
+    long_description=long_description,
+    **extra)
diff --git a/sphinx_celery/__init__.py b/sphinx_celery/__init__.py
new file mode 100644
index 0000000..b9da6d1
--- /dev/null
+++ b/sphinx_celery/__init__.py
@@ -0,0 +1,33 @@
+"""Sphinx Celery Theme."""
+from __future__ import absolute_import, unicode_literals
+
+import os
+
+from collections import namedtuple
+
+version_info_t = namedtuple(
+    'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
+)
+
+VERSION = version_info = version_info_t(1, 0, 0, '', '')
+
+__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION)
+__author__ = 'Ask Solem'
+__contact__ = 'ask at celeryproject.org'
+__homepage__ = 'http://github.com/celery/sphinx_celery'
+__docformat__ = 'restructuredtext'
+
+# -eof meta-
+
+__all__ = ['get_html_templates_path', 'get_html_theme_path']
+
+
+def get_html_theme_path():
+    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+
+
+def get_html_templates_path():
+    return os.path.join(
+        os.path.abspath(os.path.dirname((__file__))),
+        'templates',
+    )
diff --git a/sphinx_celery/autodocargspec.py b/sphinx_celery/autodocargspec.py
new file mode 100644
index 0000000..8a2294e
--- /dev/null
+++ b/sphinx_celery/autodocargspec.py
@@ -0,0 +1,21 @@
+from __future__ import absolute_import, unicode_literals
+
+from sphinx.ext import autodoc as _autodoc
+from sphinx.util import inspect
+
+
+def wrapped_getargspec(fun, *args, **kwargs):
+    while 1:
+        try:
+            wrapped = fun.__wrapped__
+            if wrapped is fun:
+                break
+            fun = wrapped
+        except AttributeError:
+            break
+    return inspect.getargspec(fun, *args, **kwargs)
+_autodoc.getargspec = wrapped_getargspec
+
+
+def setup(app):
+    app.require_sphinx('1.0')
diff --git a/sphinx_celery/conf.py b/sphinx_celery/conf.py
new file mode 100644
index 0000000..67582aa
--- /dev/null
+++ b/sphinx_celery/conf.py
@@ -0,0 +1,303 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import, unicode_literals
+
+import os
+import sys
+
+from . import get_html_templates_path
+
+PY3 = sys.version_info[0] >= 3
+
+LINKCODE_URL = 'https://github.com/{proj}/tree/{branch}/{filename}.py'
+GITHUB_BRANCH = 'master'
+
+EXTENSIONS = [
+    'sphinx.ext.autodoc',
+    'sphinx.ext.intersphinx',
+    'sphinx.ext.todo',
+    'sphinx.ext.coverage',
+    'sphinx.ext.imgmath',
+    'sphinx.ext.ifconfig',
+    'sphinx.ext.viewcode',
+    'sphinxcontrib.cheeseshop',
+
+    'sphinx_celery.autodocargspec',
+    'sphinx_celery.github_issues',
+    'sphinx_celery.signal_crossref',
+    'sphinx_celery.setting_crossref',
+]
+
+INTERSPHINX_MAPPING = {
+    'python': ('http://docs.python.org/dev/', None),
+    'sphinx': ('http://www.sphinx-doc.org/en/stable/', None),
+    'kombu': ('http://kombu.readthedocs.org/en/master/', None),
+    'celery': ('http://docs.celeryproject.org/en/latest', None),
+    'djcelery': ('http://django-celery.readthedocs.org/en/latest/', None),
+    'cyme': ('http://cyme.readthedocs.org/en/latest/', None),
+    'amqp': ('http://amqp.readthedocs.org/en/latest/', None),
+    'vine': ('http://vine.readthedocs.org/en/latest/', None),
+    'flower': ('http://flower.readthedocs.org/en/latest/', None),
+    'redis': ('http://redis-py.readthedocs.org/en/latest/', None),
+    'django': ('http://django.readthedocs.org/en/latest/', None),
+    'boto': ('http://boto.readthedocs.org/en/latest/', None),
+    'sqlalchemy': ('http://sqlalchemy.readthedocs.org/en/latest', None),
+    'kazoo': ('http://kazoo.readthedocs.org/en/latest/', None),
+    'pyzmq': ('http://pyzmq.readthedocs.org/en/latest/', None),
+    'msgpack': ('http://pythonhosted.org/msgpack-python/', None),
+    'riak': ('http://basho.github.io/riak-python-client/', None),
+    'pylibmc': ('http://sendapatch.se/projects/pylibmc/', None),
+    'eventlet': ('http://eventlet.net/doc/', None),
+    'gevent': ('http://gevent.org/', None),
+    'pyOpenSSL': ('http://pyopenssl.readthedocs.org/en/stable/', None),
+    'nose': ('http://nose.readthedocs.org/en/latest', None),
+    'tox': ('http://tox.readthedocs.org/en/latest', None),
+}
+
+string_types = (str,) if PY3 else (basestring,)
+
+
+def add_paths(config_file, path_additions):
+    this = os.path.dirname(os.path.abspath(config_file))
+
+    sys.path.insert(0, os.path.join(this, os.pardir))
+    for path in path_additions:
+        sys.path.append(os.path.join(this, path))
+
+
+def configure_django(django_settings, **config):
+    if django_settings:
+        os.environ['DJANGO_SETTINGS_MODULE'] = django_settings
+    else:
+        from django.conf import settings  # noqa
+        if not settings.configured:
+            settings.configure(**config)
+    try:
+        from django import setup as django_setup
+    except ImportError:
+        pass
+    else:
+        django_setup()
+
+
+def import_package(package):
+    if isinstance(package, string_types):
+        return __import__(package)
+    return package
+
+
+def prepare_intersphinx_mapping(project, mapping,
+                                include, exclude, **extra):
+    if include:
+        mapping = dict((k, v) for k, v in mapping.items() if k in include)
+    if exclude:
+        mapping = dict((k, v) for k, v in mapping.items() if k not in exclude)
+    mapping = dict(mapping, **extra)
+
+    # Remove project itself from intersphinx
+    mapping.pop(project.lower(), None)
+
+    return mapping
+
+
+def create_linkcode_resolver(linkcode_url, github_project, github_branch):
+    def linkcode_resolve(domain, info):
+        if domain != 'py' or not info['module']:
+            return
+        filename = info['module'].replace('.', '/')
+        return linkcode_url.format(
+            proj=github_project,
+            branch=github_branch,
+            filename=filename,
+        )
+    return linkcode_resolve
+
+
+def build_config(
+        package, config_file, project,
+        author=None,
+        author_name=None,
+        github_project=None,
+        webdomain=None,
+        canonical_url=None,
+        canonical_stable_url=None,
+        canonical_dev_url=None,
+        django_settings=None,
+        configure_django_settings={},
+        copyright=None,
+        publisher=None,
+        description='',
+        path_additions=['_ext'],
+        version_dev=None,
+        version_stable=None,
+        extensions=EXTENSIONS,
+        extra_extensions=[],
+        linkcode_url=LINKCODE_URL,
+        github_branch=GITHUB_BRANCH,
+        master_doc='index',
+        html_logo=None,
+        html_prepend_sidebars=[],
+        templates_path=None,
+        latex_logo=None,
+        intersphinx_mapping=INTERSPHINX_MAPPING,
+        extra_intersphinx_mapping={},
+        include_intersphinx=frozenset(),
+        exclude_intersphinx=frozenset(),
+        **kwargs):
+    add_paths(config_file, path_additions)
+    if configure_django_settings or django_settings:
+        configure_django(django_settings, **configure_django_settings or {})
+    package = import_package(package)
+    description = description or package.__doc__
+    author = author or package.__author__
+    author_name = author_name or author
+
+    if not canonical_dev_url:
+        canonical_dev_url = '/'.join([
+            canonical_url.rstrip('/'), 'en', 'master',
+        ])
+    if not canonical_stable_url:
+        canonical_stable_url = '/'.join([
+            canonical_url.rstrip('/'), 'en', 'latest',
+        ])
+
+    if templates_path is None:
+        templates_path = ['_templates']
+    if version_dev:
+        templates_path.append(get_html_templates_path())
+
+    version = '.'.join(map(str, package.VERSION[0:2]))
+
+    conf = dict(
+        extensions=extensions + extra_extensions,
+
+        project=project,
+        github_project=github_project,
+
+        html_show_sphinx=False,
+
+        # Add any paths that contain templates here,
+        #   relative to this directory.
+        templates_path=templates_path,
+
+        # The suffix of source filenames.
+        source_suffix='.rst',
+
+        # The master toctree document.
+        master_doc=master_doc,
+
+        copyright='{0}, {1}'.format(copyright, author),
+
+        # The short X.Y version.
+        version=version,
+
+        # The full version, including alpha/beta/rc tags.
+        release=package.__version__,
+
... 771 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sphinx-celery.git



More information about the Python-modules-commits mailing list