Skip to content

Commit

Permalink
updated pyscaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianneubauer committed Jun 20, 2016
1 parent b0f6fd1 commit dadf589
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[run]
branch = True
source = postgraas_server
omit = */_version.py
# omit = bad_file.py

[report]
# Regexes for lines to exclude from consideration
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.py[cod]
*.so
*.cfg
!setup.cfg
*.orig
*.log
*.pot
Expand All @@ -19,6 +20,7 @@ __pycache__/*

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info

Expand All @@ -33,7 +35,7 @@ coverage.xml
build/*
dist/*
sdist/*
docs/_rst/*
docs/api/*
docs/_build/*
cover/*
MANIFEST
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Developers
==========

* sebastianneubauer <[email protected]>
* Sebastian Neubauer <[email protected]>
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=========
Changelog
=========

Version 0.1
===========

- Feature A added
- FIX: nasty bug #1729 fixed
- add your changes here!
1 change: 1 addition & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2016 Sebastian Neubauer
64 changes: 8 additions & 56 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,18 @@
postgraas_server
================

Your project was successfully set up with PyScaffold 0.7.
Following features are available:

Packaging
=========
Add a short description here!

Run ``python setup.py sdist``, ``python setup.py bdist`` or
``python setup.py bdist_wheel`` to build a source, binary or wheel
distribution.

Description
===========

Complete Git Integration
========================
A LONGER DESCRIPTION OF YOUR PROJECT GOES HERE...

Your project is already an initialised Git repository and ``setup.py`` uses
the information of tags to infer the version of your project with the help of
`versioneer <https://github.com/warner/python-versioneer>`_.
To use this feature you need to tag with the format ``vMAJOR.MINOR[.REVISION]``
, e.g. ``v0.0.1`` or ``v0.1``. The prefix ``v`` is needed!
Run ``python setup.py version`` to retrieve the current `PEP440
<http://www.python.org/dev/peps/pep-0440/>`_-compliant version. This version
will be used when building a package and is also accessible through
``my_project.__version__``.
The version will be ``unknown`` until you have added a first tag.

Note
====

Sphinx Documentation
====================

Build the documentation with ``python setup.py docs`` and run doctests with
``python setup.py doctest``. Start editing the file ``docs/index.rst`` to
extend the documentation.


Unittest & Coverage
===================

Run ``python setup.py test`` to run all unittests defined in the subfolder
``tests`` with the help of `py.test <http://pytest.org/>`_. The py.test plugin
`pytest-cov <https://github.com/schlamar/pytest-cov>`_ is used to automatically
generate a coverage report. For usage with a continuous integration software
JUnit and Coverage XML output can be activated. Checkout ``putup -h`` for
details.

Requirements Management
=======================

Add the requirements of your project to the ``requirements.txt`` file which
will be automatically used by ``setup.py``.


Easy Updating
=============

Keep your project's scaffold up-to-date by applying
``putput --update my_project`` when a new version of PyScaffold was released.
It may also be used to change the url, license and description setting.


.. note::

Replace the content of this file with a description of your project.

This project has been set up using PyScaffold 2.5.6. For details and usage
information on PyScaffold see http://pyscaffold.readthedocs.org/.
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PyScaffold.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/postgraas_server.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PyScaffold.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/postgraas_server.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $HOME/.local/share/devhelp/PyScaffold"
@echo "# ln -s $(BUILDDIR)/devhelp $HOME/.local/share/devhelp/PyScaffold"
@echo "# mkdir -p $HOME/.local/share/devhelp/postgraas_server"
@echo "# ln -s $(BUILDDIR)/devhelp $HOME/.local/share/devhelp/postgraas_server"
@echo "# devhelp"

epub:
Expand Down
2 changes: 2 additions & 0 deletions docs/authors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. _authors:
.. include:: ../AUTHORS.rst
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. _changes:
.. include:: ../CHANGES.rst
44 changes: 32 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,33 @@
# serve to show the default.

import sys
import os
import inspect


__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))

# 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.insert(0, os.path.abspath('.'))

# -- Hack for ReadTheDocs ------------------------------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
import inspect
from sphinx import apidoc

__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))

output_dir = os.path.join(__location__, "../docs/api")
module_dir = os.path.join(__location__, "../postgraas_server")
cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)
apidoc.main(cmd_line.split(" "))

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

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -30,7 +45,8 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
'sphinx.ext.autosummary', 'sphinx.ext.viewcode', 'sphinx.ext.coverage',
'sphinx.ext.doctest', 'sphinx.ext.ifconfig', 'sphinx.ext.pngmath']
'sphinx.ext.doctest', 'sphinx.ext.ifconfig', 'sphinx.ext.pngmath',
'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -46,7 +62,7 @@

# General information about the project.
project = u'postgraas_server'
copyright = u'2014, sebastianneubauer'
copyright = u'2016, Sebastian Neubauer'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -99,7 +115,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = 'alabaster'

# 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
Expand All @@ -111,7 +127,12 @@

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
try:
from postgraas_server import __version__ as version
except ImportError:
pass
else:
release = version

# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
Expand Down Expand Up @@ -192,7 +213,7 @@
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'user_guide.tex', u'postgraas_server Documentation',
u'sebastianneubauer', 'manual'),
u'Sebastian Neubauer', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -226,4 +247,3 @@
'pandas': ('http://pandas.pydata.org/pandas-docs/stable', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
}

12 changes: 8 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ This is the documentation of **postgraas_server**.
rst-files in ``docs`` and adding them to the `toctree
<http://sphinx-doc.org/markup/toctree.html>`_ below. Use then
`references <http://sphinx-doc.org/markup/inline.html>`__ in order to link
them from this page. It is also possible to refer to the documentation of
other Python packages with the `Python domain syntax
them from this page, e.g. :ref:`authors <authors>` and :ref:`changes`.
It is also possible to refer to the documentation of other Python packages
with the `Python domain syntax
<http://sphinx-doc.org/domains.html#the-python-domain>`__. By default you
can reference the documentation of `Sphinx <http://sphinx.pocoo.org>`__,
`Python <http://docs.python.org/>`__, `matplotlib
Expand All @@ -29,8 +30,11 @@ Contents

.. toctree::
:maxdepth: 2

Module Reference <_rst/modules>

License <license>
Authors <authors>
Changelog <changes>
Module Reference <api/modules>


Indices and tables
Expand Down
7 changes: 7 additions & 0 deletions docs/license.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _license:

=======
License
=======

.. literalinclude:: ../LICENSE.txt
8 changes: 5 additions & 3 deletions postgraas_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from ._version import get_versions
import pkg_resources

__version__ = get_versions()['version']
del get_versions
try:
__version__ = pkg_resources.get_distribution(__name__).version
except:
__version__ = 'unknown'
4 changes: 3 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# numpy
# scipy>=0.9
mock
httpretty
httpretty
pytest
pytest-cov
77 changes: 77 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[metadata]
name = postgraas_server
summary = Add a short description here!
author = Sebastian Neubauer
author-email = [email protected]
license = none
home-page = http://...
description-file = README.rst
# Add here all kinds of additional classifiers as defined under
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifier =
Development Status :: 4 - Beta
Programming Language :: Python

[entry_points]
# Add here console scripts like:
# console_scripts =
# script_name = postgraas_server.module:function
# For example:
# console_scripts =
# fibonacci = postgraas_server.skeleton:run
# as well as other entry_points.


[files]
# Add here 'data_files', 'packages' or 'namespace_packages'.
# Additional data files are defined as key value pairs of source and target:
packages =
postgraas_server
# data_files =
# share/postgraas_server_docs = docs/*

[extras]
# Add here additional requirements for extra features, like:
# PDF =
# ReportLab>=1.2
# RXP

[test]
# py.test options when running `python setup.py test`
addopts = tests

[pytest]
# Options for py.test:
# Specify command line options as you would do when invoking py.test directly.
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
addopts =
--cov postgraas_server --cov-report term-missing
--verbose

[aliases]
docs = build_sphinx

[bdist_wheel]
# Use this option if your package is pure-python
universal = 1

[build_sphinx]
source_dir = docs
build_dir = docs/_build

[pbr]
# Let pbr run sphinx-apidoc
autodoc_tree_index_modules = True
# autodoc_tree_excludes = ...
# Let pbr itself generate the apidoc
# autodoc_index_modules = True
# autodoc_exclude_modules = ...
# Convert warnings to errors
# warnerrors = True

[devpi:upload]
# Options for the devpi: PyPI server and packaging tool
# VCS export must be deactivated since we are using setuptools-scm
no-vcs = 1
formats = bdist_wheel
Loading

0 comments on commit dadf589

Please sign in to comment.