Skip to content

Commit 6c4a4f5

Browse files
authored
Merge pull request #86 from ocefpaf/reactivate_travis
Reactivate Travis-CI
2 parents a9f0cee + 52145df commit 6c4a4f5

6 files changed

Lines changed: 74 additions & 172 deletions

File tree

.travis.yml

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,71 @@
1-
git blanguage: python
2-
sudo: required
3-
# if the https://travis-ci.org/ODM2/ODM2PythonAPI/requests ever says: missing config
4-
# validate at: http://lint.travis-ci.org/
5-
python:
6-
# - "2.6"
7-
- "2.7"
8-
# - "3.2"
9-
# - "3.3"
10-
# - "3.4"
11-
# - "3.5"
12-
# - "3.5-dev" # 3.5 development branch
13-
# - "nightly" # currently points to 3.6-dev
14-
# command to install dependencies
15-
cache:
16-
directories:
17-
- $HOME/.cache/pip/wheels
18-
- $HOME/virtualenv/python2.7.9
1+
language: python
2+
3+
sudo: false
4+
195
services:
206
- mysql
217
- postgresql
8+
229
addons:
2310
apt:
2411
packages:
25-
- cmake
26-
- unixodbc
27-
- unixodbc-dev
12+
# FIXME: when activating the services above I don't think these are needed.
2813
- odbcinst1debian2
2914
- odbcinst
30-
- freetds-dev
31-
- freetds-bin
3215
- tdsodbc
33-
- libc6
3416
- e2fsprogs
17+
# FIXME: the dependencies below can probably be replaced by conda.
18+
- libc6
19+
- freetds-dev
20+
- freetds-bin
21+
- unixodbc
22+
- unixodbc-dev
3523
- mysql-client
24+
# FIXME: I don't see the need for these anywhere.
25+
- cmake
3626
- libproj-dev
3727
- libgeos-dev
3828
- libspatialite-dev
39-
# mariadb: '10.1'
29+
30+
matrix:
31+
fast_finish: true
32+
include:
33+
- python: 2.7
34+
env: TEST_TARGET=default
35+
- python: 3.6
36+
env: TEST_TARGET=default
37+
- python: 2.7
38+
env: TEST_TARGET=coding_standards
39+
allow_failures:
40+
- python: 2.7
41+
env: TEST_TARGET=coding_standards
42+
- python: 3.6
43+
env: TEST_TARGET=default
44+
4045
before_script:
4146
- ./ci-helpers/mysql_setup.sh
4247
- ./ci-helpers/postgres_setup.sh
4348
- ./ci-helpers/travis/freetds.sh
4449

45-
4650
before_install:
47-
# python -m pip makes the install go into the virtualenv
48-
- sudo pip install --upgrade pip
49-
- sudo python -m pip install pandas
50-
- export PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1;sudo python -m pip install pymssql
51-
# - python -m pip install mysql-python
52-
install: # now just our code
53-
- sudo pip install -e git+https://github.com/ODM2/geoalchemy.git@v0.7.4#egg=geoalchemy-0.7.4
54-
- python -m pip install .
55-
- python -m pip install -r requirements_tests.txt --allow-external pyodbc --allow-unverified pyodbc
56-
# pysqlite
57-
# - pip install pysqlite
58-
- pip list
51+
- wget http://bit.ly/miniconda -O miniconda.sh
52+
- bash miniconda.sh -b -p $HOME/miniconda
53+
- export PATH="$HOME/miniconda/bin:$PATH"
54+
- conda update --yes --all
55+
- conda config --add channels odm2 --force
56+
- conda create --yes -n TEST python=$TRAVIS_PYTHON_VERSION --file requirements.txt --file requirements-dev.txt
57+
- source activate TEST
5958

60-
# don't forget to open up the azure mssql server to these addreses
61-
# https://docs.travis-ci.com/user/ip-addresses/
59+
# Test source distribution.
60+
install:
61+
- python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install odm2api-${version}.tar.gz && popd
6262

63-
# command to run tests
6463
script:
64+
- if [[ $TEST_TARGET == 'default' ]]; then
65+
cp -r tests /tmp && cd /tmp ;
66+
py.test -vv tests ;
67+
fi
6568

66-
- py.test
67-
69+
- if [[ $TEST_TARGET == 'coding_standards' ]]; then
70+
find . -type f -name "*.py" ! -name 'conf.py' | xargs flake8 --max-line-length=100 ;
71+
fi

condaenvironment_1.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

requirements-dev.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
flake8
2+
mock
3+
psycopg2
4+
pymysql
5+
pytest
6+
pytest-cov
7+
# FIXME: I am not sure these are needed.
8+
# pysqlite
9+
# sqlite
10+
# pyspatialite
11+
# mysql-python

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
pyodbc
2-
six
32
sqlalchemy
43
pandas
5-
#psycopg2 # Commented out because I could not pip install it.

requirements_tests.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

setup.py

Lines changed: 16 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -5,133 +5,51 @@
55
https://github.com/pypa/sampleproject
66
"""
77

8-
'''
9-
to install in development mode, run the following code from command line
10-
"python setup.py develop"
11-
'''
12-
13-
# Always prefer setuptools over distutils
14-
from setuptools import setup, find_packages
15-
# To use a consistent encoding
8+
import os
169
from codecs import open
17-
from os import path
10+
11+
from setuptools import find_packages, setup
1812

1913
import versioneer
2014

21-
here = path.abspath(path.dirname(__file__))
15+
here = os.path.abspath(os.path.dirname(__file__))
16+
17+
# Dependencies.
18+
with open('requirements.txt') as f:
19+
requirements = f.readlines()
20+
install_requires = [t.strip() for t in requirements]
2221

23-
from pip.req import parse_requirements
24-
install_reqs = parse_requirements('requirements.txt', session=False)
25-
reqs = [str(ir.req) for ir in install_reqs]
22+
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
23+
long_description = f.read()
2624

27-
# Get the long description from the relevant file
28-
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
29-
long_description = f.read()
30-
#long_description = ""
3125
setup(
3226
name='odm2api',
33-
34-
# Versions should comply with PEP440. For a discussion on single-sourcing
35-
# the version across setup.py and the project code, see
36-
# https://packaging.python.org/en/latest/single_source_version.html
3727
version=versioneer.get_version(),
38-
39-
description='A Python-based application programmers interface for the Observations Data converter 2 (ODM2) ',
28+
description='Python interface for the Observations Data Model 2 (ODM2)',
4029
long_description=long_description,
41-
42-
# The project's main homepage.
4330
url='https://github.com/ODM2/ODM2PythonAPI',
44-
45-
# Author details
4631
author='ODM2 team-Stephanie Reeder',
4732
author_email='stephanie.reeder@usu.edu',
48-
49-
# note: maintainer gets listed as author in PKG-INFO, so leaving
50-
# this commented out for now
5133
maintainer='David Valentine',
5234
maintainer_email='david.valentine@gmail.com',
53-
54-
# Choose your license
55-
license='BSD-3-Clause',
56-
57-
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
35+
license='BSD',
5836
classifiers=[
59-
# How mature is this project? Common values are
60-
# 3 - Alpha
61-
# 4 - Beta
62-
# 5 - Production/Stable
6337
'Development Status :: 3 - Alpha',
64-
65-
# Indicate who your project is intended for
6638
'Intended Audience :: Developers',
6739
'Topic :: Software Development :: Build Tools',
68-
69-
# Pick your license as you wish (should match "license" above)
7040
'License :: OSI Approved :: BSD License',
7141
'Operating System :: OS Independent',
72-
# Specify the Python versions you support here. In particular, ensure
73-
# that you indicate whether you support Python 2, Python 3 or both.
7442
'Programming Language :: Python :: 2.7',
7543
'Topic :: Software Development :: Libraries :: Python Modules',
7644
'Topic :: Scientific/Engineering'
7745
],
78-
79-
# What does your project relate to?
80-
keywords='Observations Data converter ODM2',
81-
82-
# You can just specify the packages manually here if your project is
83-
# simple. Or you can use find_packages().
84-
46+
keywords='Observations Data Model ODM2',
8547
packages=find_packages(exclude=['samplefiles', 'setup', 'tests*', 'Forms']),
86-
87-
# List run-time dependencies here. These will be installed by pip when
88-
# your project is installed. For an analysis of "install_requires" vs pip's
89-
# requirements files see:
90-
# https://packaging.python.org/en/latest/requirements.html
91-
92-
install_requires=install_reqs,
93-
# install_requires=[
94-
# 'pyodbc',
95-
# 'six',
96-
# 'sqlalchemy',
97-
# 'shapely',
98-
# 'pandas',
99-
# ],
100-
101-
# List additional groups of dependencies here (e.g. development
102-
# dependencies). You can install these using the following syntax,
103-
# for example:
104-
# $ pip install -e .[dev,test]
48+
install_requires=install_requires,
10549
extras_require={
10650
'mysql': ['pymysql'],
10751
'postgis': ['psycopg2'],
108-
'sqlite': ['pyspatialite >=3.0.0'], # need to look at: http://www.gaia-gis.it/spatialite-2.4.0-4/splite-python.html
109-
'test': ['coverage'],
52+
'sqlite': ['pyspatialite >=3.0.0'],
11053
},
111-
112-
# If there are data files included in your packages that need to be
113-
# installed, specify them here. If using Python 2.6 or less, then these
114-
# have to be included in MANIFEST.in as well.
115-
#
116-
# package_data={
117-
# 'sample': ['package_data.dat'],
118-
# },
119-
120-
# Although 'package_data' is the preferred approach, in some case you may
121-
# need to place data files outside of your packages. See:
122-
# http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
123-
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
124-
125-
# data_files=[('my_data', ['data/data_file'])],
126-
127-
# To provide executable scripts, use entry points in preference to the
128-
# "scripts" keyword. Entry points provide cross-platform support and allow
129-
# pip to create the appropriate form of executable for the target platform.
130-
131-
# entry_points={
132-
# 'console_scripts': [
133-
# 'sample=sample:main',
134-
# ],
135-
# },
13654
cmdclass=versioneer.get_cmdclass(),
13755
)

0 commit comments

Comments
 (0)