Hello community,

here is the log from the commit of package python-yara for openSUSE:Factory 
checked in at 2017-07-21 22:44:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-yara (Old)
 and      /work/SRC/openSUSE:Factory/.python-yara.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-yara"

Fri Jul 21 22:44:58 2017 rev:2 rq:501386 version:3.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-yara/python-yara.changes  2016-11-12 
13:00:41.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-yara.new/python-yara.changes     
2017-07-21 22:44:59.849983708 +0200
@@ -1,0 +2,6 @@
+Tue Jun  6 12:21:28 UTC 2017 - [email protected]
+
+- update to v3.6.1
+  - see yara package for changelog
+
+-------------------------------------------------------------------

Old:
----
  v3.5.0.tar.gz

New:
----
  v3.6.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-yara.spec ++++++
--- /var/tmp/diff_new_pack.QCbz1N/_old  2017-07-21 22:45:00.933830818 +0200
+++ /var/tmp/diff_new_pack.QCbz1N/_new  2017-07-21 22:45:00.937830253 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-yara
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,13 @@
 
 
 Name:           python-yara
-Version:        3.5.0
+Version:        3.6.1
 Release:        0
 Summary:        Python Bindings for YARA (from Virus Total)
 License:        Apache-2.0
 Group:          Development/Libraries/Python
 Url:            https://github.com/VirusTotal/yara-python/wiki
-Source:         https://github.com/VirusTotal/yara-python/archive/v3.5.0.tar.gz
+Source:         
https://github.com/VirusTotal/yara-python/archive/v%{version}.tar.gz
 BuildRequires:  fdupes
 BuildRequires:  pkgconfig
 BuildRequires:  python-setuptools

++++++ v3.5.0.tar.gz -> v3.6.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/.travis.yml 
new/yara-python-3.6.1/.travis.yml
--- old/yara-python-3.5.0/.travis.yml   1970-01-01 01:00:00.000000000 +0100
+++ new/yara-python-3.6.1/.travis.yml   2017-06-06 00:49:35.000000000 +0200
@@ -0,0 +1,15 @@
+language: python
+
+python:
+  - "2.6"
+  - "2.7"
+  - "3.3"
+  - "3.4"
+  - "3.5"
+  - "3.6"
+
+install:
+  - python setup.py install
+
+script:
+  - python tests.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/MANIFEST.in 
new/yara-python-3.6.1/MANIFEST.in
--- old/yara-python-3.5.0/MANIFEST.in   2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/MANIFEST.in   2017-06-06 00:49:35.000000000 +0200
@@ -1,3 +1,4 @@
-include *.c *.h
+include *.c
 include yara/libyara/modules/module_list
 recursive-include yara *.c *.h
+include LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/README.rst 
new/yara-python-3.6.1/README.rst
--- old/yara-python-3.5.0/README.rst    2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/README.rst    2017-06-06 00:49:35.000000000 +0200
@@ -1,3 +1,8 @@
+.. image:: https://travis-ci.org/VirusTotal/yara-python.svg
+    :target: https://travis-ci.org/VirusTotal/yara-python
+.. image:: 
https://ci.appveyor.com/api/projects/status/gidnb9ulj3rje5s2?svg=true
+    :target: https://ci.appveyor.com/project/plusvic/yara-python
+
 yara-python
 ===========
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/appveyor/install.ps1 
new/yara-python-3.6.1/appveyor/install.ps1
--- old/yara-python-3.5.0/appveyor/install.ps1  1970-01-01 01:00:00.000000000 
+0100
+++ new/yara-python-3.6.1/appveyor/install.ps1  2017-06-06 00:49:35.000000000 
+0200
@@ -0,0 +1,229 @@
+# Sample script to install Python and pip under Windows
+# Authors: Olivier Grisel, Jonathan Helmus, Kyle Kastner, and Alex Willmer
+# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
+
+$MINICONDA_URL = "http://repo.continuum.io/miniconda/";
+$BASE_URL = "https://www.python.org/ftp/python/";
+$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py";
+$GET_PIP_PATH = "C:\get-pip.py"
+
+$PYTHON_PRERELEASE_REGEX = @"
+(?x)
+(?<major>\d+)
+\.
+(?<minor>\d+)
+\.
+(?<micro>\d+)
+(?<prerelease>[a-z]{1,2}\d+)
+"@
+
+
+function Download ($filename, $url) {
+    $webclient = New-Object System.Net.WebClient
+
+    $basedir = $pwd.Path + "\"
+    $filepath = $basedir + $filename
+    if (Test-Path $filename) {
+        Write-Host "Reusing" $filepath
+        return $filepath
+    }
+
+    # Download and retry up to 3 times in case of network transient errors.
+    Write-Host "Downloading" $filename "from" $url
+    $retry_attempts = 2
+    for ($i = 0; $i -lt $retry_attempts; $i++) {
+        try {
+            $webclient.DownloadFile($url, $filepath)
+            break
+        }
+        Catch [Exception]{
+            Start-Sleep 1
+        }
+    }
+    if (Test-Path $filepath) {
+        Write-Host "File saved at" $filepath
+    } else {
+        # Retry once to get the error message if any at the last try
+        $webclient.DownloadFile($url, $filepath)
+    }
+    return $filepath
+}
+
+
+function ParsePythonVersion ($python_version) {
+    if ($python_version -match $PYTHON_PRERELEASE_REGEX) {
+        return ([int]$matches.major, [int]$matches.minor, [int]$matches.micro,
+                $matches.prerelease)
+    }
+    $version_obj = [version]$python_version
+    return ($version_obj.major, $version_obj.minor, $version_obj.build, "")
+}
+
+
+function DownloadPython ($python_version, $platform_suffix) {
+    $major, $minor, $micro, $prerelease = ParsePythonVersion $python_version
+
+    if (($major -le 2 -and $micro -eq 0) `
+        -or ($major -eq 3 -and $minor -le 2 -and $micro -eq 0) `
+        ) {
+        $dir = "$major.$minor"
+        $python_version = "$major.$minor$prerelease"
+    } else {
+        $dir = "$major.$minor.$micro"
+    }
+
+    if ($prerelease) {
+        if (($major -le 2) `
+            -or ($major -eq 3 -and $minor -eq 1) `
+            -or ($major -eq 3 -and $minor -eq 2) `
+            -or ($major -eq 3 -and $minor -eq 3) `
+            ) {
+            $dir = "$dir/prev"
+        }
+    }
+
+    if (($major -le 2) -or ($major -le 3 -and $minor -le 4)) {
+        $ext = "msi"
+        if ($platform_suffix) {
+            $platform_suffix = ".$platform_suffix"
+        }
+    } else {
+        $ext = "exe"
+        if ($platform_suffix) {
+            $platform_suffix = "-$platform_suffix"
+        }
+    }
+
+    $filename = "python-$python_version$platform_suffix.$ext"
+    $url = "$BASE_URL$dir/$filename"
+    $filepath = Download $filename $url
+    return $filepath
+}
+
+
+function InstallPython ($python_version, $architecture, $python_home) {
+    Write-Host "Installing Python" $python_version "for" $architecture "bit 
architecture to" $python_home
+    if (Test-Path $python_home) {
+        Write-Host $python_home "already exists, skipping."
+        return $false
+    }
+    if ($architecture -eq "32") {
+        $platform_suffix = ""
+    } else {
+        $platform_suffix = "amd64"
+    }
+    $installer_path = DownloadPython $python_version $platform_suffix
+    $installer_ext = [System.IO.Path]::GetExtension($installer_path)
+    Write-Host "Installing $installer_path to $python_home"
+    $install_log = $python_home + ".log"
+    if ($installer_ext -eq '.msi') {
+        InstallPythonMSI $installer_path $python_home $install_log
+    } else {
+        InstallPythonEXE $installer_path $python_home $install_log
+    }
+    if (Test-Path $python_home) {
+        Write-Host "Python $python_version ($architecture) installation 
complete"
+    } else {
+        Write-Host "Failed to install Python in $python_home"
+        Get-Content -Path $install_log
+        Exit 1
+    }
+}
+
+
+function InstallPythonEXE ($exepath, $python_home, $install_log) {
+    $install_args = "/quiet InstallAllUsers=1 TargetDir=$python_home"
+    RunCommand $exepath $install_args
+}
+
+
+function InstallPythonMSI ($msipath, $python_home, $install_log) {
+    $install_args = "/qn /log $install_log /i $msipath TARGETDIR=$python_home"
+    $uninstall_args = "/qn /x $msipath"
+    RunCommand "msiexec.exe" $install_args
+    if (-not(Test-Path $python_home)) {
+        Write-Host "Python seems to be installed else-where, reinstalling."
+        RunCommand "msiexec.exe" $uninstall_args
+        RunCommand "msiexec.exe" $install_args
+    }
+}
+
+function RunCommand ($command, $command_args) {
+    Write-Host $command $command_args
+    Start-Process -FilePath $command -ArgumentList $command_args -Wait 
-Passthru
+}
+
+
+function InstallPip ($python_home) {
+    $pip_path = $python_home + "\Scripts\pip.exe"
+    $python_path = $python_home + "\python.exe"
+    if (-not(Test-Path $pip_path)) {
+        Write-Host "Installing pip..."
+        $webclient = New-Object System.Net.WebClient
+        $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
+        Write-Host "Executing:" $python_path $GET_PIP_PATH
+        & $python_path $GET_PIP_PATH
+    } else {
+        Write-Host "pip already installed."
+    }
+}
+
+
+function DownloadMiniconda ($python_version, $platform_suffix) {
+    if ($python_version -eq "3.4") {
+        $filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe"
+    } else {
+        $filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe"
+    }
+    $url = $MINICONDA_URL + $filename
+    $filepath = Download $filename $url
+    return $filepath
+}
+
+
+function InstallMiniconda ($python_version, $architecture, $python_home) {
+    Write-Host "Installing Python" $python_version "for" $architecture "bit 
architecture to" $python_home
+    if (Test-Path $python_home) {
+        Write-Host $python_home "already exists, skipping."
+        return $false
+    }
+    if ($architecture -eq "32") {
+        $platform_suffix = "x86"
+    } else {
+        $platform_suffix = "x86_64"
+    }
+    $filepath = DownloadMiniconda $python_version $platform_suffix
+    Write-Host "Installing" $filepath "to" $python_home
+    $install_log = $python_home + ".log"
+    $args = "/S /D=$python_home"
+    Write-Host $filepath $args
+    Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru
+    if (Test-Path $python_home) {
+        Write-Host "Python $python_version ($architecture) installation 
complete"
+    } else {
+        Write-Host "Failed to install Python in $python_home"
+        Get-Content -Path $install_log
+        Exit 1
+    }
+}
+
+
+function InstallMinicondaPip ($python_home) {
+    $pip_path = $python_home + "\Scripts\pip.exe"
+    $conda_path = $python_home + "\Scripts\conda.exe"
+    if (-not(Test-Path $pip_path)) {
+        Write-Host "Installing pip..."
+        $args = "install --yes pip"
+        Write-Host $conda_path $args
+        Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait 
-Passthru
+    } else {
+        Write-Host "pip already installed."
+    }
+}
+
+function main () {
+    InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
+    InstallPip $env:PYTHON
+}
+
+main
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/appveyor/run_with_env.cmd 
new/yara-python-3.6.1/appveyor/run_with_env.cmd
--- old/yara-python-3.5.0/appveyor/run_with_env.cmd     1970-01-01 
01:00:00.000000000 +0100
+++ new/yara-python-3.6.1/appveyor/run_with_env.cmd     2017-06-06 
00:49:35.000000000 +0200
@@ -0,0 +1,88 @@
+:: To build extensions for 64 bit Python 3, we need to configure environment
+:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
+::
+:: To build extensions for 64 bit Python 2, we need to configure environment
+:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
+::
+:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific
+:: environment configurations.
+::
+:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
+:: cmd interpreter, at least for (SDK v7.0)
+::
+:: More details at:
+:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
+:: http://stackoverflow.com/a/13751649/163740
+::
+:: Author: Olivier Grisel
+:: License: CC0 1.0 Universal: 
http://creativecommons.org/publicdomain/zero/1.0/
+::
+:: Notes about batch files for Python people:
+::
+:: Quotes in values are literally part of the values:
+::      SET FOO="bar"
+:: FOO is now five characters long: " b a r "
+:: If you don't want quotes, don't include them on the right-hand side.
+::
+:: The CALL lines at the end of this file look redundant, but if you move them
+:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
+:: case, I don't know why.
+@ECHO OFF
+
+SET COMMAND_TO_RUN=%*
+SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
+SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf
+
+:: Extract the major and minor versions, and allow for the minor version to be
+:: more than 9.  This requires the version number to have two dots in it.
+SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
+IF "%PYTHON_VERSION:~3,1%" == "." (
+    SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
+) ELSE (
+    SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
+)
+
+:: Based on the Python version, determine what SDK version to use, and whether
+:: to set the SDK for 64-bit.
+IF %MAJOR_PYTHON_VERSION% == 2 (
+    SET WINDOWS_SDK_VERSION="v7.0"
+    SET SET_SDK_64=Y
+) ELSE (
+    IF %MAJOR_PYTHON_VERSION% == 3 (
+        SET WINDOWS_SDK_VERSION="v7.1"
+        IF %MINOR_PYTHON_VERSION% LEQ 4 (
+            SET SET_SDK_64=Y
+        ) ELSE (
+            SET SET_SDK_64=N
+            IF EXIST "%WIN_WDK%" (
+                :: See: 
https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
+                REN "%WIN_WDK%" 0wdf
+            )
+        )
+    ) ELSE (
+        ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
+        EXIT 1
+    )
+)
+
+IF %PYTHON_ARCH% == 64 (
+    IF %SET_SDK_64% == Y (
+        ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python 
%MAJOR_PYTHON_VERSION% on a 64 bit architecture
+        SET DISTUTILS_USE_SDK=1
+        SET MSSdk=1
+        "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q 
-version:%WINDOWS_SDK_VERSION%
+        "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
+        ECHO Executing: %COMMAND_TO_RUN%
+        call %COMMAND_TO_RUN% || EXIT 1
+    ) ELSE (
+        ECHO Using default MSVC build environment for 64 bit architecture
+        ECHO Executing: %COMMAND_TO_RUN%
+        call %COMMAND_TO_RUN% || EXIT 1
+    )
+) ELSE (
+    ECHO Using default MSVC build environment for 32 bit architecture
+    ECHO Executing: %COMMAND_TO_RUN%
+    call %COMMAND_TO_RUN% || EXIT 1
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/appveyor/setup_x64.bat 
new/yara-python-3.6.1/appveyor/setup_x64.bat
--- old/yara-python-3.5.0/appveyor/setup_x64.bat        1970-01-01 
01:00:00.000000000 +0100
+++ new/yara-python-3.6.1/appveyor/setup_x64.bat        2017-06-06 
00:49:35.000000000 +0200
@@ -0,0 +1,14 @@
+regedit /s x64\VC_OBJECTS_PLATFORM_INFO.reg
+
+regedit /s x64\600dd186-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\600dd187-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\600dd188-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\600dd189-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\656d875f-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\656d8760-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\656d8763-2429-11d7-8bf6-00b0d03daa06.reg
+regedit /s x64\656d8766-2429-11d7-8bf6-00b0d03daa06.reg
+
+copy "C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\vcpackages\AMD64.VCPlatform.config" "C:\Program Files (x86)\Microsoft 
Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.Express.config"
+copy "C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\vcpackages\Itanium.VCPlatform.config" "C:\Program Files (x86)\Microsoft 
Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.Express.config"
+copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" 
"C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\bin\amd64\vcvarsamd64.bat"
Binary files 
old/yara-python-3.5.0/appveyor/x64/600dd186-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/600dd186-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/600dd187-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/600dd187-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/600dd188-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/600dd188-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/600dd189-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/600dd189-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/656d875f-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/656d875f-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/656d8760-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/656d8760-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/656d8763-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/656d8763-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files 
old/yara-python-3.5.0/appveyor/x64/656d8766-2429-11d7-8bf6-00b0d03daa06.reg and 
new/yara-python-3.6.1/appveyor/x64/656d8766-2429-11d7-8bf6-00b0d03daa06.reg 
differ
Binary files old/yara-python-3.5.0/appveyor/x64/VC_OBJECTS_PLATFORM_INFO.reg 
and new/yara-python-3.6.1/appveyor/x64/VC_OBJECTS_PLATFORM_INFO.reg differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/appveyor.yml 
new/yara-python-3.6.1/appveyor.yml
--- old/yara-python-3.5.0/appveyor.yml  1970-01-01 01:00:00.000000000 +0100
+++ new/yara-python-3.6.1/appveyor.yml  2017-06-06 00:49:35.000000000 +0200
@@ -0,0 +1,176 @@
+environment:
+  global:
+    # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
+    # /E:ON and /V:ON options are not enabled in the batch script intepreter
+    # See: http://stackoverflow.com/a/13751649/163740
+    CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
+    JANSSON_VERSION: "2.10"
+
+  matrix:
+
+    # Python versions not pre-installed
+
+    # Python 2.6.6 is the latest Python 2.6 with a Windows installer
+    # See: https://github.com/ogrisel/python-appveyor-demo/issues/10
+
+    - PYTHON: "C:\\Python266"
+      PYTHON_VERSION: "2.6.6"
+      PYTHON_ARCH: "32"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2008"
+      VS: "Visual Studio 9 2008"
+
+    - PYTHON: "C:\\Python266-x64"
+      PYTHON_VERSION: "2.6.6"
+      PYTHON_ARCH: "64"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2008"
+      VS: "Visual Studio 9 2008 Win64"
+
+    # Pre-installed Python versions, which Appveyor may upgrade to
+    # a later point release.
+    # See: http://www.appveyor.com/docs/installed-software#python
+
+    - PYTHON: "C:\\Python27"
+      PYTHON_VERSION: "2.7.x" # currently 2.7.13
+      PYTHON_ARCH: "32"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2008"
+      VS: "Visual Studio 9 2008"
+
+    - PYTHON: "C:\\Python27-x64"
+      PYTHON_VERSION: "2.7.x" # currently 2.7.13
+      PYTHON_ARCH: "64"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2008"
+      VS: "Visual Studio 9 2008 Win64"
+
+    - PYTHON: "C:\\Python33"
+      PYTHON_VERSION: "3.3.x" # currently 3.3.5
+      PYTHON_ARCH: "32"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2010"
+      VS: "Visual Studio 10 2010"
+
+    - PYTHON: "C:\\Python33-x64"
+      PYTHON_VERSION: "3.3.x" # currently 3.3.5
+      PYTHON_ARCH: "64"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2010"
+      VS: "Visual Studio 10 2010 Win64"
+
+    - PYTHON: "C:\\Python34"
+      PYTHON_VERSION: "3.4.x" # currently 3.4.4
+      PYTHON_ARCH: "32"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2010"
+      VS: "Visual Studio 10 2010"
+
+    - PYTHON: "C:\\Python34-x64"
+      PYTHON_VERSION: "3.4.x" # currently 3.4.4
+      PYTHON_ARCH: "64"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2010"
+      VS: "Visual Studio 10 2010 Win64"
+
+    - PYTHON: "C:\\Python35"
+      PYTHON_VERSION: "3.5.x" # currently 3.5.3
+      PYTHON_ARCH: "32"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2015"
+      VS: "Visual Studio 14 2015"
+
+    - PYTHON: "C:\\Python35-x64"
+      PYTHON_VERSION: "3.5.x" # currently 3.5.3
+      PYTHON_ARCH: "64"
+      OPENSSL_LIB: "openssl-1.1.0e-vs2015"
+      VS: "Visual Studio 14 2015 Win64"
+
+install:
+  # If there is a newer build queued for the same PR, cancel this one.
+  # The AppVeyor 'rollout builds' option is supposed to serve the same
+  # purpose but it is problematic because it tends to cancel builds pushed
+  # directly to master instead of just PR builds (or the converse).
+  # credits: JuliaLang developers.
+  - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER 
-ne ((Invoke-RestMethod `
+        
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
 | `
+        Where-Object pullRequestId -eq 
$env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
+          throw "There are newer queued builds for this pull request, failing 
early." }
+
+  # Install Python (from the official .msi of http://python.org) and pip when
+  # not already installed.
+  - ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 }
+
+  - "echo %APPVEYOR_BUILD_WORKER_IMAGE%"
+
+  # Prepend newly installed Python to the PATH of this build (this cannot be
+  # done from inside the powershell script as it would require to restart
+  # the parent CMD process).
+  - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
+
+  # Check that we have the expected version and architecture for Python
+  - "python --version"
+  - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
+
+  # Upgrade to the latest version of pip to avoid it displaying warnings
+  # about it being out of date.
+  - "pip install --disable-pip-version-check --user --upgrade pip"
+
+  # Install the build dependencies of the project. If some dependencies contain
+  # compiled extensions and are not provided as pre-built wheel packages,
+  # pip will build them from source using the MSVC compiler matching the
+  # target Python version and architecture
+  - "%CMD_IN_ENV% pip install wheel"
+
+  - cd ..
+  - ps: Invoke-WebRequest 
"https://www.npcglib.org/~stathis/downloads/$env:OPENSSL_LIB.7z"; -OutFile 
"openssl.7z"
+  - 7z x openssl.7z
+  - cd yara-python
+
+  - ps: >-
+      If ($env:PYTHON_ARCH -Match "32") {
+        $env:OPENSSL_LIB_DIR="lib"
+      } Else {
+        $env:OPENSSL_LIB_DIR="lib64"
+      }
+
+  # This is workaround for solving an issue caused by CMake not finding an
+  # appropriate compilet for Visual Studio 9 2008 Win64. This workaround was
+  # copied from: https://github.com/conda/conda-build/blob/master/appveyor.yml
+  - call appveyor\setup_x64.bat
+
+  # Download and build jansson library
+  - cd ..
+  - ps: Invoke-WebRequest 
"https://github.com/akheron/jansson/archive/v$env:JANSSON_VERSION.zip"; -OutFile 
"jansson.zip"
+  - ps: Expand-Archive jansson.zip -DestinationPath .
+  - cd jansson-%JANSSON_VERSION%
+  - md build
+  - cd build
+  - cmake -DJANSSON_BUILD_DOCS=OFF -DJANSSON_WITHOUT_TESTS=ON -G "%VS%" ..
+  - cmake --build . --config Release
+  - cd ../../yara-python
+
+
+clone_script:
+- cmd: git clone -q --recursive --branch=%APPVEYOR_REPO_BRANCH% 
https://github.com/%APPVEYOR_REPO_NAME%.git %APPVEYOR_BUILD_FOLDER%
+- cmd: git checkout -qf %APPVEYOR_REPO_COMMIT%
+
+build_script:
+  # Build the compiled extension
+  - "%CMD_IN_ENV% python setup.py build_ext --enable-cuckoo --enable-dotnet
+    
-L../jansson-%JANSSON_VERSION%/build/lib/Release;../%OPENSSL_LIB%/%OPENSSL_LIB_DIR%
+    -I../jansson-%JANSSON_VERSION%/build/include;../%OPENSSL_LIB%/include
+    -DHASH_MODULE -DHAVE_LIBCRYPTO
+    -llibcryptoMT"
+
+after_build:
+  - "%CMD_IN_ENV% python setup.py install"
+
+test_script:
+  # Run the project tests
+  - "%CMD_IN_ENV% python tests.py"
+
+after_test:
+  # If tests are successful, create binary packages for the project.
+  - "%CMD_IN_ENV% python setup.py bdist_wheel"
+  - "%CMD_IN_ENV% python setup.py bdist_wininst"
+  - "%CMD_IN_ENV% python setup.py bdist_msi"
+
+artifacts:
+  # Archive the generated packages in the ci.appveyor.com build report.
+  - path: dist\*
+
+#on_success:
+#  - TODO: upload the content of dist/*.whl to a public wheelhouse
+#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/config.h 
new/yara-python-3.6.1/config.h
--- old/yara-python-3.5.0/config.h      2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/config.h      1970-01-01 01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-/*
-  This a dummy file to satisfy some #include "config.h" directives while
-  building libyara.
-*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/setup.cfg 
new/yara-python-3.6.1/setup.cfg
--- old/yara-python-3.5.0/setup.cfg     2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/setup.cfg     2017-06-06 00:49:35.000000000 +0200
@@ -1,2 +1,6 @@
 [metadata]
-description-file = README.md
\ No newline at end of file
+description-file = README.md
+license_file = LICENSE
+
+[test]
+test_suite=tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/setup.py 
new/yara-python-3.6.1/setup.py
--- old/yara-python-3.5.0/setup.py      2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/setup.py      2017-06-06 00:49:35.000000000 +0200
@@ -15,7 +15,8 @@
 #
 
 from distutils.command.build import build
-from setuptools import setup, Extension
+from distutils.command.build_ext import build_ext
+from setuptools import setup, Command, Extension
 from codecs import open
 
 import distutils.errors
@@ -29,6 +30,23 @@
 import shutil
 import subprocess
 
+
+OPTIONS = [
+   ('dynamic-linking', None, 'link dynamically against libyara'),
+   ('enable-cuckoo', None, 'enable "cuckoo" module'),
+   ('enable-magic', None, 'enable "magic" module'),
+   ('enable-dotnet', None, 'enable "dotnet" module'),
+   ('enable-profiling', None, 'enable profiling features')]
+
+
+BOOLEAN_OPTIONS = [
+    'dynamic-linking',
+    'enable-cuckoo',
+    'enable-magic',
+    'enable-dotnet',
+    'enable-profiling']
+
+
 @contextlib.contextmanager
 def muted(*streams):
   """A context manager to redirect stdout and/or stderr to /dev/null.
@@ -68,30 +86,61 @@
 
 class BuildCommand(build):
 
-  user_options = build.user_options + [
-      ('dynamic-linking', None,'link dynamically against libyara'),
-      ('enable-cuckoo', None,'enable "cuckoo" module'),
-      ('enable-magic', None,'enable "magic" module'),
-      ('enable-profiling', None,'enable profiling features')]
-
-  boolean_options = build.boolean_options + [
-      'dynamic-linking', 'enable-cuckoo', 'enable-magic', 'enable-profiling']
+  user_options = build.user_options + OPTIONS
+  boolean_options = build.boolean_options + BOOLEAN_OPTIONS
 
   def initialize_options(self):
+
     build.initialize_options(self)
     self.dynamic_linking = None
     self.enable_magic = None
     self.enable_cuckoo = None
+    self.enable_dotnet = None
     self.enable_profiling = None
 
   def finalize_options(self):
+
     build.finalize_options(self)
+
+
+
+class BuildExtCommand(build_ext):
+
+  user_options = build_ext.user_options + OPTIONS
+  boolean_options = build_ext.boolean_options + BOOLEAN_OPTIONS
+
+  def initialize_options(self):
+
+    build_ext.initialize_options(self)
+    self.dynamic_linking = None
+    self.enable_magic = None
+    self.enable_cuckoo = None
+    self.enable_dotnet = None
+    self.enable_profiling = None
+
+  def finalize_options(self):
+
+    build_ext.finalize_options(self)
+
+    # If the build_ext command was invoked by the build command, take the
+    # values for these options from the build command.
+
+    self.set_undefined_options('build',
+        ('dynamic_linking', 'dynamic_linking'),
+        ('enable_magic', 'enable_magic'),
+        ('enable_cuckoo', 'enable_cuckoo'),
+        ('enable_dotnet', 'enable_dotnet'),
+        ('enable_profiling', 'enable_profiling'))
+
     if self.enable_magic and self.dynamic_linking:
       raise distutils.errors.DistutilsOptionError(
           '--enable-magic can''t be used with --dynamic-linking')
     if self.enable_cuckoo and self.dynamic_linking:
       raise distutils.errors.DistutilsOptionError(
           '--enable-cuckoo can''t be used with --dynamic-linking')
+    if self.enable_dotnet and self.dynamic_linking:
+      raise distutils.errors.DistutilsOptionError(
+          '--enable-dotnet can''t be used with --dynamic-linking')
 
   def run(self):
     """Execute the build command."""
@@ -102,25 +151,38 @@
     if base_dir:
       os.chdir(base_dir)
 
-    exclusions = ['yara/libyara/modules/pe_utils.c']
+    exclusions = []
+
+    for define in self.define or []:
+      module.define_macros.append(define)
+
+    for library in self.libraries or []:
+      module.libraries.append(library)
 
     if self.plat_name in ('win32','win-amd64'):
       building_for_windows = True
-      bits = '64' if self.plat_name == 'win-amd64' else '32'
-      module.define_macros.append(('_CRT_SECURE_NO_WARNINGS','1'))
-      module.include_dirs.append('yara/windows/include')
-      module.libraries.append('advapi32')
-      module.libraries.append('user32')
     else:
       building_for_windows = False
 
     if 'macosx' in self.plat_name:
       building_for_osx = True
-      module.include_dirs.append('/opt/local/include')
-      module.library_dirs.append('/opt/local/lib')
     else:
       building_for_osx = False
 
+    if building_for_windows:
+      module.define_macros.append(('_CRT_SECURE_NO_WARNINGS', '1'))
+      module.libraries.append('kernel32')
+      module.libraries.append('advapi32')
+      module.libraries.append('user32')
+      module.libraries.append('crypt32')
+      module.libraries.append('ws2_32')
+
+    if building_for_osx:
+      module.include_dirs.append('/opt/local/include')
+      module.library_dirs.append('/opt/local/lib')
+      module.include_dirs.append('/usr/local/include')
+      module.library_dirs.append('/usr/local/lib')
+
     if has_function('memmem'):
       module.define_macros.append(('HAVE_MEMMEM', '1'))
     if has_function('strlcpy'):
@@ -134,18 +196,13 @@
     if self.dynamic_linking:
       module.libraries.append('yara')
     else:
-      if building_for_windows:
-        module.library_dirs.append('yara/windows/lib')
-
-      if building_for_windows:
-        module.define_macros.append(('HASH_MODULE', '1'))
-        module.libraries.append('libeay%s' % bits)
-      elif (has_function('MD5_Init', libraries=['crypto']) and
-          has_function('SHA256_Init', libraries=['crypto'])):
-        module.define_macros.append(('HASH_MODULE', '1'))
-        module.libraries.append('crypto')
-      else:
-        exclusions.append('yara/libyara/modules/hash.c')
+      if not self.define or not ('HASH_MODULE', '1') in self.define:
+        if (has_function('MD5_Init', libraries=['crypto']) and
+            has_function('SHA256_Init', libraries=['crypto'])):
+          module.define_macros.append(('HASH_MODULE', '1'))
+          module.libraries.append('crypto')
+        else:
+          exclusions.append('yara/libyara/modules/hash.c')
 
       if self.enable_magic:
         module.define_macros.append(('MAGIC_MODULE', '1'))
@@ -154,13 +211,15 @@
 
       if self.enable_cuckoo:
         module.define_macros.append(('CUCKOO_MODULE', '1'))
-        if building_for_windows:
-          module.libraries.append('jansson%s' % bits)
-        else:
-          module.libraries.append('jansson')
+        module.libraries.append('jansson')
       else:
         exclusions.append('yara/libyara/modules/cuckoo.c')
 
+      if self.enable_dotnet:
+        module.define_macros.append(('DOTNET_MODULE', '1'))
+      else:
+        exclusions.append('yara/libyara/modules/dotnet.c')
+
       exclusions = [os.path.normpath(x) for x in exclusions]
 
       for directory, _, files in os.walk('yara/libyara/'):
@@ -169,7 +228,40 @@
           if x.endswith('.c') and x not in exclusions:
             module.sources.append(x)
 
-    build.run(self)
+    build_ext.run(self)
+
+
+class UpdateCommand(Command):
+  """Update libyara source.
+
+  This is normally only run by packagers to make a new release.
+  """
+  user_options = []
+
+  def initialize_options(self):
+    pass
+
+  def finalize_options(self):
+    pass
+
+  def run(self):
+    subprocess.check_call(['git', 'stash'], cwd='yara')
+
+    subprocess.check_call(['git', 'submodule', 'init'])
+    subprocess.check_call(['git', 'submodule', 'update'])
+
+    subprocess.check_call(['git', 'reset', '--hard'], cwd='yara')
+    subprocess.check_call(['git', 'clean', '-x', '-f', '-d'], cwd='yara')
+
+    subprocess.check_call(['git', 'checkout', 'master'], cwd='yara')
+    subprocess.check_call(['git', 'pull'], cwd='yara')
+    subprocess.check_call(['git', 'fetch', '--tags'], cwd='yara')
+
+    tag_name = 'tags/v%s' % self.distribution.metadata.version
+    subprocess.check_call(['git', 'checkout', tag_name], cwd='yara')
+
+    subprocess.check_call(['./bootstrap.sh'], cwd='yara')
+    subprocess.check_call(['./configure'], cwd='yara')
 
 
 with open('README.rst', 'r', 'utf-8') as f:
@@ -177,7 +269,7 @@
 
 setup(
     name='yara-python',
-    version='3.5.0',
+    version='3.6.1',
     description='Python interface for YARA',
     long_description=readme,
     license='Apache 2.0',
@@ -185,7 +277,10 @@
     author_email='[email protected];[email protected]',
     url='https://github.com/VirusTotal/yara-python',
     zip_safe=False,
-    cmdclass={'build': BuildCommand},
+    cmdclass={
+        'build': BuildCommand,
+        'build_ext': BuildExtCommand,
+        'update': UpdateCommand},
     ext_modules=[Extension(
         name='yara',
         include_dirs=['yara/libyara/include', 'yara/libyara/', '.'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/tests.py 
new/yara-python-3.6.1/tests.py
--- old/yara-python-3.5.0/tests.py      2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/tests.py      2017-06-06 00:49:35.000000000 +0200
@@ -837,10 +837,12 @@
         m = r.match(data="dummy")
 
         self.assertTrue(len(m) == 2)
-        self.assertTrue(m[0] < m[1])
-        self.assertTrue(m[0] != m[1])
-        self.assertFalse(m[0] > m[1])
-        self.assertFalse(m[0] == m[1])
+
+        if sys.version_info[0] < 3:
+          self.assertTrue(m[0] < m[1])
+          self.assertTrue(m[0] != m[1])
+          self.assertFalse(m[0] > m[1])
+          self.assertFalse(m[0] == m[1])
 
     def testComments(self):
 
@@ -927,8 +929,13 @@
 
         r1.match(data='', modules_callback=callback)
 
-        self.assertTrue(data['constants']['foo'] == 'foo')
-        self.assertTrue(data['constants']['empty'] == '')
+        if sys.version_info[0] >= 3:
+          self.assertTrue(data['constants']['foo'] == bytes('foo', 'utf-8'))
+          self.assertTrue(data['constants']['empty'] == bytes('', 'utf-8'))
+        else:
+          self.assertTrue(data['constants']['foo'] == 'foo')
+          self.assertTrue(data['constants']['empty'] == '')
+
         self.assertTrue(data['constants']['one'] == 1)
         self.assertTrue(data['constants']['two'] == 2)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yara-python-3.5.0/yara-python.c 
new/yara-python-3.6.1/yara-python.c
--- old/yara-python-3.5.0/yara-python.c 2016-08-03 13:33:12.000000000 +0200
+++ new/yara-python-3.6.1/yara-python.c 2017-06-06 00:49:35.000000000 +0200
@@ -409,7 +409,6 @@
 PyObject* convert_object_to_python(
     YR_OBJECT* object)
 {
-  SIZED_STRING* sized_string;
   PyObject* result = NULL;
 
   if (object == NULL)
@@ -418,41 +417,36 @@
   switch(object->type)
   {
     case OBJECT_TYPE_INTEGER:
-      if (((YR_OBJECT_INTEGER*) object)->value != UNDEFINED)
-        result = Py_BuildValue(
-            "i", ((YR_OBJECT_INTEGER*) object)->value);
+      if (object->value.i != UNDEFINED)
+        result = Py_BuildValue("i", object->value.i);
       break;
 
     case OBJECT_TYPE_STRING:
-      sized_string = ((YR_OBJECT_STRING*) object)->value;
-      if (sized_string != NULL)
+      if (object->value.ss != NULL)
         result = PyBytes_FromStringAndSize(
-            sized_string->c_string, sized_string->length);
+            object->value.ss->c_string, 
+            object->value.ss->length);
       break;
 
     case OBJECT_TYPE_STRUCTURE:
-      result = convert_structure_to_python((YR_OBJECT_STRUCTURE*) object);
+      result = convert_structure_to_python(object_as_structure(object));
       break;
 
     case OBJECT_TYPE_ARRAY:
-      result = convert_array_to_python((YR_OBJECT_ARRAY*) object);
+      result = convert_array_to_python(object_as_array(object));
       break;
 
     case OBJECT_TYPE_FUNCTION:
       // Do nothing with functions...
       break;
 
-    case OBJECT_TYPE_REGEXP:
-      // Fairly certain you can't have these. :)
-      break;
-
     case OBJECT_TYPE_DICTIONARY:
-      result = convert_dictionary_to_python((YR_OBJECT_DICTIONARY*) object);
+      result = convert_dictionary_to_python(object_as_dictionary(object));
       break;
 
     case OBJECT_TYPE_FLOAT:
-      if (!isnan(((YR_OBJECT_DOUBLE*) object)->value))
-        result = Py_BuildValue("d", ((YR_OBJECT_DOUBLE*) object)->value);
+      if (!isnan(object->value.d))
+        result = Py_BuildValue("d", object->value.d);
       break;
 
     default:
@@ -641,12 +635,12 @@
     gil_state = PyGILState_Ensure();
 
     module_info_dict = convert_structure_to_python(
-        (YR_OBJECT_STRUCTURE*) message_data);
+        object_as_structure(message_data));
 
     if (module_info_dict == NULL)
       return CALLBACK_CONTINUE;
 
-    object = PY_STRING(((YR_OBJECT_STRUCTURE*) message_data)->identifier);
+    object = PY_STRING(object_as_structure(message_data)->identifier);
     PyDict_SetItemString(module_info_dict, "module", object);
     Py_DECREF(object);
 
@@ -911,7 +905,7 @@
       return PyErr_Format(
         YaraError,
         "access denied");
-    case ERROR_INSUFICIENT_MEMORY:
+    case ERROR_INSUFFICIENT_MEMORY:
       return PyErr_NoMemory();
     case ERROR_COULD_NOT_OPEN_FILE:
       return PyErr_Format(
@@ -1650,7 +1644,8 @@
     else
       PyErr_Format(
           YaraSyntaxError,
-          "%s",
+          "line %d: %s",
+          line_number,
           message);
   }
 }
@@ -1675,7 +1670,8 @@
     else
       PyErr_Format(
           YaraSyntaxError,
-          "%s",
+          "line %d: %s",
+          line_number,
           message);
   }
   else
@@ -1690,7 +1686,8 @@
     else
       PyErr_Format(
           YaraWarningError,
-          "%s",
+          "line %d: %s",
+          line_number,
           message);
   }
 }
@@ -1829,9 +1826,16 @@
     else if (file != NULL)
     {
       fd = dup(PyObject_AsFileDescriptor(file));
-      fh = fdopen(fd, "r");
-      error = yr_compiler_add_file(compiler, fh, NULL, NULL);
-      fclose(fh);
+      if (fd != -1) {
+        fh = fdopen(fd, "r");
+        error = yr_compiler_add_file(compiler, fh, NULL, NULL);
+        fclose(fh);
+      }
+      else {
+        result = PyErr_Format(
+            PyExc_TypeError,
+            "'file' is not a file object");
+      }
     }
     else if (sources_dict != NULL)
     {
@@ -1945,7 +1949,7 @@
       }
       else
       {
-        result = handle_error(ERROR_INSUFICIENT_MEMORY, NULL);
+        result = handle_error(ERROR_INSUFFICIENT_MEMORY, NULL);
       }
     }
 


Reply via email to