Skip to content
Permalink
Browse files

Updates for Python 2.7 and 3.4 deprecation (#371)

  • Loading branch information
joachimmetz committed Jan 17, 2020
1 parent b3e0ea1 commit a9183c6e53b99f06ba321dd2754be2c219d85520
Showing with 44 additions and 179 deletions.
  1. +4 −44 .travis.yml
  2. +1 −13 appveyor.yml
  3. +4 −12 config/dpkg/control
  4. +8 −24 config/travis/install.sh
  5. +6 −6 config/travis/run_coverage.sh
  6. +6 −12 config/travis/runtests.sh
  7. +2 −2 setup.cfg
  8. +10 −57 setup.py
  9. +3 −9 utils/dependencies.py
@@ -10,18 +10,8 @@ matrix:
python: 3.6
services:
- docker
- name: "Fedora Core 30 (Docker) with Python 2.7"
env: FEDORA_VERSION="30"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
services:
- docker
- name: "Fedora Core 30 (Docker) with Python 3.7"
env: FEDORA_VERSION="30"
- name: "Fedora Core 31 (Docker) with Python 3.7"
env: FEDORA_VERSION="31"
os: linux
dist: xenial
sudo: required
@@ -30,16 +20,6 @@ matrix:
python: 3.7
services:
- docker
- name: "Ubuntu Bionic (18.04) (Docker) with Python 2.7"
env: [TARGET="coverage", UBUNTU_VERSION="18.04"]
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
services:
- docker
- name: "Ubuntu Bionic (18.04) (Docker) with Python 3.6"
env: UBUNTU_VERSION="18.04"
os: linux
@@ -50,26 +30,6 @@ matrix:
python: 3.6
services:
- docker
- name: "Ubuntu Bionic (18.04) (Docker) with Python 2.7 (tox)"
env: [TOXENV="py27", UBUNTU_VERSION="18.04"]
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
services:
- docker
- name: "Ubuntu Bionic (18.04) (Docker) with Python 3.4 (tox)"
env: [TOXENV="py34", UBUNTU_VERSION="18.04"]
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 3.4
services:
- docker
- name: "Ubuntu Bionic (18.04) (Docker) with Python 3.5 (tox)"
env: [TOXENV="py35", UBUNTU_VERSION="18.04"]
os: linux
@@ -103,9 +63,9 @@ matrix:
- name: "MacOS 10.14 with Python 3.7 (tox)"
env: TOXENV="py37"
os: osx
osx_image: xcode11
osx_image: xcode10
language: generic
install:
- ./config/travis/install.sh
script:
- ./config/travis/run_with_timeout.sh 30 ./config/travis/runtests.sh
- ./config/travis/run_with_timeout.sh 45 ./config/travis/runtests.sh
@@ -1,13 +1,5 @@
environment:
matrix:
- TARGET: unittests
MACHINE_TYPE: "x86"
PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7"
- TARGET: unittests
MACHINE_TYPE: "amd64"
PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7"
- TARGET: unittests
MACHINE_TYPE: "x86"
PYTHON: "C:\\Python37"
@@ -19,14 +11,10 @@ environment:

install:
- cmd: '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /release'
- cmd: "%PYTHON%\\python.exe -m pip install --upgrade pip"
- cmd: "%PYTHON%\\python.exe -m pip install -U pip setuptools wheel"
- cmd: "%PYTHON%\\python.exe -m pip install pywin32 WMI"
- cmd: "%PYTHON%\\python.exe %PYTHON%\\Scripts\\pywin32_postinstall.py -install"
- cmd: git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools
- cmd: if [%PYTHON_VERSION%]==[2.7] (
mkdir dependencies &&
set PYTHONPATH=..\l2tdevtools &&
"%PYTHON%\\python.exe" ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type %MACHINE_TYPE% --msi-targetdir "%PYTHON%" --track dev PyYAML funcsigs mock pbr six )
- cmd: if [%PYTHON_VERSION%]==[3.7] (
mkdir dependencies &&
set PYTHONPATH=..\l2tdevtools &&
@@ -2,10 +2,9 @@ Source: artifacts
Section: python
Priority: extra
Maintainer: Forensic artifacts <forensicartifacts@googlegroups.com>
Build-Depends: debhelper (>= 9), dh-python, python-all (>= 2.7~), python-setuptools, python3-all (>= 3.4~), python3-setuptools
Standards-Version: 3.9.5
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.4
Build-Depends: debhelper (>= 9), dh-python, python3-all (>= 3.5~), python3-setuptools
Standards-Version: 4.1.4
X-Python3-Version: >= 3.5
Homepage: https://github.com/ForensicArtifacts/artifacts

Package: artifacts-data
@@ -15,13 +14,6 @@ Description: Data files for ForensicArtifacts.com Artifact Repository
A free, community-sourced, machine-readable knowledge base of forensic
artifacts that the world can use both as an information source and within other tools.

Package: python-artifacts
Architecture: all
Depends: artifacts-data (>= ${binary:Version}), python-yaml (>= 3.10), ${python:Depends}, ${misc:Depends}
Description: Python 2 module of ForensicArtifacts.com Artifact Repository
A free, community-sourced, machine-readable knowledge base of forensic
artifacts that the world can use both as an information source and within other tools.

Package: python3-artifacts
Architecture: all
Depends: artifacts-data (>= ${binary:Version}), python3-yaml (>= 3.10), ${python3:Depends}, ${misc:Depends}
@@ -31,7 +23,7 @@ Description: Python 3 module of ForensicArtifacts.com Artifact Repository

Package: artifacts-tools
Architecture: all
Depends: python-artifacts (>= ${binary:Version}), ${python:Depends}, ${misc:Depends}
Depends: python3-artifacts (>= ${binary:Version}), ${python3:Depends}, ${misc:Depends}
Description: Tools of ForensicArtifacts.com Artifact Repository
A free, community-sourced, machine-readable knowledge base of forensic
artifacts that the world can use both as an information source and within other tools.
@@ -5,17 +5,9 @@
# This file is generated by l2tdevtools update-dependencies.py any dependency
# related changes should be made in dependencies.ini.

DPKG_PYTHON2_DEPENDENCIES="python-yaml";

DPKG_PYTHON2_TEST_DEPENDENCIES="python-coverage python-funcsigs python-mock python-pbr python-setuptools python-six";

DPKG_PYTHON3_DEPENDENCIES="python3-yaml";

DPKG_PYTHON3_TEST_DEPENDENCIES="python3-distutils python3-mock python3-pbr python3-setuptools python3-six";

RPM_PYTHON2_DEPENDENCIES="python2-pyyaml";

RPM_PYTHON2_TEST_DEPENDENCIES="python2-funcsigs python2-mock python2-pbr python2-setuptools python2-six";
DPKG_PYTHON3_TEST_DEPENDENCIES="python3-coverage python3-distutils python3-mock python3-pbr python3-setuptools python3-six";

RPM_PYTHON3_DEPENDENCIES="python3-pyyaml";

@@ -49,12 +41,7 @@ then
then
RPM_PACKAGES="${RPM_PACKAGES} findutils pylint";
fi
if test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
RPM_PACKAGES="${RPM_PACKAGES} python2 ${RPM_PYTHON2_DEPENDENCIES} ${RPM_PYTHON2_TEST_DEPENDENCIES}";
else
RPM_PACKAGES="${RPM_PACKAGES} python3 ${RPM_PYTHON3_DEPENDENCIES} ${RPM_PYTHON3_TEST_DEPENDENCIES}";
fi
RPM_PACKAGES="${RPM_PACKAGES} python3 ${RPM_PYTHON3_DEPENDENCIES} ${RPM_PYTHON3_TEST_DEPENDENCIES}";
fi
docker exec ${CONTAINER_NAME} dnf install -y ${RPM_PACKAGES};

@@ -100,22 +87,17 @@ then
then
DPKG_PACKAGES="${DPKG_PACKAGES} curl git";

elif test "${TARGET}" = "jenkins2" || test "${TARGET}" = "jenkins3";
elif test "${TARGET}" = "jenkins3";
then
DPKG_PACKAGES="${DPKG_PACKAGES} sudo";

elif test ${TARGET} = "pylint";
then
DPKG_PACKAGES="${DPKG_PACKAGES} python3-distutils pylint";
fi
if test "${TARGET}" != "jenkins2" && test "${TARGET}" != "jenkins3";
if test "${TARGET}" != "jenkins3";
then
if test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
DPKG_PACKAGES="${DPKG_PACKAGES} python ${DPKG_PYTHON2_DEPENDENCIES} ${DPKG_PYTHON2_TEST_DEPENDENCIES}";
else
DPKG_PACKAGES="${DPKG_PACKAGES} python3 ${DPKG_PYTHON3_DEPENDENCIES} ${DPKG_PYTHON3_TEST_DEPENDENCIES}";
fi
DPKG_PACKAGES="${DPKG_PACKAGES} python3 ${DPKG_PYTHON3_DEPENDENCIES} ${DPKG_PYTHON3_TEST_DEPENDENCIES}";
fi
fi
docker exec -e "DEBIAN_FRONTEND=noninteractive" ${CONTAINER_NAME} sh -c "apt-get install -y ${DPKG_PACKAGES}";
@@ -126,5 +108,7 @@ elif test ${TRAVIS_OS_NAME} = "osx";
then
brew update;

brew install tox;
# Brew will exit with 1 and print some diagnotisic information
# to prevent the CI test from failing || true is added.
brew install tox || true;
fi
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Script to run Python 2 with code coverage tests on Travis-CI.
# Script to run Python 3 with code coverage tests on Travis-CI.
#
# This file is generated by l2tdevtools update-dependencies.py, any dependency
# related changes should be made in dependencies.ini.
@@ -25,13 +25,13 @@ ${COVERAGE} run --source=artifacts --omit="*_test*,*__init__*,*test_lib*" ./run_

if test -f tests/end-to-end.py;
then
PYTHONPATH=. python2 ./tests/end-to-end.py --debug -c config/end-to-end.ini;
PYTHONPATH=. python3 ./tests/end-to-end.py --debug -c config/end-to-end.ini;
fi

python2 ./setup.py build
python3 ./setup.py build

python2 ./setup.py sdist
python3 ./setup.py sdist

python2 ./setup.py bdist
python3 ./setup.py bdist

python2 ./setup.py install
python3 ./setup.py install
@@ -20,10 +20,6 @@ then
elif test "${TARGET}" = "pylint";
then
TEST_COMMAND="./config/travis/run_pylint.sh";

elif test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
TEST_COMMAND="./config/travis/run_python2.sh";
else
TEST_COMMAND="./config/travis/run_python3.sh";
fi
@@ -51,21 +47,13 @@ then

TEST_COMMAND="./config/travis/run_coverage.sh";

elif test "${TARGET}" = "jenkins2";
then
TEST_COMMAND="./config/jenkins/linux/run_end_to_end_tests.sh travis";

elif test "${TARGET}" = "jenkins3";
then
TEST_COMMAND="./config/jenkins/linux/run_end_to_end_tests_py3.sh travis";

elif test "${TARGET}" = "pylint";
then
TEST_COMMAND="./config/travis/run_pylint.sh";

elif test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
TEST_COMMAND="./config/travis/run_python2.sh";
else
TEST_COMMAND="./config/travis/run_python3.sh";
fi
@@ -78,5 +66,11 @@ then

elif test "${TRAVIS_OS_NAME}" = "osx";
then
# Set the following environment variables to build pycrypto and yara-python.
export CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include ${CFLAGS}";
export LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib ${LDFLAGS}";
export LDFLAGS="-L/usr/local/lib ${LDFLAGS}";
export TOX_TESTENV_PASSENV="CFLAGS LDFLAGS";

tox -e ${TOXENV};
fi
@@ -8,8 +8,8 @@ doc_files = ACKNOWLEDGEMENTS
AUTHORS
LICENSE
README
build_requires = python2-setuptools
requires = python2-pyyaml >= 3.10
build_requires = python3-setuptools
requires = python3-pyyaml >= 3.10

[bdist_wheel]
universal = 1

0 comments on commit a9183c6

Please sign in to comment.
You can’t perform that action at this time.