Skip to content

Update python versions, include changes from kxxoling #7

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 8 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true

[*.{html,js,css}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ To install generator-python-package from npm, run:
$ npm install -g generator-python-package
```

Install ``kxxoling/generator-python-package``:

```bash
$ git clone https://github.com/kxxoling/generator-python-package.git
$ cd generator-python-package && npm link
```

Finally, initiate the generator:

```bash
Expand Down
8 changes: 5 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ var PythonPackageGenerator = yeoman.generators.Base.extend({
}

var pythonVersions = [
{ name: "Python 2.6", value: "2.6@py26@Python :: 2.6", checked: false },
{ name: "Python 2.7", value: "2.7@py27@Python :: 2.7", checked: true },
{ name: "Python 3.2", value: "3.2@py32@Python :: 3.2", checked: false },
{ name: "Python 3.3", value: "3.3@py33@Python :: 3.3", checked: false },
{ name: "Python 3.4", value: "3.4@py34@Python :: 3.4", checked: true },
{ name: "Python 3.4", value: "3.4@py34@Python :: 3.4", checked: false },
{ name: "Python 3.5", value: "3.5@py35@Python :: 3.5", checked: true },
{ name: "Python 3.6", value: "3.6@py36@Python :: 3.6", checked: true },
{ name: "Python 3.7", value: "3.7@py37@Python :: 3.7", checked: true },
{ name: "PyPy", value: "pypy@pypy@Python :: Implementation :: PyPy", checked: true },
];

Expand Down Expand Up @@ -212,6 +214,7 @@ var PythonPackageGenerator = yeoman.generators.Base.extend({
this.template('_tox.ini', 'tox.ini');
this.template('_gitignore', '.gitignore');
this.template('_travis.yml', '.travis.yml');
this.template('_editorconfig', '.editorconfig');

if (!pkg.includePackageTests) {
this.template('_manifest.in', 'MANIFEST.in');
Expand All @@ -224,7 +227,6 @@ var PythonPackageGenerator = yeoman.generators.Base.extend({

// pkg.name/
this.template('_root_init.py', pkg.pythonName + '/__init__.py');
this.template('_version.py', pkg.pythonName + '/version.py');

// tests/
this.template('_init.py', 'tests/__init__.py');
Expand Down
7 changes: 0 additions & 7 deletions app/templates/_coveragerc
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

[run]
omit =
*tests.py
Expand Down
10 changes: 10 additions & 0 deletions app/templates/_editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = false
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
7 changes: 0 additions & 7 deletions app/templates/_gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
9 changes: 1 addition & 8 deletions app/templates/_init.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>
# coding: utf-8
7 changes: 0 additions & 7 deletions app/templates/_makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

# lists all available targets
list:
@sh -c "$(MAKE) -p no_targets__ | awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);for(i in A)print A[i]}' | grep -v '__\$$' | grep -v 'make\[1\]' | grep -v 'Makefile' | sort"
Expand Down
7 changes: 0 additions & 7 deletions app/templates/_manifest.in
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

recursive-exclude tests *
7 changes: 0 additions & 7 deletions app/templates/_redis.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

daemonize yes
pidfile /tmp/redis_<%= package.name %>.pid
port 4444
Expand Down
7 changes: 0 additions & 7 deletions app/templates/_redis_tests.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

daemonize yes
pidfile /tmp/redis_<%= package.name %>_tests.pid
port 4448
Expand Down
11 changes: 2 additions & 9 deletions app/templates/_root_init.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# coding: utf-8

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

from <%= package.pythonName %>.version import __version__ # NOQA
__version__ = '<%= package.version %>' # NOQA
12 changes: 3 additions & 9 deletions app/templates/_setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

# coding: utf-8
from setuptools import setup, find_packages

from <%= package.pythonName %> import __version__


tests_require = [
'mock',
'nose',
Expand Down
10 changes: 1 addition & 9 deletions app/templates/_test_base.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

# coding: utf-8
from unittest import TestCase as PythonTestCase


Expand Down
10 changes: 1 addition & 9 deletions app/templates/_test_version.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

# coding: utf-8
from preggy import expect

from <%= package.pythonName %> import __version__
Expand Down
7 changes: 0 additions & 7 deletions app/templates/_tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

[tox]
envlist = <%= package.pythonVersions.join(', ') %>

Expand Down
7 changes: 0 additions & 7 deletions app/templates/_travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

language: python

python:<% for (var i=0; i < package.travis.length; i++) { %>
Expand Down
11 changes: 0 additions & 11 deletions app/templates/_version.py

This file was deleted.