Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
760 additions
and 483 deletions.
- +490 −0 .pylintrc
- +5 −2 .style.yapf
- +31 −14 .travis.yml
- +3 −2 appveyor.yml
- +4 −2 artifacts/artifact.py
- +24 −44 artifacts/definitions.py
- +6 −4 artifacts/registry.py
- +9 −13 artifacts/source_type.py
- +38 −12 config/travis/install.sh
- +58 −0 config/travis/runtests.sh
- +6 −2 run_tests.py
- +7 −7 setup.py
- +2 −1 tests/reader_test.py
- +1 −2 tests/registry_test.py
- +2 −2 tests/style_test.py
- +1 −1 tests/test_lib.py
- +1 −1 tests/validator_test.py
- +1 −1 tools/__init__.py
- +13 −4 tools/stats.py
- +1 −1 tools/validator.py
- +21 −2 tox.ini
- +16 −0 utils/check_dependencies.py
- +20 −15 utils/dependencies.py
- +0 −351 utils/update_dependencies.py
@@ -1,4 +1,7 @@ | ||
[style] | ||
based_on_style = chromium | ||
COALESCE_BRACKETS = True | ||
SPLIT_BEFORE_FIRST_ARGUMENT = True | ||
allow_split_before_dict_value = False | ||
coalesce_brackets = True | ||
join_multiple_lines = True | ||
split_before_first_argument = True | ||
split_penalty_after_opening_bracket = 0 |
@@ -1,29 +1,46 @@ | ||
language: python | ||
matrix: | ||
include: | ||
- os: linux | ||
- env: TARGET="pylint" | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
group: edge | ||
python: 2.7 | ||
env: TOXENV=py27 | ||
- os: linux | ||
- env: TARGET="linux-python27" | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
group: edge | ||
python: 2.7 | ||
- env: TARGET="linux-python34" | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
group: edge | ||
python: 3.4 | ||
- env: [TARGET="linux-python27-tox", TOXENV="py27"] | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
group: edge | ||
python: 2.7 | ||
- env: [TARGET="linux-python34-tox", TOXENV="py34"] | ||
os: linux | ||
dist: trusty | ||
sudo: required | ||
group: edge | ||
python: 3.4 | ||
env: TOXENV=py34 | ||
- os: osx | ||
osx_image: xcode8.3 | ||
- env: [TARGET="macos-python27", PYTHONPATH="/Library/Python/2.7/site-packages/"] | ||
os: osx | ||
osx_image: xcode9.2 | ||
language: generic | ||
env: PYTHONPATH=/Library/Python/2.7/site-packages/ | ||
allow_failures: | ||
- env: TARGET="linux-python34" | ||
- env: [TARGET="macos-python27", PYTHONPATH="/Library/Python/2.7/site-packages/"] | ||
install: | ||
- ./config/travis/install.sh | ||
- ./config/travis/install.sh | ||
script: | ||
- if test ${TRAVIS_OS_NAME} = "osx"; then PYTHONPATH=/Library/Python/2.7/site-packages/ /usr/bin/python run_tests.py; elif test ${TRAVIS_OS_NAME} = "linux"; then if test ${TRAVIS_PYTHON_VERSION} = "2.7"; then coverage run --source=artifacts --omit="*_test*,*__init__*,*test_lib*" ./run_tests.py; else ./run_tests.py; fi; fi | ||
- python setup.py build | ||
- python setup.py sdist | ||
- python setup.py bdist | ||
- if test ${TRAVIS_OS_NAME} = "linux"; then mkdir -p ${PWD}/tmp/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/ && PYTHONPATH=${PWD}/tmp/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/ python setup.py install --prefix=${PWD}/tmp/; fi | ||
- ./config/travis/runtests.sh | ||
after_success: | ||
- if test ${TRAVIS_OS_NAME} = "linux" && test ${TRAVIS_PYTHON_VERSION} = "2.7"; then coveralls --verbose; fi | ||
- if test ${TARGET} = "linux-python27"; then curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh; fi |
@@ -1,36 +1,62 @@ | ||
#!/bin/bash | ||
# | ||
# Script to set up Travis-CI test VM. | ||
|
||
COVERALL_DEPENDENCIES="python-coverage python-coveralls python-docopt"; | ||
# | ||
# This file is generated by l2tdevtools update-dependencies.py any dependency | ||
# related changes should be made in dependencies.ini. | ||
|
||
L2TBINARIES_DEPENDENCIES="PyYAML"; | ||
|
||
L2TBINARIES_TEST_DEPENDENCIES="funcsigs mock pbr six yapf"; | ||
|
||
PYTHON2_DEPENDENCIES="python-yaml"; | ||
|
||
PYTHON2_TEST_DEPENDENCIES="python-mock python-tox python-yapf"; | ||
PYTHON2_TEST_DEPENDENCIES="python-coverage python-mock python-tox python-yapf yapf"; | ||
|
||
PYTHON3_DEPENDENCIES="python3-yaml"; | ||
|
||
PYTHON3_TEST_DEPENDENCIES="python-yapf python3-mock python3-setuptools python3-tox yapf"; | ||
|
||
# Exit on error. | ||
set -e; | ||
|
||
if test ${TRAVIS_OS_NAME} = "osx"; | ||
then | ||
git clone https://github.com/log2timeline/l2tdevtools.git; | ||
|
||
mv l2tdevtools ../; | ||
mkdir dependencies; | ||
|
||
PYTHONPATH=../l2tdevtools ../l2tdevtools/tools/update.py --download-directory dependencies --track dev ${L2TBINARIES_DEPENDENCIES} ${L2TBINARIES_TEST_DEPENDENCIES}; | ||
git clone https://github.com/log2timeline/l2tbinaries.git -b dev; | ||
|
||
mv l2tbinaries ../; | ||
|
||
for PACKAGE in ${L2TBINARIES_DEPENDENCIES}; | ||
do | ||
echo "Installing: ${PACKAGE}"; | ||
sudo /usr/bin/hdiutil attach ../l2tbinaries/macos/${PACKAGE}-*.dmg; | ||
sudo /usr/sbin/installer -target / -pkg /Volumes/${PACKAGE}-*.pkg/${PACKAGE}-*.pkg; | ||
sudo /usr/bin/hdiutil detach /Volumes/${PACKAGE}-*.pkg | ||
done | ||
|
||
for PACKAGE in ${L2TBINARIES_TEST_DEPENDENCIES}; | ||
do | ||
echo "Installing: ${PACKAGE}"; | ||
sudo /usr/bin/hdiutil attach ../l2tbinaries/macos/${PACKAGE}-*.dmg; | ||
sudo /usr/sbin/installer -target / -pkg /Volumes/${PACKAGE}-*.pkg/${PACKAGE}-*.pkg; | ||
sudo /usr/bin/hdiutil detach /Volumes/${PACKAGE}-*.pkg | ||
done | ||
|
||
elif test ${TRAVIS_OS_NAME} = "linux"; | ||
then | ||
sudo rm -f /etc/apt/sources.list.d/travis_ci_zeromq3-source.list; | ||
|
||
sudo add-apt-repository ppa:gift/dev -y; | ||
sudo apt-get update -q; | ||
# Only install the Python 2 dependencies. | ||
# Also see: https://docs.travis-ci.com/user/languages/python/#Travis-CI-Uses-Isolated-virtualenvs | ||
sudo apt-get install -y ${COVERALL_DEPENDENCIES} ${PYTHON2_DEPENDENCIES} ${PYTHON2_TEST_DEPENDENCIES}; | ||
|
||
if test ${TRAVIS_PYTHON_VERSION} = "2.7"; | ||
then | ||
sudo apt-get install -y ${PYTHON2_DEPENDENCIES} ${PYTHON2_TEST_DEPENDENCIES}; | ||
else | ||
sudo apt-get install -y ${PYTHON3_DEPENDENCIES} ${PYTHON3_TEST_DEPENDENCIES}; | ||
fi | ||
if test ${TARGET} = "pylint"; | ||
then | ||
sudo apt-get install -y pylint; | ||
fi | ||
fi |
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
# | ||
# Script to run tests on Travis-CI. | ||
# | ||
# This file is generated by l2tdevtools update-dependencies.py, any dependency | ||
# related changes should be made in dependencies.ini. | ||
|
||
# Exit on error. | ||
set -e; | ||
|
||
if test "${TARGET}" = "pylint"; | ||
then | ||
pylint --version | ||
|
||
for FILE in `find setup.py artifacts tests -name \*.py`; | ||
do | ||
echo "Checking: ${FILE}"; | ||
|
||
pylint --rcfile=.pylintrc ${FILE}; | ||
done | ||
|
||
elif test "${TRAVIS_OS_NAME}" = "osx"; | ||
then | ||
PYTHONPATH=/Library/Python/2.7/site-packages/ /usr/bin/python ./run_tests.py; | ||
|
||
python ./setup.py build | ||
|
||
python ./setup.py sdist | ||
|
||
python ./setup.py bdist | ||
|
||
elif test "${TRAVIS_OS_NAME}" = "linux"; | ||
then | ||
if test -n "${TOXENV}"; | ||
then | ||
tox --sitepackages ${TOXENV}; | ||
|
||
elif test "${TRAVIS_PYTHON_VERSION}" = "2.7"; | ||
then | ||
coverage erase | ||
coverage run --source=artifacts --omit="*_test*,*__init__*,*test_lib*" ./run_tests.py | ||
else | ||
python ./run_tests.py | ||
fi | ||
|
||
python ./setup.py build | ||
|
||
python ./setup.py sdist | ||
|
||
python ./setup.py bdist | ||
|
||
TMPDIR="${PWD}/tmp"; | ||
TMPSITEPACKAGES="${TMPDIR}/lib/python${TRAVIS_PYTHON_VERSION}/site-packages"; | ||
|
||
mkdir -p ${TMPSITEPACKAGES}; | ||
|
||
PYTHONPATH=${TMPSITEPACKAGES} python ./setup.py install --prefix=${TMPDIR}; | ||
fi |
Oops, something went wrong.