Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 32 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
language: python

python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7-dev
- pypy
matrix:
include:
- python: 2.7
dist: trusty
- python: 3.3
dist: trusty
- python: 3.4
dist: trusty
- python: 3.5
dist: trusty
- python: 3.6
dist: trusty
- python: 3.7
dist: xenial
- python: nightly
dist: xenial
- python: pypy
dist: trusty
allow_failures:
- python: nightly

before_install:
- git submodule update --init --recursive
Expand All @@ -21,17 +31,23 @@ before_install:
- sudo ldconfig
- cd ..
- pip install coverage coveralls
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pip install pylint yapf; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then pip install pylint yapf; fi
- |
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then
sudo apt-get install -y nodejs;
npm install -g snyk;
fi

script:
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy' ]]; then export MM_FORCE_EXT_TESTS=1; fi
- CFLAGS="-Werror -Wall -Wextra" coverage run --source maxminddb setup.py test
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then pylint --rcfile .pylintrc maxminddb/*.py; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then ./.travis-yapf.sh; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then snyk test --org=maxmind --file=requirements.txt; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then pylint --rcfile .pylintrc maxminddb/*.py; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then ./.travis-yapf.sh; fi

after_success:
- coveralls
- if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' && $TRAVIS_PYTHON_VERSION == '2.7' ]]; then snyk monitor --org=maxmind --project=maxmind/MaxMind-DB-Reader-python; fi

notifications:
email:
Expand All @@ -42,7 +58,8 @@ notifications:

env:
global:
- secure: "pVcpV/al5Q607TbRzl/sbkdsx5hUjxehaJm6t5tgWrFn45icwdZrPw3JWcpt0R57NhPvXHxcJdm4WBtcGElWoDtR52QOW3yYh+gRw23y1MJg+5qHIbh5R1sOC/fLJ9TzQzvvRH5QQ5bKIe1hRQW9Cpqm7nX5Zhq6SqnAzcG1emE="
- secure: "pVcpV/al5Q607TbRzl/sbkdsx5hUjxehaJm6t5tgWrFn45icwdZrPw3JWcpt0R57NhPvXHxcJdm4WBtcGElWoDtR52QOW3yYh+gRw23y1MJg+5qHIbh5R1sOC/fLJ9TzQzvvRH5QQ5bKIe1hRQW9Cpqm7nX5Zhq6SqnAzcG1emE="
- secure: "idzTTvCWmC0TYgYxQFOaZju86TUzKLaMKs2ZZsGloklf0mk0d3XH/CD5VYDPgP++/7Kmw9zC401EZyRC6anZYB0qCXwRulgux2Io5HCWChIrZTSx3DoSl+VRVi0cUkfMNomrwduJ0g1vVnDXp6xM8ITE574jwpasUJ2MOvVykdU="

addons:
coverity_scan:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ invalid IP address or an IPv6 address in an IPv4 database.
Requirements
------------

This code requires Python 2.6+ or 3.3+. The C extension requires CPython. The
This code requires Python 2.7+ or 3.3+. The C extension requires CPython. The
pure Python implementation has been tested with PyPy.

On Python 2, the `ipaddress module <https://pypi.python.org/pypi/ipaddress>`_ is
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
if sys.version_info[0] == 2 or (sys.version_info[0] == 3
and sys.version_info[1] < 3):
requirements.append('ipaddress')
if os.environ.get('SNYK_TOKEN'):
with open('requirements.txt', 'w') as f:
for r in requirements:
f.write(r + '\n')

compile_args = ['-Wall', '-Wextra']

Expand All @@ -37,10 +41,6 @@
# Cargo cult code for installing extension with pure Python fallback.
# Taken from SQLAlchemy, but this same basic code exists in many modules.
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
if sys.platform == 'win32':
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
ext_errors += (IOError, )


class BuildFailed(Exception):
Expand Down Expand Up @@ -141,12 +141,13 @@ def run_setup(with_cext):
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python',
'Topic :: Internet :: Proxy Servers',
'Topic :: Internet',
Expand Down
5 changes: 1 addition & 4 deletions tests/decoder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
from maxminddb.compat import byte_from_int, int_from_byte
from maxminddb.decoder import Decoder

if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
import unittest

if sys.version_info[0] == 2:
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
Expand Down