-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Overseas-Student-Living/travis-ci
Add Travis CI integration
- Loading branch information
Showing
8 changed files
with
111 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sudo: false | ||
language: python | ||
|
||
python: | ||
- '2.7' | ||
|
||
install: | ||
- pip install tox | ||
|
||
env: | ||
- TOX_ENV=py34 | ||
|
||
script: | ||
- tox -e $TOX_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,12 @@ | ||
DB_USER ?= root | ||
DB_PASS ?= | ||
DB_SERVER ?= localhost | ||
DB_PORT ?= 3306 | ||
DB_NAME ?= test_sqlalchemy_filters | ||
SQLITE_DB_FILE ?= /$(DB_NAME).db | ||
DB_DIALECT ?= sqlite | ||
DB_DRIVER ?= pysqlite | ||
|
||
ifeq ($(DB_DIALECT), sqlite) | ||
DB_URI = $(SQLITE_DB_FILE) | ||
else | ||
DB_URI = $(DB_USER):$(DB_PASS)@$(DB_SERVER):$(DB_PORT)/$(DB_NAME) | ||
endif | ||
|
||
.PHONY: test | ||
|
||
test: | ||
@py.test test -x -vv \ | ||
--test_db_uri $(DB_URI) \ | ||
--test_db_dialect $(DB_DIALECT) \ | ||
--test_db_driver $(DB_DRIVER) | ||
|
||
coverage: | ||
flake8: | ||
flake8 sqlalchemy_filters test | ||
coverage run --source sqlalchemy_filters -m pytest test -x -vv \ | ||
--test_db_uri $(DB_URI) \ | ||
--test_db_dialect $(DB_DIALECT) \ | ||
--test_db_driver $(DB_DRIVER) | ||
|
||
test: flake8 | ||
@py.test test $(ARGS) | ||
|
||
coverage: flake8 | ||
coverage run --source sqlalchemy_filters -m pytest test $(ARGS) | ||
coverage report -m --fail-under 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
from codecs import open | ||
from setuptools import setup, find_packages | ||
|
||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
with open(os.path.join(here, 'README.rst'), 'r', 'utf-8') as handle: | ||
readme = handle.read() | ||
|
||
setup( | ||
name='sqlalchemy-filters', | ||
version='0.1.0', | ||
description='A library to filter SQLAlchemy queries.', | ||
long_description=readme, | ||
author='Student.com', | ||
author_email='[email protected]', | ||
url='https://github.com/Overseas-Student-Living/sqlalchemy-filters', | ||
packages=find_packages(exclude=['test', 'test.*']), | ||
install_requires=[ | ||
'sqlalchemy>=1.0.14', | ||
'sqlalchemy>=1.0.16', | ||
], | ||
extras_require={ | ||
'dev': [ | ||
'pytest==2.9.2', | ||
'flake8==3.0.1', | ||
'coverage==4.2.0', | ||
'mysql-connector-python==2.0.4', | ||
'sqlalchemy-utils==0.32.9', | ||
'pytest==3.0.5', | ||
'flake8==3.2.1', | ||
'coverage==4.3.1', | ||
'sqlalchemy-utils==0.32.12', | ||
], | ||
'mysql': [ | ||
'mysql-connector-python==2.1.5', | ||
] | ||
}, | ||
dependency_links=[ | ||
'https://cdn.mysql.com/Downloads/Connector-Python' | ||
'/mysql-connector-python-2.1.5.zip' | ||
], | ||
zip_safe=True, | ||
license='Apache License, Version 2.0', | ||
classifiers=[ | ||
"Programming Language :: Python", | ||
"Operating System :: Linux", | ||
"Operating System :: POSIX", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
def apply_sort(query, sort): | ||
def apply_sort(query, sort): # pragma: no cover | ||
# TODO | ||
raise NotImplemented() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[tox] | ||
envlist = py34 | ||
skipdist=True | ||
|
||
[testenv] | ||
whitelist_externals = make | ||
|
||
commands = | ||
pip install -U --editable ".[dev, mysql]" --process-dependency-links | ||
make coverage ARGS='-x -vv' |