Skip to content

Commit d6f9ba6

Browse files
committed
Merge branch 'master' into pep8radius
2 parents 707e9ed + a33386a commit d6f9ba6

File tree

4 files changed

+78
-43
lines changed

4 files changed

+78
-43
lines changed

.scrutinizer.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ checks:
44
duplicate_code: true
55
tools:
66
external_code_coverage: true
7+
pylint:
8+
python_version: 3
9+
config_file: '.pylintrc'

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
language: python
22
python:
3+
- 2.7
34
- 3.3
45
- 3.4
56
env:

Makefile

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Python settings
2-
PYTHON_MAJOR := 3
3-
PYTHON_MINOR := 4
2+
ifndef TRAVIS
3+
PYTHON_MAJOR := 3
4+
PYTHON_MINOR := 4
5+
endif
46

57
# Test runner settings
68
ifndef TEST_RUNNER
@@ -56,6 +58,10 @@ NOSE := $(BIN)/nosetests
5658
PYTEST := $(BIN)/py.test
5759
COVERAGE := $(BIN)/coverage
5860

61+
# Remove if you don't want pip to cache downloads
62+
PIP_CACHE_DIR := .cache
63+
PIP_CACHE := --download-cache $(PIP_CACHE_DIR)
64+
5965
# Flags for PHONY targets
6066
DEPENDS_CI := $(ENV)/.depends-ci
6167
DEPENDS_DEV := $(ENV)/.depends-dev
@@ -91,13 +97,13 @@ depends: .depends-ci .depends-dev
9197
.PHONY: .depends-ci
9298
.depends-ci: env Makefile $(DEPENDS_CI)
9399
$(DEPENDS_CI): Makefile
94-
$(PIP) install --upgrade pep8 pep257 $(TEST_RUNNER) coverage
100+
$(PIP) install $(PIP_CACHE) --upgrade pep8 pep257 $(TEST_RUNNER) coverage
95101
touch $(DEPENDS_CI) # flag to indicate dependencies are installed
96102

97103
.PHONY: .depends-dev
98104
.depends-dev: env Makefile $(DEPENDS_DEV)
99105
$(DEPENDS_DEV): Makefile
100-
$(PIP) install --upgrade pep8radius docutils pdoc pylint wheel
106+
$(PIP) install $(PIP_CACHE) --upgrade pep8radius pygments docutils pdoc pylint wheel
101107
touch $(DEPENDS_DEV) # flag to indicate dependencies are installed
102108

103109
# Documentation ##############################################################
@@ -190,13 +196,13 @@ tests-pytest: .depends-ci
190196
clean: .clean-dist .clean-test .clean-doc .clean-build
191197
rm -rf $(ALL)
192198

193-
.PHONY: clean-all
194-
clean-all: clean .clean-env
195-
196-
.PHONY: .clean-env
197-
.clean-env:
199+
.PHONY: clean-env
200+
clean-env: clean
198201
rm -rf $(ENV)
199202

203+
.PHONY: clean-all
204+
clean-all: clean clean-env .clean-workspace .clean-cache
205+
200206
.PHONY: .clean-build
201207
.clean-build:
202208
find . -name '*.pyc' -delete
@@ -215,6 +221,14 @@ clean-all: clean .clean-env
215221
.clean-dist:
216222
rm -rf dist build
217223

224+
.PHONY: .clean-cache
225+
.clean-cache:
226+
rm -rf $(PIP_CACHE_DIR)
227+
228+
.PHONY: .clean-workspace
229+
.clean-workspace:
230+
rm -rf *.sublime-workspace
231+
218232
# Release ####################################################################
219233

220234
.PHONY: .git-no-changes

README.md

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,64 @@ Foobar
77
[![PyPI Version](http://img.shields.io/pypi/v/foobar.svg)](https://pypi.python.org/pypi/foobar)
88
[![PyPI Downloads](http://img.shields.io/pypi/dm/foobar.svg)](https://pypi.python.org/pypi/foobar)
99

10-
Foobar is a template for a typical Python 3 library package.
10+
This is a template for a typical Python library following modern packaging conventions. It utilizes popular Python libraries, external tools, and web services to fully automate all development and deployment tasks.
1111

12-
To adopt for a new project:
12+
Here are few sample projects to see this template in action:
1313

14-
* replace `foobar` and `template-python` with your package name
15-
* replace `Foobar` with your project name (might be the same as the package)
16-
* set `TEST_RUNNER` in the `Makefile` to your preferred test runner (`nose` or `pytest`)
17-
* remove the `TEST_RUNNER` environment lines in `.travis.yml`
18-
* update the links to point to your code repository and badges
19-
* change the license
14+
* [jacebrowning/doorstop](https://github.com/jacebrowning/doorstop)
15+
* [MichiganLabs/flask-gcm](https://github.com/MichiganLabs/flask-gcm)
16+
* [theovoss/BoggleSolver](https://github.com/theovoss/BoggleSolver)
2017

18+
To adopt for your next project:
2119

20+
* download this repository's [source code](https://github.com/jacebrowning/template-python/archive/master.zip) to a new directory
21+
* set `PYTHON_MAJOR` and `PYTHON_MINOR` in the `Makefile` to your default Python version
22+
* set `TEST_RUNNER` in the `Makefile` to your preferred test runner (`nose` or `pytest`)
23+
* remove the `TEST_RUNNER` [environment lines](https://github.com/jacebrowning/template-python/blob/850cdcbcfec99d9d844482761ed5492274720687/.travis.yml#L6-8) in `.travis.yml`
24+
* replace all instances of `foobar` and `template-python` with your package name
25+
* replace all instances of `Foobar` with your project name (might be the same as the package)
26+
* update all links to point to your code repository and badges
27+
* change the license
28+
* replace all the above text with your project's description
2229

2330
Getting Started
2431
===============
2532

2633
Requirements
2734
------------
2835

29-
* Python 3.3+
30-
36+
* Python 2.7+ or Python 3.3+
3137

3238
Installation
3339
------------
3440

35-
Foobar can be installed with 'pip':
41+
Foobar can be installed with pip:
3642

37-
$ pip install Foobar
38-
39-
Or directly from the source code:
40-
41-
$ git clone https://github.com/jacebrowning/template-python.git
42-
$ cd template-python
43-
$ python setup.py install
43+
```shell
44+
$ pip install Foobar
45+
```
4446

47+
or directly from the source code:
4548

49+
```shell
50+
$ git clone https://github.com/jacebrowning/template-python.git
51+
$ cd template-python
52+
$ python setup.py install
53+
```
4654

4755
Basic Usage
4856
===========
4957

5058
After installation, abstract base classes can be imported from the package:
5159

52-
$ python
53-
>>> import foobar
54-
foobar.__version__
60+
```shell
61+
$ python
62+
>>> import foobar
63+
foobar.__version__
64+
```
5565

5666
Foobar doesn't do anything, it's a template.
5767

58-
59-
6068
For Contributors
6169
================
6270

@@ -71,31 +79,40 @@ Requirements
7179
* Pandoc: http://johnmacfarlane.net/pandoc/installing.html
7280
* Graphviz: http://www.graphviz.org/Download.php
7381

74-
7582
Installation
7683
------------
7784

7885
Create a virtualenv:
7986

80-
$ make env
87+
```shell
88+
$ make env
89+
```
8190

8291
Run the tests:
8392

84-
$ make test
85-
$ make tests # includes integration tests
93+
```shell
94+
$ make test
95+
$ make tests # includes integration tests
96+
```
8697

8798
Build the documentation:
8899

89-
$ make doc
100+
```shell
101+
$ make doc
102+
```
90103

91104
Run static analysis:
92105

93-
$ make pep8
94-
$ make pep257
95-
$ make pylint
96-
$ make check # includes all checks
106+
```shell
107+
$ make pep8
108+
$ make pep257
109+
$ make pylint
110+
$ make check # includes all checks
111+
```
97112

98113
Prepare a release:
99114

100-
$ make dist # dry run
101-
$ make upload
115+
```shell
116+
$ make dist # dry run
117+
$ make upload
118+
```

0 commit comments

Comments
 (0)