8000 Merge pull request #99 from flask-api/release/v1.1 · flask-api/flask-api@ae70313 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae70313

Browse files
authored
Merge pull request #99 from flask-api/release/v1.1
Release v1.1
2 parents 08bf083 + 02bd0fe commit ae70313

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+761
-288
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Icon*
3030
*.gdraw
3131

3232
# Testing and coverage results
33-
/.pytest/
3433
/.coverage
3534
/.coverage.*
3635
/htmlcov/

.scrutinizer.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override:
6+
- pylint-run --rcfile=.pylint.ini
7+
- py-scrutinizer-run
18
checks:
29
python:
310
code_rating: true
411
duplicate_code: true
512
filter:
613
excluded_paths:
714
- "*/tests/*"
8-
- "*.min.js"
15+
- "*/static/js/*min.js"

.travis.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
language: python
2-
32
python:
43
- 2.7
5-
- 3.3
64
- 3.4
75
- 3.5
86
- 3.6
97

8+
cache:
9+
pip: true
10+
directories:
11+
- .venv
12+
1013
env:
1114
global:
12-
- RANDOM_SEED=0
13-
- PIPENV_NOSPIN=true
15+
- RANDOM_SEED=0
1416
matrix:
15-
- FLASK_VERSION=0.10.2
16-
- FLASK_VERSION=0.11.2
17-
- FLASK_VERSION=0.12.2
17+
- FLASK_VERSION=0.12.4
18+
- FLASK_VERSION=1.0.2
1819

1920
before_install:
20-
- pip install pipenv~=5.0
21+
- pip install pipenv
2122

2223
install:
2324
- make install
2425

26+
before_script:
27+
- pipenv run pip install flask==${FLASK_VERSION}
28+
2529
script:
2630
- make check
2731
- make test

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $ make watch
4141
Build the documentation:
4242

4343
```sh
44-
$ make doc
44+
$ make docs
4545
```
4646

4747
### Static Analysis

Makefile

Lines changed: 39 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,12 @@ PACKAGES := $(PACKAGE) tests
88
CONFIG := $(wildcard *.py)
99
MODULES := $(wildcard $(PACKAGE)/*.py)
1010

11-
# Python settings
12-
PYTHON_MAJOR ?= 2
13-
PYTHON_MINOR ?= 7
14-
15-
# System paths
16-
PLATFORM := $(shell python -c 'import sys; print(sys.platform)')
17-
ifneq ($(findstring win32, $(PLATFORM)), )
18-
WINDOWS := true
19-
SYS_PYTHON_DIR := C:\\Python$(PYTHON_MAJOR)$(PYTHON_MINOR)
20-
SYS_PYTHON := $(SYS_PYTHON_DIR)\\python.exe
21-
# https://bugs.launchpad.net/virtualenv/+bug/449537
22-
export TCL_LIBRARY=$(SYS_PYTHON_DIR)\\tcl\\tcl8.5
23-
else
24-
ifneq ($(findstring darwin, $(PLATFORM)), )
25-
MAC := true
26-
else
27-
LINUX := true
28-
endif
29-
SYS_PYTHON := python$(PYTHON_MAJOR)
30-
ifdef PYTHON_MINOR
31-
SYS_PYTHON := $(SYS_PYTHON).$(PYTHON_MINOR)
32-
endif
33-
endif
34-
3511
# Virtual environment paths
36-
ENV := .venv
37-
ifneq ($(findstring win32, $(PLATFORM)), )
38-
BIN := $(ENV)/Scripts
39-
ACTIVATE := $(BIN)/activate.bat
40-
OPEN := cmd /c start
41-
PYTHON := $(BIN)/python.exe
42-
PIP := $(BIN)/pip.exe
43-
else
44-
BIN := $(ENV)/bin
45-
ACTIVATE := . $(BIN)/activate
46-
ifneq ($(findstring cygwin, $(PLATFORM)), )
47-
OPEN := cygstart
48-
else
49-
OPEN := open
50-
endif
51-
PYTHON := $(BIN)/python
52-
PIP := $(BIN)/pip
53-
endif
12+
export PIPENV_VENV_IN_PROJECT=true
13+
export PIPENV_IGNORE_VIRTUALENVS=true
14+
VENV := .venv
5415

55-
# MAIN TASKS ###################################################################
16+
# MAIN TASKS ##################################################################
5617

5718
SNIFFER := pipenv run sniffer
5819

@@ -68,40 +29,21 @@ watch: install .clean-test ## Continuously run all CI tasks when files chanage
6829

6930
.PHONY: run ## Start the program
7031
run: install
71-
$(PYTHON) $(PACKAGE)/__main__.py
32+
pipenv run python $(PACKAGE)/__main__.py
7233

73-
# PROJECT DEPENDENCIES #########################################################
34+
# PROJECT DEPENDENCIES ########################################################
7435

75-
export PIPENV_SHELL_COMPAT=true
76-
export PIPENV_VENV_IN_PROJECT=true
77-
export PIPENV_IGNORE_VIRTUALENVS=true
78-
79-
DEPENDENCIES := $(ENV)/.installed
80-
METADATA := *.egg-info
36+
DEPENDENCIES := $(VENV)/.installed
8137

8238
.PHONY: install
83-
install: $(DEPENDENCIES) $(METADATA)
39+
install: $(DEPENDENCIES)
8440

85-
$(DEPENDENCIES): $(PIP) Pipfile*
41+
$(DEPENDENCIES): Pipfile* setup.py
42+
pipenv run python setup.py develop
8643
pipenv install --dev
87-
ifdef WINDOWS
88-
@ echo "Manually install pywin32: https://sourceforge.net/projects/pywin32/files/pywin32"
89-
else ifdef MAC
90-
$(PIP) install pync MacFSEvents
91-
else ifdef LINUX
92-
$(PIP) install pyinotify
93-
endif
94-
@ touch $@
95-
96-
$(METADATA): $(PYTHON) setup.py
97-
$(PYTHON) setup.py develop
9844
@ touch $@
9945

100-
$(PYTHON) $(PIP):
101-
pipenv --python=$(SYS_PYTHON)
102-
pipenv run pip --version
103-
104-
# CHECKS #######################################################################
46+
# CHECKS ######################################################################
10547

10648
FLAKE8 := pipenv run flake8
10749

@@ -112,11 +54,11 @@ check: flake8 ## Run linters and static analysis
11254
flake8: install
11355
$(FLAKE8) flask_api --ignore=E128,E501 --exclude=__init__.py
11456

115-
# TESTS ########################################################################
57+
# TESTS #######################################################################
11658

11759
NOSE := pipenv run nosetests
11860
COVERAGE := pipenv run coverage
119-
COVERAGE_SPACE := pipenv run coverage.space
61+
COVERAGESPACE := pipenv run coveragespace
12062

12163
RANDOM_SEED ?= $(shell date +%s)
12264

@@ -128,20 +70,20 @@ endif
12870
.PHONY: test
12971
test: install ## Run unit and integration tests
13072
$(NOSE) $(PACKAGE) $(NOSE_OPTIONS)
131-
$(COVERAGE_SPACE) $(REPOSITORY) overall
73+
$(COVERAGESPACE) $(REPOSITORY) overall
13274

13375
.PHONY: read-coverage
13476
read-coverage:
135-
$(OPEN) coverage/index.html
77+
open htmlcov/index.html
13678

137-
# DOCUMENTATION ################################################################
79+
# DOCUMENTATION ###############################################################
13880

13981
MKDOCS := pipenv run mkdocs
14082

14183
MKDOCS_INDEX := site/index.html
14284

143-
.PHONY: doc
144-
doc: mkdocs ## Generate documentation
85+
.PHONY: docs
86+
docs: mkdocs ## Generate documentation
14587

14688
.PHONY: mkdocs
14789
mkdocs: install $(MKDOCS_INDEX)
@@ -153,83 +95,59 @@ mkdocs-live: mkdocs
15395
eval "sleep 3; open http://127.0.0.1:8000" &
15496
$(MKDOCS) serve
15597

156-
# BUILD ########################################################################
98+
# BUILD #######################################################################
15799

158100
DIST_FILES := dist/*.tar.gz dist/*.whl
159101

160102
.PHONY: dist
161103
dist: install $(DIST_FILES)
162104
$(DIST_FILES): $(MODULES)
163105
rm -f $(DIST_FILES)
164-
$(PYTHON) setup.py check --restructuredtext --strict --metadata
165-
$(PYTHON) setup.py sdist
166-
$(PYTHON) setup.py bdist_wheel
106+
pipenv run python setup.py check --restructuredtext --strict --metadata
107+
pipenv run python setup.py sdist
108+
pipenv run python setup.py bdist_wheel
167109

168110
# RELEASE ######################################################################
169111

170112
TWINE := pipenv run twine
171113

172-
.PHONY: register
173-
register: dist ## Register the project on PyPI
174-
@ echo NOTE: your project must be registered manually
175-
@ echo https://github.com/pypa/python-packaging-user-guide/issues/263
176-
# TODO: switch to twine when the above issue is resolved
177-
# $(TWINE) register dist/*.whl
178-
179114
.PHONY: upload
180-
upload: .git-no-changes register ## Upload the current version to PyPI
115+
upload: dist ## Upload the current version to PyPI
116+
git diff --name-only --exit-code
181117
$(TWINE) upload dist/*.*
182-
$(OPEN) https://pypi.python.org/pypi/$(PROJECT)
183-
184-
.PHONY: .git-no-changes
185-
.git-no-changes:
186-
@ if git diff --name-only --exit-code; \
187-
then \
188-
echo Git working copy is clean...; \
189-
else \
190-
echo ERROR: Git working copy is dirty!; \
191-
echo Commit your changes and try again.; \
192-
exit -1; \
193-
fi;
118+
open https://pypi.org/project/$(PROJECT)
194119

195-
# CLEANUP ######################################################################
120+
# CLEANUP #####################################################################
196121

197122
.PHONY: clean
198-
clean: .clean-dist .clean-test .clean-doc .clean-build ## Delete all generated and temporary files
123+
clean: .clean-build .clean-docs .clean-test .clean-install ## Delete all generated and temporary files
199124

200125
.PHONY: clean-all
201-
clean-all: clean .clean-env .clean-workspace
126+
clean-all: clean
127+
rm -rf $(VENV)
202128

203-
.PHONY: .clean-build
204-
.clean-build:
129+
.PHONY: .clean-install
130+
.clean-install:
205131
find $(PACKAGES) -name '*.pyc' -delete
206132
find $(PACKAGES) -name '__pycache__' -delete
207133
rm -rf *.egg-info
208134

209-
.PHONY: .clean-doc
210-
.clean-doc:
211-
rm -rf README.rst docs/apidocs *.html docs/*.png site
212-
213135
.PHONY: .clean-test
214136
.clean-test:
215137
rm -rf .cache .pytest .coverage htmlcov xmlreport
216138

217-
.PHONY: .clean-dist
218-
.clean-dist:
219-
rm -rf *.spec dist build
220-
221-
.PHONY: .clean-env
222-
.clean-env: clean
223-
rm -rf $(ENV)
139+
.PHONY: .clean-docs
140+
.clean-docs:
141+
rm -rf *.rst docs/apidocs *.html docs/*.png site
224142

225-
.PHONY: .clean-workspace
226-
.clean-workspace:
227-
rm -rf *.sublime-workspace
143+
.PHONY: .clean-build
144+
.clean-build:
145+
rm -rf *.spec dist build
228146

229-
# HELP #########################################################################
147+
# HELP ########################################################################
230148

231149
.PHONY: help
232150
help: all
233-
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
151+
@ grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
234152

235153
.DEFAULT_GOAL := help

Pipfile

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
[[source]]
2-
url = "https://pypi.python.org/simple"
2+
3+
url = "https://pypi.org/simple"
34
verify_ssl = true
5+
name = "pypi"
46

57
[packages]
6-
Flask = "~=0.10.1"
7-
Markdown = "*"
8+
9+
Flask = "*"
10+
Markdown = "<3"
811

912
[dev-packages]
10-
nose = "*"
11-
coverage = "~=3.7.1"
12-
"coverage.space" = "*"
13+
14+
# Linters
1315
flake8 = "~=2.1"
14-
mkdocs = "==0.12"
16+
17+
# Testing
18+
nose = "*"
19+
20+
# Reports
21+
coveragespace = "*"
22+
23+
# Documentation
24+
mkdocs = "~=0.17.2"
1525
docutils = "*"
16-
sniffer = "*"
26+
27+
# Release
1728
twine = "*"
29+
30+
# Tooling
31+
sniffer = "*"
32+
pync = { version = "<2.0", sys_platform = "== 'darwin'" }
33+
MacFSEvents = { version = "*", sys_platform = "== 'darwin'" }

0 commit comments

Comments
 (0)
0