forked from conda/cookiecutter-conda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of cookiecutter-conda-python template
- Loading branch information
Showing
16 changed files
with
224 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[report] | ||
omit = | ||
setup.py | ||
tests/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"full_name": "Full Name", | ||
"email": "Email Address", | ||
"github_username": "github_username", | ||
"repo_name": "repository_name", | ||
"package_name": "{{ cookiecutter.repo_name.lower().replace(' ', '_') }}", | ||
"project_short_description": "Short description", | ||
"version": "0.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
testpaths = tests/test_template.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from setuptools import setup | ||
|
||
setup( | ||
name='cookiecutter-conda-python', | ||
packages=[], | ||
version='0.1.0', | ||
description='Cookiecutter template for a Python conda package', | ||
author='Continuum Analytics, Inc.', | ||
author_email='conda@continuum.io', | ||
url='https://github.com/conda/cookiecutter-conda-package', | ||
keywords=['cookiecutter', 'template', 'package', 'conda', 'python'], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Natural Language :: English', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Topic :: Software Development', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def context(): | ||
"""Test template creation with test parameters.""" | ||
return { | ||
"full_name": "test name", | ||
"email": "test@email.com", | ||
"github_username": "test_username", | ||
"repo_name": "test_repo", | ||
"package_name": "test_repo", | ||
"project_short_description": "Test description.", | ||
"version": "0.1.0" | ||
} | ||
|
||
|
||
def test_template(cookies, context): | ||
"""Test the template for proper creation.""" | ||
result = cookies.bake(extra_context=context) | ||
|
||
assert result.exit_code == 0 | ||
assert result.exception is None | ||
assert result.project.basename == 'test_repo' | ||
assert result.project.isdir() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[report] | ||
omit = | ||
setup.py | ||
{{ cookiecutter.package_name }}/__main__.py | ||
{{ cookiecutter.package_name }}/tests/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
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/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# pyenv python configuration file | ||
.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Config file for automatic testing at travis-ci.org | ||
|
||
language: python | ||
- "2.7" | ||
- "3.6" | ||
sudo: required | ||
before_install: | ||
- sudo apt-get update | ||
install: | ||
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then | ||
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; | ||
else | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; | ||
fi | ||
- bash miniconda.sh -b -p $HOME/miniconda | ||
- export PATH="$HOME/miniconda/bin:$PATH" | ||
- hash -r | ||
- conda config --set always_yes yes | ||
- conda update -q conda | ||
- conda install -n conda-build | ||
- conda install anaconda-client | ||
- conda install pytest-cov | ||
- pip install coveralls | ||
- conda build . | ||
- conda install --use-local {{ cookiecutter.package_name }} | ||
- conda info -a | ||
script: | ||
- pytest -s -v --cov={{ cookiecutter.package_name }} | ||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=============================== | ||
{{ cookiecutter.package_name }} | ||
=============================== | ||
|
||
|
||
.. image:: https://img.shields.io/travis/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}.svg | ||
:target: https://travis-ci.org/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} | ||
|
||
|
||
{{ cookiecutter.project_short_description }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package: | ||
name: {{ cookiecutter.package_name }} | ||
version: {{ cookiecutter.version }} | ||
build: | ||
# If the installation is complex, or different between Unix and Windows, use separate bld.bat and build.sh files instead of this key. | ||
# Add the line "skip: True # [py<35]" (for example) to limit to Python 3.5 and newer, or "skip: True # [not win]" to limit to Windows. | ||
script: python setup.py install | ||
requirements: | ||
build: | ||
- python | ||
- setuptools | ||
run: | ||
- python | ||
about: | ||
home: https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} | ||
summary: {{ cookiecutter.project_short_description }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from setuptools import setup | ||
|
||
requirements = [ | ||
# package requirements go here | ||
] | ||
|
||
setup( | ||
name='{{ cookiecutter.repo_name }}', | ||
version='{{ cookiecutter.version }}', | ||
description="{{ cookiecutter.project_short_description }}", | ||
author="{{ cookiecutter.full_name.replace('\"', '\\\"') }}", | ||
author_email='{{ cookiecutter.email }}', | ||
url='https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}', | ||
packages=['{{ cookiecutter.package_name }}', '{{ cookiecutter.package_name }}.tests'], | ||
entry_points={ | ||
'console_scripts': [ | ||
'{{ cookiecutter.package_name }}={{ cookiecutter.package_name }}.cli:cli' | ||
] | ||
}, | ||
install_requires=requirements, | ||
keywords='{{ cookiecutter.repo_name }}', | ||
classifiers=[ | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.6', | ||
] | ||
) |
Empty file.
3 changes: 3 additions & 0 deletions
3
{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from {{ cookiecutter.package_name }} import cli | ||
|
||
cli() |
2 changes: 2 additions & 0 deletions
2
{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/cli.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def cli(): | ||
return "CLI template" |
Empty file.
4 changes: 4 additions & 0 deletions
4
{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/tests/test_cli.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from {{ cookiecutter.package_name }} import cli | ||
|
||
def test_cli_template(): | ||
assert cli.cli() == 'CLI template' |