mirror of
https://github.com/sprockets/cookiecutter-sprockets.git
synced 2024-11-14 19:29:27 +00:00
Initial commit
This commit is contained in:
commit
1c32f96d1e
17 changed files with 213 additions and 0 deletions
25
README.rst
Normal file
25
README.rst
Normal file
|
@ -0,0 +1,25 @@
|
|||
Sprockets Package Template
|
||||
==========================
|
||||
|
||||
This is a cookiecutter_ template that generates a sprockets package that
|
||||
is consistent with the rest of the eco-system and ready to go in a few
|
||||
seconds. You will need to install the cookiecutter_ utility, then point
|
||||
it at this repository, answer a few questions, and start coding.
|
||||
|
||||
$ cookiecutter https://github.com/sprockets/cookiecutter-sprockets
|
||||
project_name (default is "")? packagename
|
||||
full_name (default is "")? John Doe
|
||||
email (default is "")? john.doe@example.com
|
||||
description (default is "")? This goes into setup.py
|
||||
git_org (default is "sprockets")?
|
||||
year (default is "2014")?
|
||||
$ cd sprockets.packagename
|
||||
$ ls
|
||||
.travis.yml dev-requirements.txt setup.py
|
||||
LICENSE doc/ sprockets/
|
||||
MANIFEST.in requirements.txt test-requirements.txt
|
||||
README.rst setup.cfg tests/
|
||||
|
||||
As you can see, there are a handful of files there for you already.
|
||||
|
||||
.. _cookiecutter:: http://cookiecutter.readthedocs.org/en/latest/index.html
|
8
cookiecutter.json
Normal file
8
cookiecutter.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"project_name": "",
|
||||
"full_name": "",
|
||||
"email": "",
|
||||
"description": "",
|
||||
"git_org": "sprockets",
|
||||
"year": "2014"
|
||||
}
|
14
sprockets.{{cookiecutter.project_name}}/.travis.yml
Normal file
14
sprockets.{{cookiecutter.project_name}}/.travis.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
language: python
|
||||
python:
|
||||
- 2.6
|
||||
- 2.7
|
||||
- 3.3
|
||||
- 3.4
|
||||
install:
|
||||
- pip install -r dev-requirements.txt
|
||||
- pip install -e .
|
||||
script: nosetests
|
||||
after_sucess:
|
||||
- coveralls
|
25
sprockets.{{cookiecutter.project_name}}/LICENSE
Normal file
25
sprockets.{{cookiecutter.project_name}}/LICENSE
Normal file
|
@ -0,0 +1,25 @@
|
|||
Copyright (c) 2014 AWeber Communications
|
||||
All rights reserved.
|
||||
|
||||
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 Sprockets 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 THE COPYRIGHT HOLDER 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.
|
6
sprockets.{{cookiecutter.project_name}}/MANIFEST.in
Normal file
6
sprockets.{{cookiecutter.project_name}}/MANIFEST.in
Normal file
|
@ -0,0 +1,6 @@
|
|||
include LICENSE
|
||||
include *requirements.txt
|
||||
graft doc
|
||||
graft tests
|
||||
global-exclude __pycache__
|
||||
global-exclude *.pyc
|
3
sprockets.{{cookiecutter.project_name}}/README.rst
Normal file
3
sprockets.{{cookiecutter.project_name}}/README.rst
Normal file
|
@ -0,0 +1,3 @@
|
|||
sprockets.{{ cookiecutter.project_name }}
|
||||
{{ '=' * (10 + cookiecutter.project_name|length) }}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
-r requirements.txt
|
||||
-r test-requirements.txt
|
||||
flake8>=2.1,<3
|
||||
sphinx>=1.2,<2
|
||||
sphinx-rtd-theme>=0.1,<1.0
|
||||
sphinxcontrib-httpdomain>=1.2,<2
|
|
@ -0,0 +1,6 @@
|
|||
Changelog
|
||||
---------
|
||||
|
||||
* Next Release
|
||||
|
||||
- Implement greatness!
|
29
sprockets.{{cookiecutter.project_name}}/doc/conf.py
Normal file
29
sprockets.{{cookiecutter.project_name}}/doc/conf.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python
|
||||
import sphinx_rtd_theme
|
||||
|
||||
from sprockets.{{cookiecutter.project_name}} import version_info, __version__
|
||||
|
||||
|
||||
needs_sphinx = '1.0'
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinxcontrib.httpdomain',
|
||||
]
|
||||
templates_path = []
|
||||
source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
project = '{{cookiecutter.project_name}}'
|
||||
copyright = '{{cookiecutter.year}}, {{cookiecutter.full_name}}'
|
||||
version = __version__
|
||||
release = __version__
|
||||
if len(version_info) > 3:
|
||||
release += '-{0}'.format(str(v) for v in version_info[3:])
|
||||
exclude_patterns = []
|
||||
pygments_style = 'sphinx'
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/', None),
|
||||
'requests': ('https://requests.readthedocs.org/en/latest/', None),
|
||||
}
|
7
sprockets.{{cookiecutter.project_name}}/doc/index.rst
Normal file
7
sprockets.{{cookiecutter.project_name}}/doc/index.rst
Normal file
|
@ -0,0 +1,7 @@
|
|||
.. include:: ../README.rst
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 2
|
||||
|
||||
changelog
|
1
sprockets.{{cookiecutter.project_name}}/requirements.txt
Normal file
1
sprockets.{{cookiecutter.project_name}}/requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
tornado>=4,<5
|
19
sprockets.{{cookiecutter.project_name}}/setup.cfg
Normal file
19
sprockets.{{cookiecutter.project_name}}/setup.cfg
Normal file
|
@ -0,0 +1,19 @@
|
|||
[bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
[build_sphinx]
|
||||
all-files = 1
|
||||
source-dir = doc
|
||||
build-dir = build/doc
|
||||
|
||||
[nosetests]
|
||||
match = should_
|
||||
include = _tests
|
||||
with-coverage = 1
|
||||
cover-package = sprockets.{{cookiecutter.project_name}},tests
|
||||
nocapture = 1
|
||||
verbose = 1
|
||||
|
||||
[flake8]
|
||||
exclude = build,dist,doc,env
|
||||
|
59
sprockets.{{cookiecutter.project_name}}/setup.py
Normal file
59
sprockets.{{cookiecutter.project_name}}/setup.py
Normal file
|
@ -0,0 +1,59 @@
|
|||
import codecs
|
||||
import sys
|
||||
|
||||
import setuptools
|
||||
|
||||
from sprockets.{{cookiecutter.project_name}} import __version__
|
||||
|
||||
|
||||
def read_requirements_file(req_name):
|
||||
requirements = []
|
||||
try:
|
||||
with codecs.open(req_name, encoding='utf-8') as req_file:
|
||||
for req_line in req_file:
|
||||
if '#' in req_line:
|
||||
req_line = req_line[0:req_line.find('#')].strip()
|
||||
if req_line:
|
||||
requirements.append(req_line.strip())
|
||||
except IOError:
|
||||
pass
|
||||
return requirements
|
||||
|
||||
|
||||
install_requires = read_requirements_file('requirements.txt')
|
||||
setup_requires = read_requirements_file('setup-requirements.txt')
|
||||
tests_require = read_requirements_file('test-requirements.txt')
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
install_requires.append('argparse')
|
||||
install_requires.append('logutils')
|
||||
tests_require.append('unittest2')
|
||||
if sys.version_info < (3, 0):
|
||||
tests_require.append('mock')
|
||||
|
||||
setuptools.setup(
|
||||
name='sprockets.{{cookiecutter.project_name}}',
|
||||
version=__version__,
|
||||
description='{{cookiecutter.description}}',
|
||||
long_description=codecs.open('README.rst', encoding='utf-8').read(),
|
||||
url='https://github.com/{{cookiecutter.git_org}}/sprockets.{{cookiecutter.project_name}}.git',
|
||||
author='{{cookiecutter.full_name}}',
|
||||
author_email='{{cookiecutter.email}}',
|
||||
license=codecs.open('LICENSE', encoding='utf-8').read(),
|
||||
classifiers=[
|
||||
'Development Status :: 3 - Alpha',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
],
|
||||
packages=setuptools.find_packages(
|
||||
exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']),
|
||||
namespace_packages=['sprockets'],
|
||||
install_requires=install_requires,
|
||||
setup_requires=setup_requires,
|
||||
tests_require=tests_require,
|
||||
zip_safe=True,
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
__import__('pkg_resources').declare_namespace(__name__)
|
|
@ -0,0 +1,2 @@
|
|||
version_info = (0, 0, 0)
|
||||
__version__ = '.'.join(str(v) for v in version_info)
|
|
@ -0,0 +1,2 @@
|
|||
coveralls>=0.4,<1
|
||||
nose>=1.3,<2
|
Loading…
Reference in a new issue