diff --git a/auto_forensicate/auto_acquire.py b/auto_forensicate/auto_acquire.py index 8690145..7c7fef5 100644 --- a/auto_forensicate/auto_acquire.py +++ b/auto_forensicate/auto_acquire.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 Google LLC # diff --git a/requirements.txt b/requirements.txt index 85d7e66..ea4f670 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cachetools==3.1.1 boto==2.49.0 gcs-oauth2-boto-plugin -google-cloud-logging +google-cloud-logging<=2.1.1 google-cloud-storage mock progress diff --git a/setup.py b/setup.py index 9fc6ee4..1f993bb 100644 --- a/setup.py +++ b/setup.py @@ -14,10 +14,26 @@ # limitations under the License. """Installation and deployment script.""" -try: - from setuptools import find_packages, setup -except ImportError: - from distutils.core import find_packages, setup +import pkg_resources +from setuptools import find_packages +from setuptools import setup + + +def ParseRequirements(filename): + """Parse python requirements. + + Args: + filename (str): The requirement file to read. + Returns: + List[str]: a list of requirements. + """ + install_requires = [] + with open(filename) as requirements: + install_requires = [ + str(requirement) for requirement in + pkg_resources.parse_requirements(requirements)] + + return install_requires description = 'Forensics acquisition tool' @@ -28,21 +44,14 @@ setup( name='auto_forensicate', - version='20181010', + version='20210201', description=description, long_description=long_description, url='https://github.com/google/giftstick', author='giftstick development team', license='Apache License, Version 2.0', packages=find_packages(), - install_requires=[ - 'cachetools==3.1.1', # Because 4.0 breaks on Py2 installs - 'progress', - 'boto==2.49.0', - 'gcs_oauth2_boto_plugin', - 'google-cloud-storage', - 'google-cloud-logging' - ], + install_requires=ParseRequirements('requirements.txt'), classifiers=[ 'Development Status :: 4 - Beta', 'Operating System :: OS Independent', diff --git a/tools/remaster.sh b/tools/remaster.sh index daa68ec..c73272e 100644 --- a/tools/remaster.sh +++ b/tools/remaster.sh @@ -343,8 +343,8 @@ function parse_arguments { assert_bucket_name assert_sa_name fi + assert_sourceiso_flag if [[ "${FLAGS_SKIP_ISO_REMASTER}" == "false" ]]; then - assert_sourceiso_flag readonly UBUNTU_ISO=$(readlink -m "${FLAGS_SOURCE_ISO}") if [[ ! "${FLAGS_REMASTERED_ISO}" ]] ; then diff --git a/tools/remaster_scripts/call_auto_forensicate.sh b/tools/remaster_scripts/call_auto_forensicate.sh index 62fead9..cd91782 100644 --- a/tools/remaster_scripts/call_auto_forensicate.sh +++ b/tools/remaster_scripts/call_auto_forensicate.sh @@ -34,7 +34,7 @@ sudo pip3 install grpcio # Make sure have the latest version of the auto_forensicate module git clone https://github.com/google/GiftStick cd GiftStick -sudo python setup.py install +sudo pip install . # Apply patch for boto py3 compatibility # See https://github.com/boto/boto/pull/3699