Skip to content

Commit

Permalink
Dependency updates and minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hartym committed Apr 18, 2018
1 parent 7049c5c commit bae8a35
Show file tree
Hide file tree
Showing 20 changed files with 324 additions and 182 deletions.
26 changes: 26 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[run]
branch = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AbstractError
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

ignore_errors = True

[html]
directory = docs/_build/html/coverage
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
.env
.tox/
.webassets-cache
/*.iml
/.cache
/.coverage
/.idea
/.medikit
/.python*-*
/build
/coverage.xml
Expand Down
4 changes: 4 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[style]
based_on_style = pep8
column_limit = 120
dedent_closing_brackets = true
141 changes: 103 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1,117 @@
# This file has been auto-generated.
# All changes will be lost, see Projectfile.
#
# Updated at 2016-11-08 14:35:29.418304
# Generated by Medikit 0.5.20 on 2018-04-18.
# All changes will be overriden.
# Edit Projectfile and run “make update” (or “medikit update”) to regenerate.

PYTHON ?= $(shell which python)
PACKAGE ?= windflow
PYTHON ?= $(shell which python || echo python)
PYTHON_BASENAME ?= $(shell basename $(PYTHON))
PYTHON_REQUIREMENTS_FILE ?= requirements-uvloop.txt
PYTHON_DIRNAME ?= $(shell dirname $(PYTHON))
PYTHON_REQUIREMENTS_FILE ?= requirements.txt
PYTHON_REQUIREMENTS_ALEMBIC_FILE ?= requirements-alembic.txt
PYTHON_REQUIREMENTS_DEV_FILE ?= requirements-dev.txt
PYTHON_REQUIREMENTS_UVLOOP_FILE ?= requirements-uvloop.txt
QUICK ?=
VIRTUAL_ENV ?= .virtualenv-$(PYTHON_BASENAME)
PIP ?= $(VIRTUAL_ENV)/bin/pip
PYTEST ?= $(VIRTUAL_ENV)/bin/pytest
PYTEST_OPTIONS ?= --capture=no --cov=windflow --cov-report html
SPHINX_OPTS ?=
SPHINX_BUILD ?= $(VIRTUAL_ENV)/bin/sphinx-build
SPHINX_SOURCEDIR ?= doc
PIP ?= $(PYTHON) -m pip
PIP_INSTALL_OPTIONS ?=
VERSION ?= $(shell git describe 2>/dev/null || git rev-parse --short HEAD)
PYTEST ?= $(PYTHON_DIRNAME)/pytest
PYTEST_OPTIONS ?= --capture=no --cov=$(PACKAGE) --cov-report html
SPHINX_BUILD ?= $(PYTHON_DIRNAME)/sphinx-build
SPHINX_OPTIONS ?=
SPHINX_SOURCEDIR ?= docs
SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build
YAPF ?= $(PYTHON) -m yapf
YAPF_OPTIONS ?= -rip
MEDIKIT ?= $(PYTHON) -m medikit
MEDIKIT_UPDATE_OPTIONS ?=
MEDIKIT_VERSION ?= 0.5.20

.PHONY: clean doc install install-dev lint test
.PHONY: $(SPHINX_SOURCEDIR) clean format help install install-alembic install-dev install-uvloop medikit quick test update update-requirements

# Installs the local project dependencies.
install: $(VIRTUAL_ENV)
if [ -z "$(QUICK)" ]; then \
$(PIP) install -Ur $(PYTHON_REQUIREMENTS_FILE) ; \
fi
install: .medikit/install ## Installs the project.
.medikit/install: $(PYTHON_REQUIREMENTS_FILE) setup.py
$(eval target := $(shell echo $@ | rev | cut -d/ -f1 | rev))
ifeq ($(filter quick,$(MAKECMDGOALS)),quick)
@printf "Skipping \033[36m%s\033[0m because of \033[36mquick\033[0m target.\n" $(target)
else ifneq ($(QUICK),)
@printf "Skipping \033[36m%s\033[0m because \033[36m$$QUICK\033[0m is not empty.\n" $(target)
else
@printf "Applying \033[36m%s\033[0m target...\n" $(target)
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip <10" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U -r $(PYTHON_REQUIREMENTS_FILE)
@mkdir -p .medikit; touch $@
endif

# Installs the local project dependencies, including development-only libraries.
install-dev: $(VIRTUAL_ENV)
if [ -z "$(QUICK)" ]; then \
$(PIP) install -Ur $(PYTHON_REQUIREMENTS_DEV_FILE) ; \
fi
clean: ## Cleans up the working copy.
rm -rf build dist *.egg-info .medikit/install .medikit/install-dev .medikit/install-alembic .medikit/install-uvloop
find . -name __pycache__ -type d | xargs rm -rf

# Cleans up the local mess.
clean:
rm -rf build
rm -rf dist
install-dev: .medikit/install-dev ## Installs the project (with dev dependencies).
.medikit/install-dev: $(PYTHON_REQUIREMENTS_DEV_FILE) $(PYTHON_REQUIREMENTS_FILE) setup.py
$(eval target := $(shell echo $@ | rev | cut -d/ -f1 | rev))
ifeq ($(filter quick,$(MAKECMDGOALS)),quick)
@printf "Skipping \033[36m%s\033[0m because of \033[36mquick\033[0m target.\n" $(target)
else ifneq ($(QUICK),)
@printf "Skipping \033[36m%s\033[0m because \033[36m$$QUICK\033[0m is not empty.\n" $(target)
else
@printf "Applying \033[36m%s\033[0m target...\n" $(target)
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip <10" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U -r $(PYTHON_REQUIREMENTS_DEV_FILE)
@mkdir -p .medikit; touch $@
endif

# Setup the local virtualenv, or use the one provided by the current environment.
$(VIRTUAL_ENV):
virtualenv -p $(PYTHON) $(VIRTUAL_ENV)
$(PIP) install -U pip\>=9,\<10 wheel\>=0.29,\<1.0
ln -fs $(VIRTUAL_ENV)/bin/activate activate-$(PYTHON_BASENAME)
quick: #
@printf ""

lint: install-dev
$(VIRTUAL_ENV)/bin/pylint --py3k windflow -f html > pylint.html
install-alembic: .medikit/install-alembic ## Installs the project (with alembic dependencies).
.medikit/install-alembic: $(PYTHON_REQUIREMENTS_ALEMBIC_FILE) $(PYTHON_REQUIREMENTS_FILE) setup.py
$(eval target := $(shell echo $@ | rev | cut -d/ -f1 | rev))
ifeq ($(filter quick,$(MAKECMDGOALS)),quick)
@printf "Skipping \033[36m%s\033[0m because of \033[36mquick\033[0m target.\n" $(target)
else ifneq ($(QUICK),)
@printf "Skipping \033[36m%s\033[0m because \033[36m$$QUICK\033[0m is not empty.\n" $(target)
else
@printf "Applying \033[36m%s\033[0m target...\n" $(target)
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip <10" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U -r $(PYTHON_REQUIREMENTS_ALEMBIC_FILE)
@mkdir -p .medikit; touch $@
endif

test: install-dev
install-uvloop: .medikit/install-uvloop ## Installs the project (with uvloop dependencies).
.medikit/install-uvloop: $(PYTHON_REQUIREMENTS_FILE) $(PYTHON_REQUIREMENTS_UVLOOP_FILE) setup.py
$(eval target := $(shell echo $@ | rev | cut -d/ -f1 | rev))
ifeq ($(filter quick,$(MAKECMDGOALS)),quick)
@printf "Skipping \033[36m%s\033[0m because of \033[36mquick\033[0m target.\n" $(target)
else ifneq ($(QUICK),)
@printf "Skipping \033[36m%s\033[0m because \033[36m$$QUICK\033[0m is not empty.\n" $(target)
else
@printf "Applying \033[36m%s\033[0m target...\n" $(target)
$(PIP) install $(PIP_INSTALL_OPTIONS) -U "pip <10" wheel
$(PIP) install $(PIP_INSTALL_OPTIONS) -U -r $(PYTHON_REQUIREMENTS_UVLOOP_FILE)
@mkdir -p .medikit; touch $@
endif

test: install-dev ## Runs the test suite.
$(PYTEST) $(PYTEST_OPTIONS) tests

doc: install-dev
$(SPHINX_BUILD) -b html -D latex_paper_size=a4 $(SPHINX_OPTS) $(SPHINX_SOURCEDIR) $(SPHINX_BUILDDIR)/html
$(SPHINX_SOURCEDIR): install-dev ##
$(SPHINX_BUILD) -b html -D latex_paper_size=a4 $(SPHINX_OPTIONS) $(SPHINX_SOURCEDIR) $(SPHINX_BUILDDIR)/html

format: install-dev ## Reformats the whole python codebase using yapf.
$(YAPF) $(YAPF_OPTIONS) .
$(YAPF) $(YAPF_OPTIONS) Projectfile

medikit: # Checks installed medikit version and updates it if it is outdated.
@$(PYTHON) -c 'import medikit, pip, sys; from packaging.version import Version; sys.exit(0 if (Version(medikit.__version__) >= Version("$(MEDIKIT_VERSION)")) and (Version(pip.__version__) < Version("10")) else 1)' || $(PYTHON) -m pip install -U "pip <10" "medikit>=$(MEDIKIT_VERSION)"

update: medikit ## Update project artifacts using medikit.
$(MEDIKIT) update $(MEDIKIT_UPDATE_OPTIONS)

update-requirements: ## Update project artifacts using medikit, including requirements files.
MEDIKIT_UPDATE_OPTIONS="--override-requirements" $(MAKE) update

help: ## Shows available commands.
@echo "Available commands:"
@echo
@grep -E '^[a-zA-Z_-]+:.*?##[\s]?.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##"}; {printf " make \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo
88 changes: 35 additions & 53 deletions Projectfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,38 @@
# windflow (see github.com/python-edgy/project)

name = 'windflow'
description = 'Windflow is a rapid web application development toolkit using tornado, asyncio and sqlalchemy.'
license = 'Apache 2.0'

url = 'https://github.com/hartym/windflow'
download_url = 'https://github.com/hartym/windflow/archive/{version}.tar.gz'

author = 'Romain Dorgueil'
author_email = 'romain@dorgueil.net'

enable_features = {
'git',
'make',
'pylint',
'pytest',
'python',
'sphinx',
}

install_requires = [
'Jinja2 >=2.8,<2.9',
'SQLAlchemy >=1.1,<1.2',
'Werkzeug >=0.11,<0.12',
'honcho >=0.7,<0.8',
'psycopg2 >=2.6,<2.7',
'python-dotenv >=0.6,<0.7',
'simplejson >=3.8,<3.11',
'tornado >=4,<5',
]

extras_require = {
'dev': [
'coverage >=4.2,<4.3',
'honcho >=0.7,<0.8',
'mock >=2.0,<2.1',
'nose >=1.3,<1.4',
'pylint >=1.6,<1.7',
'pytest >=3.0,<3.1',
'pytest-cov >=2.4,<2.5',
'sphinx >=1.4,<1.5',
'sphinx_rtd_theme',
# windflow's medikit projectfile

from medikit import listen, require

PACKAGE = 'windflow'

make = require('make')
pytest = require('pytest')
python = require('python')
sphinx = require('sphinx')
yapf = require('yapf')

python.setup(
name='windflow',
description='Windflow helps to write web apps (asyncio, tornado, sqlalchemy). Experimental, use at own risks.',
license='Apache 2.0',
url='https://github.com/hartym/windflow',
download_url='https://github.com/hartym/windflow/archive/{version}.tar.gz',
author='Romain Dorgueil',
author_email='romain@dorgueil.net',
)
python.add_requirements(
'Jinja2 ~=2.9',
'SQLAlchemy >=1.2,<1.3',
'Werkzeug ~=0.14.1',
'honcho ~=1.0.1',
'python-dotenv ~=0.8.2',
'simplejson ~=3.13.2',
'tornado ~=5.0',
uvloop=[
'uvloop ~=0.9.1',
],
'uvloop': [
'uvloop >=0.6,<0.7',
alembic=[
'alembic ~=0.9.9',
],
'alembic': [
'alembic >=0.8,<0.9',
],
}

)

@listen('edgy.project.feature.make.on_generate')
def on_make_generate(e):
e.makefile['PYTHON_REQUIREMENTS_FILE'] = 'requirements-uvloop.txt'
# vim: ft=python:
43 changes: 18 additions & 25 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -222,29 +221,28 @@
# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'windflow.tex', 'windflow Documentation',
'Romain Dorgueil', 'manual'),
(master_doc, 'windflow.tex', 'windflow Documentation', 'Romain Dorgueil', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -279,30 +277,26 @@
#
# latex_domain_indices = True


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'windflow', 'windflow Documentation',
[author], 1)
]
man_pages = [(master_doc, 'windflow', 'windflow Documentation', [author], 1)]

# If true, show URL addresses after external links.
#
# man_show_urls = False


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'windflow', 'windflow Documentation',
author, 'windflow', 'One line description of project.',
'Miscellaneous'),
(
master_doc, 'windflow', 'windflow Documentation', author, 'windflow', 'One line description of project.',
'Miscellaneous'
),
]

# Documents to append as an appendix to all manuals.
Expand All @@ -321,6 +315,5 @@
#
# texinfo_no_detailmenu = False


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
8 changes: 8 additions & 0 deletions requirements-alembic.txt
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
-e .[alembic]
-r requirements.txt
alembic==0.9.9
mako==1.0.7
markupsafe==1.0
python-dateutil==2.7.2
python-editor==1.0.3
six==1.11.0
sqlalchemy==1.2.6

0 comments on commit bae8a35

Please sign in to comment.