From e3761a30b31c2693fb92c66623719d462cc1a8e1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 14 Dec 2019 08:34:44 -0600 Subject: [PATCH] python 3 Signed-off-by: Sage Weil --- README.rst | 2 +- bootstrap | 12 ++++++------ requirements.txt | 1 + s3tests/analysis/rwstats.py | 2 +- s3tests/realistic.py | 2 +- s3tests_boto3/analysis/rwstats.py | 2 +- s3tests_boto3/functional/rgw_interactive.py | 2 +- s3tests_boto3/realistic.py | 2 +- setup.py | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index e9f7475..d510f2e 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ that exposes an S3-like API. The tests use the Boto2 and Boto3 libraries. The tests use the Nose test framework. To get started, ensure you have the ``virtualenv`` software installed; e.g. on Debian/Ubuntu:: - sudo apt-get install python-virtualenv + sudo apt-get install python3-virtualenv and then run:: diff --git a/bootstrap b/bootstrap index 64ec607..301dd17 100755 --- a/bootstrap +++ b/bootstrap @@ -2,7 +2,7 @@ set -e if [ -f /etc/debian_version ]; then - for package in python-pip python-virtualenv python-dev libevent-dev libffi-dev libxml2-dev libxslt-dev zlib1g-dev; do + for package in python3-pip python3-virtualenv python3-dev libevent-dev libffi-dev libxml2-dev libxslt-dev zlib1g-dev; do if [ "$(dpkg --status -- $package 2>/dev/null|sed -n 's/^Status: //p')" != "install ok installed" ]; then # add a space after old values missing="${missing:+$missing }$package" @@ -13,7 +13,7 @@ if [ -f /etc/debian_version ]; then sudo apt-get -y install $missing fi elif [ -f /etc/fedora-release ]; then - for package in python-pip python2-virtualenv python-devel libevent-devel libffi-devel libxml2-devel libxslt-devel zlib-devel; do + for package in python3-pip python3-virtualenv python3-devel libevent-devel libffi-devel libxml2-devel libxslt-devel zlib-devel; do if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then missing="${missing:+$missing }$package" fi @@ -23,7 +23,7 @@ elif [ -f /etc/fedora-release ]; then sudo yum -y install $missing fi elif [ -f /etc/redhat-release ]; then - for package in python-virtualenv python-devel libevent-devel libffi-devel libxml2-devel libxslt-devel zlib-devel; do + for package in python3-virtualenv python3-devel libevent-devel libffi-devel libxml2-devel libxslt-devel zlib-devel; do if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then missing="${missing:+$missing }$package" fi @@ -34,13 +34,13 @@ elif [ -f /etc/redhat-release ]; then fi fi -virtualenv --no-site-packages --distribute virtualenv +virtualenv --no-site-packages --distribute virtualenv -p /usr/bin/python3 # avoid pip bugs ./virtualenv/bin/pip install --upgrade pip # slightly old version of setuptools; newer fails w/ requests 0.14.0 -./virtualenv/bin/pip install setuptools==32.3.1 +#./virtualenv/bin/pip install setuptools==32.3.1 ./virtualenv/bin/pip install -r requirements.txt @@ -48,4 +48,4 @@ virtualenv --no-site-packages --distribute virtualenv # easy_install, and we really wanted pip; next line will fail if pip # requirements.txt does not match setup.py requirements -- sucky but # good enough for now -./virtualenv/bin/python setup.py develop +./virtualenv/bin/python3 setup.py develop diff --git a/requirements.txt b/requirements.txt index 52a78a3..2d95b42 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ PyYAML +setuptools nose >=1.0.0 boto >=2.6.0 boto3 >=1.0.0 diff --git a/s3tests/analysis/rwstats.py b/s3tests/analysis/rwstats.py index 7f21580..80b135e 100644 --- a/s3tests/analysis/rwstats.py +++ b/s3tests/analysis/rwstats.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys import os import yaml diff --git a/s3tests/realistic.py b/s3tests/realistic.py index f86ba4c..783a754 100644 --- a/s3tests/realistic.py +++ b/s3tests/realistic.py @@ -227,7 +227,7 @@ def files(mean, stddev, seed=None): re-download the object and place the contents into a file called ``foo``, the following should print two identical lines: - python -c 'import sys, hashlib; data=sys.stdin.read(); print hashlib.md5(data[:-16]).hexdigest(); print "".join("%02x" % ord(c) for c in data[-16:])'