From 449f73aba5a14c98b72dbd985a5f6df5fa0f09f7 Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Tue, 19 Apr 2011 21:30:21 +1200 Subject: [PATCH 1/5] fixed issue with package_dir in basic_package --- skeleton/examples/basic-package/setup.py_tmpl | 1 - skeleton/tests/test_examples.py | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/skeleton/examples/basic-package/setup.py_tmpl b/skeleton/examples/basic-package/setup.py_tmpl index 4ee037e..1a9fffb 100644 --- a/skeleton/examples/basic-package/setup.py_tmpl +++ b/skeleton/examples/basic-package/setup.py_tmpl @@ -34,7 +34,6 @@ setup( license=read_file('LICENSE'), namespace_packages={ns_packages!r}, packages={packages!r}, - package_dir = {{'': os.path.dirname(__file__)}}, include_package_data=True, zip_safe=False, install_requires=[ diff --git a/skeleton/tests/test_examples.py b/skeleton/tests/test_examples.py index c2a9c7a..f189bb0 100644 --- a/skeleton/tests/test_examples.py +++ b/skeleton/tests/test_examples.py @@ -261,19 +261,21 @@ def test_main(self): self.assertTrue(tmp.exists('README.rst')) self.assertTrue(tmp.exists('foo/__init__.py')) - setup = tmp.join('setup.py') + setup = 'setup.py' # Test egg_info can be run proc = subprocess.Popen( [sys.executable, setup, 'egg_info'], shell=False, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + cwd=tmp.path) self.assertEqual(proc.wait(), 0) # Test classifiers proc = subprocess.Popen( [sys.executable, setup, '--classifiers'], shell=False, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + cwd=tmp.path) self.assertEqual(proc.wait(), 0) classifiers = proc.stdout.read().decode().splitlines() self.assertTrue( From d9abaec6a532c64f0555d1b0ca27bd5a48f16021 Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Wed, 20 Apr 2011 17:32:30 +1200 Subject: [PATCH 2/5] added a sphinx-package example and some console entry points (no tests yet) --- MANIFEST.in | 19 +- setup.py | 7 +- skeleton/examples/sphinx-package/HISTORY | 3 + skeleton/examples/sphinx-package/INSTALL_tmpl | 62 ++++++ skeleton/examples/sphinx-package/MANIFEST.in | 10 + skeleton/examples/sphinx-package/README_tmpl | 10 + skeleton/examples/sphinx-package/VERSION | 1 + .../sphinx-package/docs/Makefile_tmpl | 95 +++++++++ .../sphinx-package/docs/build/empty_file | 0 .../sphinx-package/docs/make.bat_tmpl | 114 ++++++++++ .../sphinx-package/docs/source/conf.py_tmpl | 198 ++++++++++++++++++ .../sphinx-package/docs/source/history.rst | 1 + .../sphinx-package/docs/source/index.rst_tmpl | 23 ++ .../docs/source/installation.rst | 1 + .../sphinx-package/docs/source/overview.rst | 5 + skeleton/examples/sphinx-package/setup.cfg | 8 + .../examples/sphinx-package/setup.py_tmpl | 50 +++++ skeleton/examples/sphinxpackage.py | 54 +++++ 18 files changed, 642 insertions(+), 19 deletions(-) create mode 100644 skeleton/examples/sphinx-package/HISTORY create mode 100644 skeleton/examples/sphinx-package/INSTALL_tmpl create mode 100644 skeleton/examples/sphinx-package/MANIFEST.in create mode 100644 skeleton/examples/sphinx-package/README_tmpl create mode 100644 skeleton/examples/sphinx-package/VERSION create mode 100644 skeleton/examples/sphinx-package/docs/Makefile_tmpl create mode 100644 skeleton/examples/sphinx-package/docs/build/empty_file create mode 100644 skeleton/examples/sphinx-package/docs/make.bat_tmpl create mode 100644 skeleton/examples/sphinx-package/docs/source/conf.py_tmpl create mode 100644 skeleton/examples/sphinx-package/docs/source/history.rst create mode 100644 skeleton/examples/sphinx-package/docs/source/index.rst_tmpl create mode 100644 skeleton/examples/sphinx-package/docs/source/installation.rst create mode 100644 skeleton/examples/sphinx-package/docs/source/overview.rst create mode 100644 skeleton/examples/sphinx-package/setup.cfg create mode 100644 skeleton/examples/sphinx-package/setup.py_tmpl create mode 100644 skeleton/examples/sphinxpackage.py diff --git a/MANIFEST.in b/MANIFEST.in index 63ba5c5..098cce5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,24 +17,7 @@ include docs/overview.rst include setup.py include skeleton/__init__.py include skeleton/core.py -include skeleton/examples/__init__.py -include skeleton/examples/basic-module/README.rst -include skeleton/examples/basic-module/setup.py_tmpl -include skeleton/examples/basic-module/{module_name}.py -include skeleton/examples/basic-package/MANIFEST.in -include skeleton/examples/basic-package/README.rst -include skeleton/examples/basic-package/distribute_setup.py -include skeleton/examples/basic-package/setup.py_tmpl -include skeleton/examples/basicpackage.py -include skeleton/examples/licenses.py -include skeleton/examples/licenses/bsd/LICENSE_tmpl -include skeleton/examples/licenses/gpl/COPYING -include skeleton/examples/licenses/gpl/LICENSE_tmpl -include skeleton/examples/licenses/lgpl/COPYING -include skeleton/examples/licenses/lgpl/COPYING.LESSER -include skeleton/examples/licenses/lgpl/LICENSE_tmpl -include skeleton/examples/licenses/no-license/LICENSE_tmpl -include skeleton/examples/mkmodule.py +recursive-include skeleton/examples/ * include skeleton/tests/__init__.py include skeleton/tests/skeletons/dynamic-content/bar/baz.txt_tmpl include skeleton/tests/skeletons/dynamic-content/foo.txt diff --git a/setup.py b/setup.py index d73a0fa..6b9984d 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def read_file(name): PROJECT = 'skeleton' -VERSION = '0.6' +VERSION = '0.6.1' URL = 'http://dinoboff.github.com/skeleton' AUTHOR = 'Damien Lebrun' AUTHOR_EMAIL = 'dinoboff@gmail.com' @@ -58,6 +58,11 @@ def read_file(name): 'virtualenvwrapper.project.template': [ 'package = skeleton.examples.basicpackage:virtualenv_warpper_hook', ], + 'console_scripts': [ + 'skeleton_module = skeleton.examples.mkmodule:main', + 'skeleton_package = skeleton.examples.basicpackage:main', + 'skeleton_package_sphinx = skeleton.examples.sphinxpackage:main', + ], }, classifiers=[ 'Development Status :: 4 - Beta', diff --git a/skeleton/examples/sphinx-package/HISTORY b/skeleton/examples/sphinx-package/HISTORY new file mode 100644 index 0000000..e0766c3 --- /dev/null +++ b/skeleton/examples/sphinx-package/HISTORY @@ -0,0 +1,3 @@ +History +======= + diff --git a/skeleton/examples/sphinx-package/INSTALL_tmpl b/skeleton/examples/sphinx-package/INSTALL_tmpl new file mode 100644 index 0000000..6ad97b0 --- /dev/null +++ b/skeleton/examples/sphinx-package/INSTALL_tmpl @@ -0,0 +1,62 @@ +======== +Installation +======== + +{project_name} uses distribute for installation therefore it may be installed +using: + +* from source on the command-line or +* from pypi using pip or easy_install. + +From source +----------- + +1) Download the source distribution of {project_name}. +2) Unzip the distribution into a directory. +3) cd into that directory and type the following command (assuming python + is in your path (on Linux systems root access may be required) + + .. code-block:: sh + + > python setup.py install + +4) {project_name} should now be available inside you system python as + + .. code-block:: py + + >>> import {package_name} + +From pypi +--------- + +1) type the following command (assuming pip + is in your path (on Linux systems root access may be required) + + .. code-block:: sh + + > pip install {project_name} + +4) {project_name} should now be available inside you system python as + + .. code-block:: py + + >>> import {package_name} + + +Documentation +------------- + +{project_name} uses sphinx for its documentation. Please install spinx either +via pip or easy_install or from your package mangement system. + +To use sphinx to build the documentation +from source use the following command from the root directory of the project + +.. code-block:: sh + + > python setup.py build_sphinx + +The resulting html files will be in docs/build/html + + + diff --git a/skeleton/examples/sphinx-package/MANIFEST.in b/skeleton/examples/sphinx-package/MANIFEST.in new file mode 100644 index 0000000..68cb73b --- /dev/null +++ b/skeleton/examples/sphinx-package/MANIFEST.in @@ -0,0 +1,10 @@ +include MANIFEST.in +include README +include HISTORY +include VERSION +include INSTALL +include LICENSE +include distribute_setup.py +include setup.py +recursive-include docs/source * +include docs/build/empty_file diff --git a/skeleton/examples/sphinx-package/README_tmpl b/skeleton/examples/sphinx-package/README_tmpl new file mode 100644 index 0000000..68c9e9a --- /dev/null +++ b/skeleton/examples/sphinx-package/README_tmpl @@ -0,0 +1,10 @@ +{project_name} provides {package_name} + +{short_description} + +TODO +---- + +Place the rest of the readme file, in rst format, here. + +This is also used on pypi as the long_description diff --git a/skeleton/examples/sphinx-package/VERSION b/skeleton/examples/sphinx-package/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/skeleton/examples/sphinx-package/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/skeleton/examples/sphinx-package/docs/Makefile_tmpl b/skeleton/examples/sphinx-package/docs/Makefile_tmpl new file mode 100644 index 0000000..b0d71d9 --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/Makefile_tmpl @@ -0,0 +1,95 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +SOURCEDIR = source +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR) + +.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{project_name}.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{project_name}.qhc" + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished; the epub files are in $(BUILDDIR)/epub." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/skeleton/examples/sphinx-package/docs/build/empty_file b/skeleton/examples/sphinx-package/docs/build/empty_file new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/examples/sphinx-package/docs/make.bat_tmpl b/skeleton/examples/sphinx-package/docs/make.bat_tmpl new file mode 100644 index 0000000..c7aa435 --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/make.bat_tmpl @@ -0,0 +1,114 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +set SPHINXBUILD=sphinx-build +set BUILDDIR=build +set SOURCEDIR=source +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %SOURCEDIR% +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{project_name}.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{project_name}.ghc + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/skeleton/examples/sphinx-package/docs/source/conf.py_tmpl b/skeleton/examples/sphinx-package/docs/source/conf.py_tmpl new file mode 100644 index 0000000..3362171 --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/source/conf.py_tmpl @@ -0,0 +1,198 @@ +# -*- coding: utf-8 -*- +# +# {project_name} documentation build configuration file, created by +# sphinx-quickstart on Mon May 10 14:24:02 2010. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, 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. +#sys.path.append(os.path.abspath('.')) + +_here = os.path.dirname(__file__) +sys.path.insert(0, os.path.join(_here, '../')) + +# -- General configuration ----------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', ] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = {project_name!r} +copyright = u'2011, {author}' + +# 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 = open(os.path.join('..', '..', 'VERSION')).read().rpartition('.')[0] +# The full version, including alpha/beta/rc tags. +release = open(os.path.join('..', '..', 'VERSION')).read() + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directory, that shouldn't be searched +# for source files. +exclude_trees = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {{}} +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {{}} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {{}} + +# If false, no module index is generated. +#html_use_modindex = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = '{project_name} doc' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', '{project_name}.tex', u'{project_name} Documentation', + {author!r}, 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True + + diff --git a/skeleton/examples/sphinx-package/docs/source/history.rst b/skeleton/examples/sphinx-package/docs/source/history.rst new file mode 100644 index 0000000..823230c --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/source/history.rst @@ -0,0 +1 @@ +.. include:: ../../HISTORY diff --git a/skeleton/examples/sphinx-package/docs/source/index.rst_tmpl b/skeleton/examples/sphinx-package/docs/source/index.rst_tmpl new file mode 100644 index 0000000..608d1ef --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/source/index.rst_tmpl @@ -0,0 +1,23 @@ +======================================= +Welcome to {project_name}'s documentation! +======================================= + +:Author: {author} <{author_email}> +:Date: |today| +:Description: {short_description} + + +.. toctree:: + :maxdepth: 2 + + overview + installation + history + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/skeleton/examples/sphinx-package/docs/source/installation.rst b/skeleton/examples/sphinx-package/docs/source/installation.rst new file mode 100644 index 0000000..fb170ba --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/source/installation.rst @@ -0,0 +1 @@ +.. include:: ../../INSTALL diff --git a/skeleton/examples/sphinx-package/docs/source/overview.rst b/skeleton/examples/sphinx-package/docs/source/overview.rst new file mode 100644 index 0000000..e4cd15b --- /dev/null +++ b/skeleton/examples/sphinx-package/docs/source/overview.rst @@ -0,0 +1,5 @@ +======== +Overview +======== + +.. include:: ../../README diff --git a/skeleton/examples/sphinx-package/setup.cfg b/skeleton/examples/sphinx-package/setup.cfg new file mode 100644 index 0000000..be0ac76 --- /dev/null +++ b/skeleton/examples/sphinx-package/setup.cfg @@ -0,0 +1,8 @@ +[upload_docs] +upload-dir = docs/build/html + +[build_sphinx] +source-dir = docs/source +build-dir = docs/build +all_files = 1 + diff --git a/skeleton/examples/sphinx-package/setup.py_tmpl b/skeleton/examples/sphinx-package/setup.py_tmpl new file mode 100644 index 0000000..35b6b5f --- /dev/null +++ b/skeleton/examples/sphinx-package/setup.py_tmpl @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +# Bootstrap installation of Distribute +import distribute_setup +distribute_setup.use_setuptools() + +import os + +from setuptools import setup + + +PROJECT = {project_name!r} +VERSION = open('VERSION').read().strip() +URL = '' +AUTHOR = {author!r} +AUTHOR_EMAIL = {author_email!r} +DESC = {short_description!r} + +def read_file(file_name): + file_path = os.path.join( + os.path.dirname(__file__), + file_name + ) + return open(file_path).read() + +setup( + name=PROJECT, + version=VERSION, + description=DESC, + long_description=read_file('README'), + author=AUTHOR, + author_email=AUTHOR_EMAIL, + url=URL, + license=read_file('LICENSE'), + namespace_packages={ns_packages!r}, + packages={packages!r}, + include_package_data=True, + zip_safe=False, + install_requires=[ + # -*- Required files -*- + ], + entry_points = {{ + # -*- Entry points -*- + }}, + classifiers=[ + # see http://pypi.python.org/pypi?:action=list_classifiers + # -*- Classifiers -*- + "Programming Language :: Python", + ], +) diff --git a/skeleton/examples/sphinxpackage.py b/skeleton/examples/sphinxpackage.py new file mode 100644 index 0000000..baf0f11 --- /dev/null +++ b/skeleton/examples/sphinxpackage.py @@ -0,0 +1,54 @@ +""" +Skeleton to create a project with sphinx support. +""" + +from __future__ import with_statement + +import logging +import os + +from skeleton import Skeleton, Var +from skeleton.examples.basicpackage import BasicPackage +from skeleton.utils import get_loggger + +_LOG = get_loggger(__name__) + + +class SphinxPackage(Skeleton): + """Create a new package package with sphinx setup. + includes features from basicpackage: + Create a new package package (with namespace support) with the setup.py, + README.rst and MANIFEST.in files already setup. + + Require the following variables: + + - project_name; + - package_name; + - author; + - author_email; + - license; + - and short_description. + + + """ + + src = 'sphinx-package' + variables = [ + Var('project_name'), + Var('package_name'), + Var('author'), + Var('author_email'), + Var('license'), + Var('short_description') + ] + required_skeletons = [ + BasicPackage, + ] + + +def main(argv=None): + """Bootstrap SphinxPackage.""" + SphinxPackage.cmd(argv) + +if __name__ == '__main__': + main() From 6b6caf825bca1a59da126770871b05f774e11d5c Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Wed, 20 Apr 2011 17:36:04 +1200 Subject: [PATCH 3/5] fix for bug in basic package --- skeleton/examples/basic-package/MANIFEST.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skeleton/examples/basic-package/MANIFEST.in b/skeleton/examples/basic-package/MANIFEST.in index 256bb36..d92a68a 100644 --- a/skeleton/examples/basic-package/MANIFEST.in +++ b/skeleton/examples/basic-package/MANIFEST.in @@ -1,4 +1,5 @@ include MANIFEST.in include README.rst +include LICENSE include distribute_setup.py -include setup.py \ No newline at end of file +include setup.py From 561414f212ba91cf97f05afdd67d32b607be47c3 Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Thu, 21 Apr 2011 16:59:57 +1200 Subject: [PATCH 4/5] bug fix for python 2.x not liking unicode in package_names --- skeleton/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skeleton/utils.py b/skeleton/utils.py index 959a5d2..b7ac3ea 100644 --- a/skeleton/utils.py +++ b/skeleton/utils.py @@ -129,6 +129,7 @@ def prompt(prompt_): """ result = raw_input(prompt_) try: - return result.decode(sys.stdin.encoding) + return result + #return result.decode(sys.stdin.encoding) except AttributeError: return result From b5e3f6279b592ee89965495da9464389d2af230f Mon Sep 17 00:00:00 2001 From: Stuart Mitchell Date: Fri, 22 Apr 2011 12:48:30 +1200 Subject: [PATCH 5/5] fixed errors in MANIFEST.in --- MANIFEST.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 098cce5..7deb9d5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,7 +17,8 @@ include docs/overview.rst include setup.py include skeleton/__init__.py include skeleton/core.py -recursive-include skeleton/examples/ * +recursive-include skeleton/examples * +recursive-exclude skeleton/examples *.pyc include skeleton/tests/__init__.py include skeleton/tests/skeletons/dynamic-content/bar/baz.txt_tmpl include skeleton/tests/skeletons/dynamic-content/foo.txt