1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_6 )
7 DISTUTILS_USE_SETUPTOOLS="rdepend"
11 DESCRIPTION="command line tool for interacting with cloud storage services"
12 HOMEPAGE="https://github.com/GoogleCloudPlatform/gsutil"
13 SRC_URI="http://commondatastorage.googleapis.com/pub/${PN}_${PV}.tar.gz"
17 KEYWORDS="~amd64 ~arm ~x86"
20 RDEPEND="${PYTHON_DEPS}
21 >=dev-python/argcomplete-1.9.4[${PYTHON_USEDEP}]
22 >=dev-python/boto-2.49.0[${PYTHON_USEDEP}]
23 >=dev-python/crcmod-1.7[${PYTHON_USEDEP}]
24 >=dev-python/fasteners-0.14.1[${PYTHON_USEDEP}]
25 >=dev-python/gcs-oauth2-boto-plugin-2.5[${PYTHON_USEDEP}]
26 >=dev-python/google-apitools-0.5.30[${PYTHON_USEDEP}]
27 >=dev-python/google-reauth-python-0.1.0[${PYTHON_USEDEP}]
28 >=dev-python/httplib2-0.11.3[${PYTHON_USEDEP}]
29 >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
30 >=dev-python/monotonic-1.4[${PYTHON_USEDEP}]
31 >=dev-python/oauth2client-4.1.3[${PYTHON_USEDEP}]
32 >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
33 >=dev-python/retry-decorator-1.0.0[${PYTHON_USEDEP}]
34 >=dev-python/six-1.12.0[${PYTHON_USEDEP}]
35 >=dev-python/PySocks-1.01[${PYTHON_USEDEP}]"
39 "${FILESDIR}/gsutil-4.41-tests.patch"
44 DOCS=( README.md CHANGES.md )
46 # needs to talk to Google to run tests
49 python_prepare_all() {
50 distutils-r1_python_prepare_all
52 # NB: We don't delete all of boto/ because the tests are imported by the
53 # production code. The same reason we can't delete gslib/tests/. We can
54 # delete the main boto library and use the system version though.
55 rm -r gslib/vendored/boto/boto || die
58 -e 's/mock==/mock>=/' \
59 -e 's/oauth2client==/oauth2client>=/' \
60 -e 's/SocksiPy-branch==/PySocks>=/' \
62 # Sanity check we didn't miss any updates.
63 grep '==' setup.py && die "Need to update version requirements"
65 # For debugging purposes, temporarily uncomment this in order to
66 # show hidden tracebacks.
67 #sed -e 's/^ except OSError as e:$/&\n raise/' \
68 # -e 's/def _HandleUnknownFailure(e):/&\n raise/' \
69 # -i gslib/__main__.py || die
71 # create_bucket raised ResponseNotReady
73 -e 's/test_cp_unwritable_tracker_file/_&/' \
74 -e 's/test_cp_unwritable_tracker_file_download/_&/' \
75 gslib/tests/test_cp.py || die
77 sed -i -E -e 's/(executable_prefix =).*/\1 [sys.executable]/' \
78 gslib/commands/test.py || die
80 # IOError: close() called during concurrent operation on the same file object.
81 sed -i -e 's/sys.stderr.close()/#&/' \
82 gslib/tests/testcase/unit_testcase.py || die
86 BOTO_CONFIG=${FILESDIR}/dummy.boto \
87 ${PYTHON} gslib/__main__.py test -u || die "tests failed"