Skip to content

Commit

Permalink
Install module with pip instead of setup.py (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgayon authored Feb 8, 2021
1 parent 269a67e commit 5585aad
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions auto_forensicate/auto_acquire.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 Google LLC
#
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 22 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tools/remaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/remaster_scripts/call_auto_forensicate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5585aad

Please sign in to comment.