Hello community, here is the log from the commit of package python-ssdeep for openSUSE:Factory checked in at 2020-03-18 12:40:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ssdeep (Old) and /work/SRC/openSUSE:Factory/.python-ssdeep.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ssdeep" Wed Mar 18 12:40:18 2020 rev:2 rq:785940 version:3.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ssdeep/python-ssdeep.changes 2018-08-24 17:01:30.501886719 +0200 +++ /work/SRC/openSUSE:Factory/.python-ssdeep.new.3160/python-ssdeep.changes 2020-03-18 12:44:43.132929118 +0100 @@ -1,0 +2,11 @@ +Tue Mar 17 13:01:23 UTC 2020 - [email protected] + +- version update to 3.4 + * Update documentation + * Replace Jenkins and Travis CI with Drone CI + * Add new copy() function to Hash() and PseudoHash() class + * Add new attributes to Hash() and PseudoHash() class + * name + * block_size + +------------------------------------------------------------------- Old: ---- python-ssdeep-3.3.tar.gz New: ---- python-ssdeep-3.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ssdeep.spec ++++++ --- /var/tmp/diff_new_pack.Sq0r5H/_old 2020-03-18 12:44:44.616930056 +0100 +++ /var/tmp/diff_new_pack.Sq0r5H/_new 2020-03-18 12:44:44.620930058 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-ssdeep # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,34 +12,35 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-ssdeep -Version: 3.3 +Version: 3.4 Release: 0 -License: LGPL-3.0+ Summary: Python wrapper for the ssdeep library -Url: http://github.com/DinoTools/python-ssdeep +License: LGPL-3.0-or-later Group: Development/Languages/Python +URL: https://github.com/DinoTools/python-ssdeep #Source: https://files.pythonhosted.org/packages/source/s/ssdeep/ssdeep-%%{version}.tar.gz # no docs here, see https://github.com/DinoTools/python-ssdeep/issues/37 Source: https://github.com/DinoTools/python-ssdeep/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -BuildRequires: python-rpm-macros +BuildRequires: %{python_module cffi >= 0.8.6} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module cffi >= 0.8.6} +BuildRequires: fdupes +BuildRequires: libfuzzy-devel +BuildRequires: python-rpm-macros +Requires: python-cffi +Requires: ssdeep # SECTION tests BuildRequires: %{python_module pytest-runner} # /SECTION # SECTION docs -BuildRequires: python-sphinx BuildRequires: python-mock +BuildRequires: python-sphinx # /SECTION -BuildRequires: libfuzzy-devel -BuildRequires: fdupes -Requires: ssdeep - %python_subpackages %description @@ -53,7 +54,7 @@ %build %python_build pushd docs -make html +%make_build html rm build/html/.buildinfo popd ++++++ python-ssdeep-3.3.tar.gz -> python-ssdeep-3.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/.drone.yml new/python-ssdeep-3.4/.drone.yml --- old/python-ssdeep-3.3/.drone.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/python-ssdeep-3.4/.drone.yml 2019-10-03 21:17:12.000000000 +0200 @@ -0,0 +1,366 @@ +--- +### Python 2.7 +kind: pipeline +name: Python 2.7 + +steps: +- name: test + image: registry.dinotools.org/docker-ci/python:2.7 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev libfuzzy-dev + - . /opt/python/venv/bin/activate + - python --version + - pip install tox + - BUILD_LIB=0 tox --recreate -vvv -e py27 + +--- +### Python 3.5 +kind: pipeline +name: Python 3.5 + +steps: +- name: test + image: registry.dinotools.org/docker-ci/python:3.5 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev libfuzzy-dev + - . /opt/python/venv/bin/activate + - python --version + - pip install tox + - BUILD_LIB=0 tox --recreate -vvv -e py35 + +--- +### Python 3.6 +kind: pipeline +name: Python 3.6 + +steps: +- name: test + image: registry.dinotools.org/docker-ci/python:3.6 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev libfuzzy-dev + - . /opt/python/venv/bin/activate + - python --version + - pip install tox + - BUILD_LIB=0 tox --recreate -vvv -e py36 + +--- +### Python 3.7 +kind: pipeline +name: Python 3.7 + +steps: +- name: test + image: registry.dinotools.org/docker-ci/python:3.7 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev libfuzzy-dev + - . /opt/python/venv/bin/activate + - python --version + - pip install tox + - BUILD_LIB=0 tox --recreate -vvv -e py37 + +--- +### Python 3.7 +kind: pipeline +name: Python 3.7 - Docs + +steps: +- name: sphinx + image: registry.dinotools.org/docker-ci/python:3.7 + commands: + - . /opt/python/venv/bin/activate + - python --version + - pip install sphinx mock doc8 + - (cd docs/source && sphinx-build -W -b html . ../_build/html) + - (cd docs/source && sphinx-build -W -b latex . ../_build/latex) + - doc8 --verbose --allow-long-titles --max-line-length=9999 README.rst CHANGELOG.rst CONTRIBUTING.rst docs/source --ignore-path docs/_build/ + +--- +### Python 3.7 +kind: pipeline +name: Python 3.7 - flake8 + +steps: +- name: test + image: registry.dinotools.org/docker-ci/python:3.7 + commands: + - . /opt/python/venv/bin/activate + - python --version + - pip install flake8 + - flake8 --ignore F401 src/ssdeep + +--- +### CentOS 7 +kind: pipeline +name: CentOS 7, Python2, builtin + +steps: +- name: test + image: centos:7 + commands: + - yum -q -y groupinstall "Development Tools" + - yum -q -y install epel-release + - | + yum -q -y install libffi-devel \ + python-devel \ + python-pip \ + pytest \ + automake \ + autoconf \ + libtool + - BUILD_LIB=1 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: CentOS 7, Python2, system + +steps: +- name: test + image: centos:7 + commands: + - yum -q -y groupinstall "Development Tools" + - yum -q -y install epel-release + - | + yum -q -y install libffi-devel \ + libffi-devel \ + python-devel \ + python-pip \ + pytest \ + ssdeep-devel \ + ssdeep-lib + - BUILD_LIB=0 pip install . + # - pip install pytest + - py.test + +--- +### Debian 8 +kind: pipeline +name: Debian 8, Python2, builtin + +steps: +- name: test + image: debian:8 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest automake autoconf libtool + - BUILD_LIB=1 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Debian 8, Python2, system + +steps: +- name: test + image: debian:8 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest libfuzzy-dev + - BUILD_LIB=0 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Debian 8, Python3, builtin + +steps: +- name: test + image: debian:8 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest automake autoconf libtool + - BUILD_LIB=1 pip3 install . + # - pip3 install pytest + - py.test-3 + +--- +kind: pipeline +name: Debian 8, Python3, system + +steps: +- name: test + image: debian:8 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest libfuzzy-dev + - BUILD_LIB=0 pip3 install . + # - pip3 install pytest + - py.test-3 + +--- +### Debian 9 +kind: pipeline +name: Debian 9, Python2, builtin + +steps: +- name: test + image: debian:9 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest automake autoconf libtool + - BUILD_LIB=1 pip install . + - pip install pytest + - py.test + +--- +kind: pipeline +name: Debian 9, Python2, system + +steps: +- name: test + image: debian:9 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest libfuzzy-dev + - BUILD_LIB=0 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Debian 9, Python3, builtin + +steps: +- name: test + image: debian:9 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest automake autoconf libtool + - BUILD_LIB=1 pip3 install . + #- pip3 install pytest + - py.test-3 + +--- +kind: pipeline +name: Debian 9, Python3, system + +steps: +- name: test + image: debian:9 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest libfuzzy-dev + - BUILD_LIB=0 pip3 install . + # - pip3 install pytest + - py.test-3 + +--- +### Ubuntu 16.04 +kind: pipeline +name: Ubuntu 16.04, Python2, builtin + +steps: +- name: test + image: ubuntu:16.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest automake autoconf libtool + - BUILD_LIB=1 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Ubuntu 16.04, Python2, system + +steps: +- name: test + image: ubuntu:16.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest libfuzzy-dev + - BUILD_LIB=0 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Ubuntu 16.04, Python3, builtin + +steps: +- name: test + image: ubuntu:16.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest automake autoconf libtool + - BUILD_LIB=1 pip3 install . + # - pip3 install pytest + - py.test-3 + +--- +kind: pipeline +name: Ubuntu 16.04, Python3, system + +steps: +- name: test + image: ubuntu:16.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest libfuzzy-dev + - BUILD_LIB=0 pip3 install . + # - pip3 install pytest + - py.test-3 + +--- +### Ubuntu 18.04 +kind: pipeline +name: Ubuntu 18.04, Python2, builtin + +steps: +- name: test + image: ubuntu:18.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest automake autoconf libtool + - BUILD_LIB=1 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Ubuntu 18.04, Python2, system + +steps: +- name: test + image: ubuntu:18.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python python-dev python-pip python-pytest libfuzzy-dev + - BUILD_LIB=0 pip install . + # - pip install pytest + - py.test + +--- +kind: pipeline +name: Ubuntu 18.04, Python3, builtin + +steps: +- name: test + image: ubuntu:18.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest automake autoconf libtool + - BUILD_LIB=1 pip3 install . + # - pip3 install pytest + - py.test-3 + +--- +kind: pipeline +name: Ubuntu 18.04, Python3, system + +steps: +- name: test + image: ubuntu:18.04 + commands: + - apt-get update + - apt-get install -y build-essential libffi-dev python3 python3-dev python3-pip python3-pytest libfuzzy-dev + - BUILD_LIB=0 pip3 install . + # - pip3 install pytest + - py.test-3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/.travis.yml new/python-ssdeep-3.4/.travis.yml --- old/python-ssdeep-3.3/.travis.yml 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -# use container-based infrastructure -sudo: false -language: python - -matrix: - include: - - python: pypy - env: TOXENV=pypy - - python: pypy3 - env: TOXENV=pypy3 - - python: 2.6 - env: TOXENV=py26 - - python: 2.7 - env: TOXENV=py27 - - python: 3.2 - env: TOXENV=py32 - - python: 3.3 - env: TOXENV=py33 - - python: 3.4 - env: TOXENV=py34 - - python: 3.5 - env: TOXENV=py35 - - python: 3.6 - env: TOXENV=py36 - - python: 2.7 - env: TOXENV=docs - -before_install: - - if [[ "${TOXENV}" == 'py32' ]] || [[ "${TOXENV}" == 'pypy' ]] || [[ "${TOXENV}" == 'pypy3' ]]; then pip install 'setuptools_scm'; fi - - pip install coveralls - -install: - - pip install tox - -script: - - BUILD_LIB=1 tox --recreate -vvv -e ${TOXENV} - -after_success: - - coveralls --verbose diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/CHANGELOG.rst new/python-ssdeep-3.4/CHANGELOG.rst --- old/python-ssdeep-3.3/CHANGELOG.rst 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/CHANGELOG.rst 2019-10-03 21:17:12.000000000 +0200 @@ -6,6 +6,16 @@ .. note:: This version is not yet released and is under development. +3.4 (2019-10-01) +~~~~~~~~~~~~~~~~ + +* Update documentation +* Replace Jenkins and Travis CI with Drone CI +* Add new copy() function to Hash() and PseudoHash() class +* Add new attributes to Hash() and PseudoHash() class + * name + * block_size + 3.3 (2018-01-10) ~~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/MANIFEST.in new/python-ssdeep-3.4/MANIFEST.in --- old/python-ssdeep-3.3/MANIFEST.in 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/MANIFEST.in 2019-10-03 21:17:12.000000000 +0200 @@ -1,3 +1,12 @@ -include README.rst CHANGELOG.rst -recursive-include src/ssdeep-lib *.c *.cpp *.h Makefile.am install-sh config.guess COPYING Makefile.in ssdeep.1 configure README depcomp NEWS TODO config.sub FILEFORMAT missing configure.ac config.h.in aclocal.m4 AUTHORS INSTALL ltmain.sh ChangeLog compile -recursive-include tests *.py +include CHANGELOG.rst +include CONTRIBUTING.rst +include LICENSE +include README.rst +include tox.ini +graft docs +prune docs/build +graft src/ssdeep-lib +graft tests + +global-exclude __pycache__ +global-exclude *.py[co] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/README.rst new/python-ssdeep-3.4/README.rst --- old/python-ssdeep-3.3/README.rst 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/README.rst 2019-10-03 21:17:12.000000000 +0200 @@ -78,7 +78,7 @@ * CentOS 7 * Debian 8, 9 -* Ubuntu 14.04, 16.04 +* Ubuntu 14.04, 16.04, 18.04 Documentation ============= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/centos-7_python2-builtin/Dockerfile new/python-ssdeep-3.4/ci/centos-7_python2-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/centos-7_python2-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/centos-7_python2-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,21 +0,0 @@ -FROM centos:7 - -RUN yum -q -y groupinstall "Development Tools" && \ - yum -q -y install epel-release - -RUN yum -q -y install \ - libffi-devel \ - python-devel \ - python-pip \ - pytest - -RUN yum -q -y install \ - automake \ - autoconf \ - libtool - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/centos-7_python2-system/Dockerfile new/python-ssdeep-3.4/ci/centos-7_python2-system/Dockerfile --- old/python-ssdeep-3.3/ci/centos-7_python2-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/centos-7_python2-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,20 +0,0 @@ -FROM centos:7 - -RUN yum -q -y groupinstall "Development Tools" && \ - yum -q -y install epel-release - -RUN yum -q -y install \ - libffi-devel \ - python-devel \ - python-pip \ - pytest - -RUN yum -q -y install \ - ssdeep-devel \ - ssdeep-lib - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip install . && \ - pip install pytest && \ - py.test \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-8_python2-builtin/Dockerfile new/python-ssdeep-3.4/ci/debian-8_python2-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/debian-8_python2-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-8_python2-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM debian:8 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-8_python2-system/Dockerfile new/python-ssdeep-3.4/ci/debian-8_python2-system/Dockerfile --- old/python-ssdeep-3.3/ci/debian-8_python2-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-8_python2-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM debian:8 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - - -RUN apt-get install -y \ - libfuzzy-dev \ - && \ - apt-get clean - - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-8_python3-builtin/Dockerfile new/python-ssdeep-3.4/ci/debian-8_python3-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/debian-8_python3-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-8_python3-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM debian:8 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-8_python3-system/Dockerfile new/python-ssdeep-3.4/ci/debian-8_python3-system/Dockerfile --- old/python-ssdeep-3.3/ci/debian-8_python3-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-8_python3-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -FROM debian:8 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - libfuzzy-dev \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-9_python2-builtin/Dockerfile new/python-ssdeep-3.4/ci/debian-9_python2-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/debian-9_python2-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-9_python2-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM debian:9 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-9_python2-system/Dockerfile new/python-ssdeep-3.4/ci/debian-9_python2-system/Dockerfile --- old/python-ssdeep-3.3/ci/debian-9_python2-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-9_python2-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM debian:9 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - - -RUN apt-get install -y \ - libfuzzy-dev \ - && \ - apt-get clean - - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-9_python3-builtin/Dockerfile new/python-ssdeep-3.4/ci/debian-9_python3-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/debian-9_python3-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-9_python3-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM debian:9 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/debian-9_python3-system/Dockerfile new/python-ssdeep-3.4/ci/debian-9_python3-system/Dockerfile --- old/python-ssdeep-3.3/ci/debian-9_python3-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/debian-9_python3-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -FROM debian:9 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - libfuzzy-dev \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/run.sh new/python-ssdeep-3.4/ci/run.sh --- old/python-ssdeep-3.3/ci/run.sh 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/run.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,28 +0,0 @@ -#!/bin/bash - -OS_NAME=$1 -OS_VERSION=$2 -PYTHON_VERSION=$3 -LIB_TYPE=$4 - -if [ $# -ne 4 ]; then - echo "$0 <OS_NAME> <OS_VERSION> <PYTHON_VERSION> <LIB_TYPE>" - exit 1 -fi - -BASE_PATH="`dirname \"$0\"`" -BASE_PATH="`( cd \"$BASE_PATH\" && pwd )`" -if [ -z "$BASE_PATH" ] ; then - exit 1 -fi -echo "Base path: $BASE_PATH" - -CFG_PATH="${BASE_PATH}/${OS_NAME}-${OS_VERSION}_${PYTHON_VERSION}-${LIB_TYPE}" -if [ ! -d "$CFG_PATH" ]; then - echo "Path '$CFG_PATH' not found" - exit 1 -fi - -docker build -f "${CFG_PATH}/Dockerfile" . -RET=$? -exit $RET diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/ubuntu-14.04_python2-builtin/Dockerfile new/python-ssdeep-3.4/ci/ubuntu-14.04_python2-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/ubuntu-14.04_python2-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/ubuntu-14.04_python2-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM ubuntu:14.04 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/ubuntu-14.04_python3-builtin/Dockerfile new/python-ssdeep-3.4/ci/ubuntu-14.04_python3-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/ubuntu-14.04_python3-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/ubuntu-14.04_python3-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM ubuntu:14.04 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/ubuntu-16.04_python2-builtin/Dockerfile new/python-ssdeep-3.4/ci/ubuntu-16.04_python2-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/ubuntu-16.04_python2-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/ubuntu-16.04_python2-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM ubuntu:16.04 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/ubuntu-16.04_python2-system/Dockerfile new/python-ssdeep-3.4/ci/ubuntu-16.04_python2-system/Dockerfile --- old/python-ssdeep-3.3/ci/ubuntu-16.04_python2-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/ubuntu-16.04_python2-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -FROM ubuntu:16.04 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python \ - python-dev \ - python-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - libfuzzy-dev \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip install . && \ - pip install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/ubuntu-16.04_python3-builtin/Dockerfile new/python-ssdeep-3.4/ci/ubuntu-16.04_python3-builtin/Dockerfile --- old/python-ssdeep-3.3/ci/ubuntu-16.04_python3-builtin/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/ubuntu-16.04_python3-builtin/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -FROM ubuntu:16.04 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - automake \ - autoconf \ - libtool \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=1 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/ci/ubuntu-16.04_python3-system/Dockerfile new/python-ssdeep-3.4/ci/ubuntu-16.04_python3-system/Dockerfile --- old/python-ssdeep-3.3/ci/ubuntu-16.04_python3-system/Dockerfile 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/ci/ubuntu-16.04_python3-system/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -FROM ubuntu:16.04 -ENV DEBIAN_FRONTEND noninteractive - -# Speedup -RUN echo 'force-unsafe-io' | tee /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ - echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | tee /etc/apt/apt.conf.d/no-cache && \ - echo 'Acquire::http {No-Cache=True;};' | tee /etc/apt/apt.conf.d/no-http-cache - -RUN apt-get update && \ - apt-get install -y \ - build-essential \ - libffi-dev \ - && \ - apt-get clean - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - && \ - apt-get clean - -RUN apt-get install -y \ - libfuzzy-dev \ - && \ - apt-get clean - -COPY . /code -RUN cd /code && \ - BUILD_LIB=0 pip3 install . && \ - pip3 install pytest && \ - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/docs/source/api.rst new/python-ssdeep-3.4/docs/source/api.rst --- old/python-ssdeep-3.3/docs/source/api.rst 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/docs/source/api.rst 2019-10-03 21:17:12.000000000 +0200 @@ -7,10 +7,12 @@ .. autoclass:: ssdeep.Hash :members: :undoc-members: + :inherited-members: .. autoclass:: ssdeep.PseudoHash :members: :undoc-members: + :inherited-members: Functions --------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/docs/source/faq.rst new/python-ssdeep-3.4/docs/source/faq.rst --- old/python-ssdeep-3.3/docs/source/faq.rst 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/docs/source/faq.rst 2019-10-03 21:17:12.000000000 +0200 @@ -3,7 +3,7 @@ **If comparing two hashes the result is always 0** -The result depends on the algorithms in the ssdeep library. There are some issues if the length of provided data is to short or if the algorithm could not find enough patterns. +The result depends on the algorithms in the ssdeep library. There are some issues if the length of provided data is too short or if the algorithm could not find enough patterns. The following example must not return the expected value. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/docs/source/installation.rst new/python-ssdeep-3.4/docs/source/installation.rst --- old/python-ssdeep-3.3/docs/source/installation.rst 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/docs/source/installation.rst 2019-10-03 21:17:12.000000000 +0200 @@ -299,3 +299,42 @@ .. code-block:: console $ BUILD_LIB=1 pip3 install ssdeep + +Install on Fedora 27 +-------------------- + +Python 2 +~~~~~~~~ + +**Use lib from Fedora repository** + +Install required packages. + +.. code-block:: console + + $ sudo dnf groupinstall "Development Tools" + $ sudo dnf install libffi-devel python-devel python-pip ssdeep-devel ssdeep-libs + +Build and install Python module. + +.. code-block:: console + + $ sudo pip install ssdeep + +Python 3 +~~~~~~~~ + +**Use lib from Fedora repository** + +Install required packages. + +.. code-block:: console + + $ sudo dnf groupinstall "Development Tools" + $ sudo dnf install libffi-devel python3-devel python3-pip ssdeep-devel ssdeep-libs + +Build and install Python module. + +.. code-block:: console + + $ sudo pip3 install ssdeep diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/setup.py new/python-ssdeep-3.4/setup.py --- old/python-ssdeep-3.3/setup.py 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/setup.py 2019-10-03 21:17:12.000000000 +0200 @@ -4,6 +4,8 @@ import subprocess import sys from distutils.command.build import build +import setuptools +from pkg_resources import parse_version from setuptools import setup, find_packages from setuptools.command.install import install @@ -94,6 +96,15 @@ with open(os.path.join(base_dir, "README.rst")) as f: long_description = f.read() +# On some systems(e.g. Debian 8, CentOS 7) the setuptools package is very old. +# We try to install an old version of pytest-runner without setuptools_scm dependency. +# See: https://github.com/pytest-dev/pytest-runner/blob/master/CHANGES.rst +if parse_version(setuptools.__version__) < parse_version("12"): + setup_requires = ["pytest-runner<2.4"] +else: + setup_requires = ["pytest-runner"] + + setup( name=about["__title__"], version=about["__version__"], @@ -119,6 +130,7 @@ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", @@ -130,9 +142,8 @@ ], setup_requires=[ "cffi>=0.8.6", - "pytest-runner", "six>=1.4.1", - ], + ] + setup_requires, tests_require=[ "pytest", ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/src/ssdeep/__about__.py new/python-ssdeep-3.4/src/ssdeep/__about__.py --- old/python-ssdeep-3.3/src/ssdeep/__about__.py 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/src/ssdeep/__about__.py 2019-10-03 21:17:12.000000000 +0200 @@ -13,7 +13,7 @@ __summary__ = "Python wrapper for the ssdeep library" __uri__ = "http://github.com/DinoTools/python-ssdeep" -__version__ = "3.3" +__version__ = "3.4" __author__ = "PhiBo (DinoTools)" __email__ = "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/src/ssdeep/__init__.py new/python-ssdeep-3.4/src/ssdeep/__init__.py --- old/python-ssdeep-3.3/src/ssdeep/__init__.py 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/src/ssdeep/__init__.py 2019-10-03 21:17:12.000000000 +0200 @@ -27,7 +27,36 @@ pass -class Hash(object): +class BaseHash(object): + """ + Base class used to implement some general functions for the Hash and + PseudoHash class. + """ + @property + def block_size(self): + """ + The block size used to calculate the hash. + This depends on the length of the source string. + + :return: block size + """ + size, _, _ = self.digest().partition(":") + return int(size) + + @property + def name(self): + """ + The canonical name of this hash + + :return: ssdeep + """ + return "ssdeep" + + def digest(self, elimseq=False, notrunc=False): + raise NotImplementedError + + +class Hash(BaseHash): """ Hashlib like object. It is only supported with ssdeep/libfuzzy >= 2.10. @@ -44,6 +73,25 @@ if self._state == ffi.NULL: raise InternalError("Unable to create state object") + def copy(self): + """ + Create a copy of this hash object. + + :return: Return a copy of the hash object. + :rtype: Hash + :raises InternalError: If the lib returns an internal error + """ + if self._state == ffi.NULL: + raise InternalError("State object is NULL") + + newstate = binding.lib.fuzzy_clone(self._state) + if newstate == ffi.NULL: + raise InternalError("cloning of fuzzy state object failed") + + new = Hash.__new__(Hash) + new._state = newstate + return new + def update(self, buf, encoding="utf-8"): """ Feed the data contained in the given buffer to the state. @@ -101,7 +149,7 @@ binding.lib.fuzzy_free(self._state) -class PseudoHash(object): +class PseudoHash(BaseHash): """ Hashlib like object. Use this class only if Hash() isn't supported by your ssdeep/libfuzzy library. This class stores the provided data in memory, so @@ -111,6 +159,18 @@ def __init__(self): self._data = b"" + def copy(self): + """ + Create a copy of this hash object. + + :return: Return a copy of the hash object. + :rtype: PseudoHash + :raises InternalError: If the lib returns an internal error + """ + new = PseudoHash() + new.update(self._data) + return new + def update(self, buf, encoding="utf-8"): """ Feed the data contained in the given buffer to the state. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/src/ssdeep/binding.py new/python-ssdeep-3.4/src/ssdeep/binding.py --- old/python-ssdeep-3.3/src/ssdeep/binding.py 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/src/ssdeep/binding.py 2019-10-03 21:17:12.000000000 +0200 @@ -11,6 +11,11 @@ struct fuzzy_state; struct fuzzy_state *fuzzy_new(void); + + struct fuzzy_state *fuzzy_clone( + const struct fuzzy_state * + ); + int fuzzy_update( struct fuzzy_state *, const unsigned char *, @@ -62,6 +67,7 @@ struct fuzzy_state {}; const long FUZZY_FLAG_ELIMSEQ = 0; const long FUZZY_FLAG_NOTRUNC = 0; + int (*fuzzy_clone)(const struct fuzzy_state *) = NULL; int (*fuzzy_digest)( const struct fuzzy_state *, char *, @@ -91,6 +97,7 @@ "ssdeep_HAS_STATEFUL_HASHING": ( "FUZZY_FLAG_ELIMSEQ", "FUZZY_FLAG_NOTRUNC", + "fuzzy_clone", "fuzzy_digest", "fuzzy_free", "fuzzy_new", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/tests/test_lib.py new/python-ssdeep-3.4/tests/test_lib.py --- old/python-ssdeep-3.3/tests/test_lib.py 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/tests/test_lib.py 2019-10-03 21:17:12.000000000 +0200 @@ -69,6 +69,39 @@ class TestHashClass(object): + def test_copy(self): + obj = ssdeep.Hash() + obj.update("Also called fuzzy hashes, ") + new_obj = obj.copy() + assert isinstance(new_obj, ssdeep.Hash) + + res = obj.digest() + new_res = new_obj.digest() + assert res == "3:AXGBicFlF:AXGHR" + assert new_res == "3:AXGBicFlF:AXGHR" + + # Update only original object + obj.update("Ctph can match inputs that have homologies.") + + res = obj.digest() + new_res = new_obj.digest() + assert res == "3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C" + assert new_res == "3:AXGBicFlF:AXGHR" + + # Update only new object + new_obj.update("Ctph can match inputs that have homologies.") + res = obj.digest() + new_res = new_obj.digest() + assert res == "3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C" + assert new_res == "3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C" + + def test_hashlib(self): + obj = ssdeep.Hash() + assert obj.name == "ssdeep" + + obj.update("Ctph can match inputs that have homologies.") + assert obj.block_size == 3 + def test_update(self): obj = ssdeep.Hash() obj.update("Also called fuzzy hashes, Ctph can match inputs that have homologies.") @@ -78,6 +111,39 @@ class TestPseudoHashClass(object): + def test_copy(self): + obj = ssdeep.PseudoHash() + obj.update("Also called fuzzy hashes, ") + new_obj = obj.copy() + assert isinstance(new_obj, ssdeep.PseudoHash) + + res = obj.digest() + new_res = new_obj.digest() + assert res == "3:AXGBicFlF:AXGHR" + assert new_res == "3:AXGBicFlF:AXGHR" + + # Update only original object + obj.update("Ctph can match inputs that have homologies.") + + res = obj.digest() + new_res = new_obj.digest() + assert res == "3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C" + assert new_res == "3:AXGBicFlF:AXGHR" + + # Update only new object + new_obj.update("Ctph can match inputs that have homologies.") + res = obj.digest() + new_res = new_obj.digest() + assert res == "3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C" + assert new_res == "3:AXGBicFlgVNhBGcL6wCrFQEv:AXGHsNhxLsr2C" + + def test_hashlib(self): + obj = ssdeep.PseudoHash() + assert obj.name == "ssdeep" + + obj.update("Ctph can match inputs that have homologies.") + assert obj.block_size == 3 + def test_update(self): obj = ssdeep.PseudoHash() obj.update("Also called fuzzy hashes, ") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-ssdeep-3.3/tox.ini new/python-ssdeep-3.4/tox.ini --- old/python-ssdeep-3.3/tox.ini 2018-01-10 22:25:56.000000000 +0100 +++ new/python-ssdeep-3.4/tox.ini 2019-10-03 21:17:12.000000000 +0200 @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,py32,py33,py34,py35,py36,pypy,pypy3,docs +envlist = py27,py34,py35,py36,py37,pypy,pypy3 [testenv] deps = @@ -11,18 +11,8 @@ coverage combine coverage report -m -[testenv:py32] +[testenv:py27] # Support for Python < 3.3 has been dropped with pytest >= 3.0.0 deps = - pytest<3.0.0 - coverage<4.0.0 - -[testenv:docs] -extras = - docstest -basepython = python2.7 -changedir=docs/source -commands = - sphinx-build -W -b html -d {envtmpdir}/doctrees . ../_build/html - sphinx-build -W -b latex -d {envtmpdir}/doctrees . ../_build/latex - doc8 --verbose --allow-long-titles --max-line-length=9999 ../../README.rst ../../CHANGELOG.rst ../../CONTRIBUTING.rst . --ignore-path ../docs/_build/ + pytest<=2.9.1 + coverage
