Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated template to look like the Python Packaging User Guid's sample… #18

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions {{cookiecutter.package_name}}/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# General things to ignore
build/
dist/
*.py[cod]
__pycache__/
*~

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
*.egg-info/
eggs
parts
bin
Expand All @@ -17,7 +20,6 @@ develop-eggs
.installed.cfg
lib
lib64
__pycache__

# Installer logs
pip-log.txt
Expand All @@ -26,6 +28,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
.cache

# Translations
*.mo
Expand Down
24 changes: 12 additions & 12 deletions {{cookiecutter.package_name}}/setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import io
import os
import re
""" Minimal cookiecutter template """

from setuptools import find_packages
from setuptools import setup
from os import path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to use import os and use os.path, the same with io.

from io import open
from setuptools import find_packages, setup

here = path.abspath(path.dirname(__file__))

def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(text_type(r':[a-z]+:`~?(.*?)`'), text_type(r'``\1``'), fd.read())

# Get the long description from the README file.
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't take into account the removal of Sphinx directives.

long_description = f.read()

setup(
name="{{ cookiecutter.package_name }}",
Expand All @@ -23,14 +20,17 @@ def read(filename):
author_email="{{ cookiecutter.author_email }}",

description="{{ cookiecutter.package_description }}",
long_description=read("README.rst"),
long_description=long_description,

packages=find_packages(exclude=('tests',)),

install_requires=[],

zip_safe=False,

classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.package_name}}/tests/test_sample.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sample Test passing with nose and pytest
# Sample Test passing with nose and pytest

def test_pass():
assert True, "dummy sample test"
def test_success():
assert True
4 changes: 2 additions & 2 deletions {{cookiecutter.package_name}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist = py27,py34,py35,py36,py37
envlist = p{27,34,35,36,37}

[testenv]
commands = py.test {{ cookiecutter.package_name }}
commands = py.test tests
deps = pytest