Skip to content

Commit

Permalink
Merge branch 'feature/setuppy' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sdementen committed Mar 9, 2018
2 parents 2a78d5d + 7cf4e58 commit 6b489e2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 82 deletions.
17 changes: 3 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,10 @@ services:
env:
- DONOTGOONWEB=True
install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
-O miniconda.sh; else wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-O miniconda.sh; fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- deps='pip sqlalchemy pandas sphinx'
- conda create -q --yes -n test-environment python=$TRAVIS_PYTHON_VERSION $deps
- source activate test-environment
- conda list
- pip install -r requirements-dev.txt
- pip install coveralls
- pip install pipenv
- pipenv install -e .[test]

script:
- python setup.py test
- coverage run --source=piecash setup.py test
Expand Down
10 changes: 7 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,28 @@ install:
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "pip install --disable-pip-version-check --user --upgrade pip"
- "pip install pipenv==11.0.2 "

# Install the build dependencies of the project. If some dependencies contain
# compiled extensions and are not provided as pre-built wheel packages,
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
- "%CMD_IN_ENV% pip install -r requirements-dev.txt"
- "pipenv install .[test]"
- "pipenv graph"



build_script:
# Build the compiled extension
- "%CMD_IN_ENV% python setup.py build"
- "pipenv graph"
- "pipenv run python setup.py build"

test_script:
# Run the project tests
- "createdb foo"
- '"C:\\Program Files\\MySql\\MySQL Server 5.7\\bin\\mysql" -e "create database foo;" --user=root'
- "%CMD_IN_ENV% python setup.py test"
- "pipenv graph"
- "pipenv run python setup.py test"

after_test:
# If tests are successful, create binary packages for the project.
Expand Down
32 changes: 0 additions & 32 deletions requirements-dev.txt

This file was deleted.

57 changes: 32 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
import subprocess
import sys

# # Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill!
from distutils.command.install_scripts import install_scripts

if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
Expand Down Expand Up @@ -199,18 +199,34 @@ def _lint():
return retcode


# define install_requires for specific Python versions
python_version_specific_requires = []

# as of Python >= 2.7 and >= 3.2, the argparse module is maintained within
# the Python standard library, otherwise we install it as a separate package
# if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 3):
# python_version_specific_requires.append('argparse')



# See here for more options:
# <http://pythonhosted.org/setuptools/setuptools.html>
## package dependencies
install_requires = [
'SQLAlchemy>=1.0',
'SQLAlchemy-Utils>=0.31',
'pytz',
'tzlocal',
'click',
'enum34;python_version<"3.4"',
]
extras_require = {
'postgres': ["psycopg2"],
'mysql': ["PyMySQL"],
'pandas': ['pandas==0.21.0;python_version=="3.4"', # no wheels for py34 beyond 0.21.0
'pandas;python_version!="3.4"',
],
'finance-quote': ["requests"],
'test': ['pytest', 'pytest-cov', 'tox',
],
'doc': ['sphinx',
'sphinxcontrib-napoleon', 'sphinxcontrib-programoutput',
'sphinx-rtd-theme',
'ipython']
}
# build an 'all' option covering all options
extras_require['all'] = deps_all = sum((extras_require[k] for k in ['postgres', 'mysql', 'pandas', 'finance-quote']), [])
# add 'all' for both doc and test
extras_require['test'].extend(deps_all)
extras_require['doc'].extend(deps_all)

setup_dict = dict(
name=metadata.package,
Expand Down Expand Up @@ -245,19 +261,10 @@ def _lint():
'Topic :: Software Development :: Libraries :: Python Modules',
],
packages=find_packages(exclude=(TESTS_DIRECTORY, DATA_DIRECTORY)),
install_requires=[
'SQLAlchemy>=1.0',
'SQLAlchemy-Utils>=0.31',
'pytz',
'enum-compat',
'tzlocal',
'click',
] + python_version_specific_requires,
install_requires=install_requires,
extras_require=extras_require,
# Allow tests to be run with `python setup.py test'.
tests_require=[
'pytest',
'py',
],
tests_require=['pytest'], # + deps_all,
entry_points={
'console_scripts': [
'piecash = piecash.scripts.export:cli',
Expand Down
12 changes: 4 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# this directory.

[tox]
;envlist = py26,py27,py33,pypy,docs
envlist = py36, py27, py35, py34

[testenv]
Expand All @@ -20,13 +19,10 @@ basepython=
py35: {env:LOCALAPPDATA}\Continuum\miniconda3\envs\py35\python.exe
py36: {env:LOCALAPPDATA}\Continuum\miniconda3\envs\py36\python.exe

deps =
--requirement
{toxinidir}/requirements-dev.txt
commands = #/usr/bin/find . -name '*.pyc' -delete
py.test tests
#python setup.py test
#/usr/bin/find . -name '*.pyc' -delete

commands = pip install pipenv
pip install tox-pipenv
python setup.py test

[testenv:docs]
basepython = python
Expand Down

0 comments on commit 6b489e2

Please sign in to comment.