<commit_before>#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Requirements
# - Ruby 2.x
#   - Plus gem dependencies, see c_glib/README
# - Maven >= 3.3.9
# - JDK >=7
# - gcc >= 4.8
# - nodejs >= 6.0.0 (best way is to use nvm)
#
# If using a non-system Boost, set BOOST_ROOT and add Boost libraries to
# LD_LIBRARY_PATH

case $# in
  2) VERSION="$1"
     RC_NUMBER="$2"
     ;;

  *) echo "Usage: $0 X.Y.Z RC_NUMBER"
     exit 1
     ;;
esac

set -ex

HERE=$(cd `dirname "${BASH_SOURCE[0]:-$0}"` && pwd)

ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/arrow'

download_dist_file() {
  curl -f -O $ARROW_DIST_URL/$1
}

download_rc_file() {
  download_dist_file apache-arrow-${VERSION}-rc${RC_NUMBER}/$1
}

import_gpg_keys() {
  download_dist_file KEYS
  gpg --import KEYS
}

fetch_archive() {
  local dist_name=$1
  download_rc_file ${dist_name}.tar.gz
  download_rc_file ${dist_name}.tar.gz.asc
  download_rc_file ${dist_name}.tar.gz.sha1
  download_rc_file ${dist_name}.tar.gz.sha512
  gpg --verify ${dist_name}.tar.gz.asc ${dist_name}.tar.gz
  if [ "$(uname)" == "Darwin" ]; then
    shasum -a 1 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha1
    shasum -a 512 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512
  else
    sha1sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha1
    sha512sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512
  fi
}

setup_tempdir() {
  cleanup() {
    rm -fr "$TMPDIR"
  }
  trap cleanup EXIT
  TMPDIR=$(mktemp -d -t "$1.XXXXX")
}


setup_miniconda() {
  # Setup short-lived miniconda for Python and integration tests
  if [ "$(uname)" == "Darwin" ]; then
    MINICONDA_URL=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
  else
    MINICONDA_URL=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
  fi

  MINICONDA=`pwd`/test-miniconda

  wget -O miniconda.sh $MINICONDA_URL
  bash miniconda.sh -b -p $MINICONDA
  rm -f miniconda.sh

  export PATH=$MINICONDA/bin:$PATH

  conda create -n arrow-test -y -q python=3.6 \
        nomkl numpy pandas six cython
  source activate arrow-test
}

# Build and test C++

test_and_install_cpp() {
  mkdir cpp/build
  pushd cpp/build

  cmake -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
        -DARROW_PLASMA=on \
        -DARROW_PYTHON=on \
        -DARROW_BOOST_USE_SHARED=on \
        -DCMAKE_BUILD_TYPE=release \
        -DARROW_BUILD_BENCHMARKS=on \
        ..

  make -j$NPROC
  make install

  ctest -L unittest
  popd
}

# Build and install Parquet master so we can test the Python bindings

install_parquet_cpp() {
  git clone <EMAIL>:apache/parquet-cpp.git

  mkdir parquet-cpp/build
  pushd parquet-cpp/build

  cmake -DCMAKE_INSTALL_PREFIX=$PARQUET_HOME \
        -DCMAKE_BUILD_TYPE=release \
        -DPARQUET_BOOST_USE_SHARED=on \
        -DPARQUET_BUILD_TESTS=off \
        ..

  make -j$NPROC
  make install

  popd
}<commit_msg>[Python] Pin Cython to 0.27.3 in verify-release-candidate.sh (#1758)<commit_after>#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# Requirements
# - Ruby 2.x
#   - Plus gem dependencies, see c_glib/README
# - Maven >= 3.3.9
# - JDK >=7
# - gcc >= 4.8
# - nodejs >= 6.0.0 (best way is to use nvm)
#
# If using a non-system Boost, set BOOST_ROOT and add Boost libraries to
# LD_LIBRARY_PATH

case $# in
  2) VERSION="$1"
     RC_NUMBER="$2"
     ;;

  *) echo "Usage: $0 X.Y.Z RC_NUMBER"
     exit 1
     ;;
esac

set -ex

HERE=$(cd `dirname "${BASH_SOURCE[0]:-$0}"` && pwd)

ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/arrow'

download_dist_file() {
  curl -f -O $ARROW_DIST_URL/$1
}

download_rc_file() {
  download_dist_file apache-arrow-${VERSION}-rc${RC_NUMBER}/$1
}

import_gpg_keys() {
  download_dist_file KEYS
  gpg --import KEYS
}

fetch_archive() {
  local dist_name=$1
  download_rc_file ${dist_name}.tar.gz
  download_rc_file ${dist_name}.tar.gz.asc
  download_rc_file ${dist_name}.tar.gz.sha1
  download_rc_file ${dist_name}.tar.gz.sha512
  gpg --verify ${dist_name}.tar.gz.asc ${dist_name}.tar.gz
  if [ "$(uname)" == "Darwin" ]; then
    shasum -a 1 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha1
    shasum -a 512 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512
  else
    sha1sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha1
    sha512sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512
  fi
}

setup_tempdir() {
  cleanup() {
    rm -fr "$TMPDIR"
  }
  trap cleanup EXIT
  TMPDIR=$(mktemp -d -t "$1.XXXXX")
}


setup_miniconda() {
  # Setup short-lived miniconda for Python and integration tests
  if [ "$(uname)" == "Darwin" ]; then
    MINICONDA_URL=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
  else
    MINICONDA_URL=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
  fi

  MINICONDA=`pwd`/test-miniconda

  wget -O miniconda.sh $MINICONDA_URL
  bash miniconda.sh -b -p $MINICONDA
  rm -f miniconda.sh

  export PATH=$MINICONDA/bin:$PATH

  conda create -n arrow-test -y -q python=3.6 \
        nomkl \
        numpy \
        pandas \
        six \
        cython=0.27.3
  source activate arrow-test
}

# Build and test C++

test_and_install_cpp() {
  mkdir cpp/build
  pushd cpp/build

  cmake -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
        -DARROW_PLASMA=on \
        -DARROW_PYTHON=on \
        -DARROW_BOOST_USE_SHARED=on \
        -DCMAKE_BUILD_TYPE=release \
        -DARROW_BUILD_BENCHMARKS=on \
        ..

  make -j$NPROC
  make install

  ctest -VV -L unittest
  popd
}

# Build and install Parquet master so we can test the Python bindings

install_parquet_cpp() {
  git clone <EMAIL>:apache/parquet-cpp.git

  mkdir parquet-cpp/build
  pushd parquet-cpp/build

  cmake -DCMAKE_INSTALL_PREFIX=$PARQUET_HOME \
        -DCMAKE_BUILD_TYPE=release \
        -DPARQUET_BOOST_USE_SHARED=on \
        -DPARQUET_BUILD_TESTS=off \
        ..

  make -j$NPROC
  make install

  popd
}
{'fraction_non_alphanumeric': 0.1206383554233162, 'fraction_numerical': 0.017040843927508792, 'mean_word_length': 3.170896785109983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6330854', 'n_tokens_mistral': 2849, 'n_tokens_neox': 2700, 'n_words': 680}