Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
huntcsg committed Jun 4, 2016
0 parents commit fafacbf
Show file tree
Hide file tree
Showing 47 changed files with 2,177 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .gitignore
@@ -0,0 +1,68 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
env27/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
.idea/
.tox

# Include
!tests/fake_packages/FakeApp.egg/
tests/fake_packages/FakeApp.egg/EGG-INFO
!tests/fake_packages/FakeApp.egg/FakeApp.egg-info
14 changes: 14 additions & 0 deletions .travis.yml
@@ -0,0 +1,14 @@
language: python
python: 3.5

env:
- TOXENV=py35
- TOXENV=py34
- TOXENV=py33
- TOXENV=py27
- TOXENV=py26
- TOXENV=pypy

install: pip install -U tox

script: tox
Empty file added CHANGES.rst
Empty file.
112 changes: 112 additions & 0 deletions CONTRIBUTING.rst
@@ -0,0 +1,112 @@
.. highlight:: shell

============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/mmerickel/plaster_pastedeploy/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

plaster_pastedeploy could always use more documentation, whether as part of the
official plaster_pastedeploy docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/mmerickel/plaster_pastedeploy/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `plaster_pastedeploy` for local development.

1. Fork the `plaster_pastedeploy` repo on GitHub.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/plaster_pastedeploy.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ python3 -m venv env
$ env/bin/pip install -e .[docs,testing]

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::

$ env/bin/flake8 plaster_pastedeploy tests
$ python setup.py test or py.test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.4 and 3.5, and for PyPy. Check
https://travis-ci.org/mmerickel/plaster_pastedeploy/pull_requests
and make sure that the tests pass for all supported Python versions.

Tips
----

To run a subset of tests::

$ py.test tests.test_plaster_pastedeploy
76 changes: 76 additions & 0 deletions Makefile
@@ -0,0 +1,76 @@
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url

webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"

help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-all - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "dist - package"
@echo "install - install the package to the active Python's site-packages"

clean: clean-build clean-pyc clean-test

clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/

lint:
flake8 plaster_pastedeploy tests

test:
py.test

test-all:
tox

coverage:
coverage run --source plaster_pastedeploy py.test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html

docs:
rm -f docs/plaster_pastedeploy.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ plaster_pastedeploy
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html

servedocs: docs
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

build: clean
python setup.py sdist bdist_wheel
ls -l dist
34 changes: 34 additions & 0 deletions README.rst
@@ -0,0 +1,34 @@
=======
plaster_pastedeploy
=======

.. image:: https://img.shields.io/pypi/v/plaster_pastedeploy.svg
:target: https://pypi.python.org/pypi/plaster_pastedeploy

.. image:: https://img.shields.io/travis/mmerickel/plaster_pastedeploy.svg
:target: https://travis-ci.org/mmerickel/plaster_pastedeploy

.. image:: https://readthedocs.org/projects/plaster_pastedeploy/badge/?version=latest
:target: https://readthedocs.org/projects/plaster_pastedeploy/?badge=latest
:alt: Documentation Status

``plaster_pastedeploy`` is a loader that can parse ini files according to
the standard set by PasteDeploy. It is intended as a plugin for plaster.

Usage
=====

Applications should use ``plaster_pastedeploy`` to load settings from named sections in
a configuration source (usually a file).

Most applications will want to use
``plaster.get_loader(uri, section=None, defaults=None) to get this loader. It then exposes
``get_wsgi_app`` and ``get_wsgi_server``.

.. code-block:: python
import plaster
loader = plaster.get_loader(**kwargs)
settings = loeader.get_settings('development.ini#main')
app = loader.get_wsgi_app(*kwargs)

0 comments on commit fafacbf

Please sign in to comment.