Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Error running the build-s3-dist.sh #25

Closed
roboweaver opened this issue May 8, 2018 · 5 comments
Closed

Error running the build-s3-dist.sh #25

roboweaver opened this issue May 8, 2018 · 5 comments

Comments

@roboweaver
Copy link

Getting this error when trying to run the script to build out for some changes to the Lambda:

./build-s3-dist.sh wf-core-dev-templates
Staring to build distribution
export deployment_dir=/Users/robweaver/Projects/aws-transit-vpc/deployment
mkdir -p dist
cp -f *.template dist
Updating code source bucket in templates with wf-core-dev-templates
sed -i -e s/%%BUCKET_NAME%%/wf-core-dev-templates/g dist/transit-vpc-primary-account-existing-vpc.template
sed -i -e s/%%BUCKET_NAME%%/wf-core-dev-templates/g dist/transit-vpc-primary-account-marketplace.template
sed: dist/transit-vpc-primary-account-marketplace.template: No such file or directory
sed -i -e s/%%BUCKET_NAME%%/wf-core-dev-templates/g dist/transit-vpc-primary-account.template
sed -i -e s/%%BUCKET_NAME%%/wf-core-dev-templates/g dist/transit-vpc-second-account.template
Creating transit-vpc-poller ZIP file
Building transit-vpc-push-cisco-config ZIP file
/Users/robweaver/Projects/aws-transit-vpc/deployment/dist
virtualenv env
New python executable in /Users/robweaver/Projects/aws-transit-vpc/deployment/dist/env/bin/python
Installing setuptools, pip, wheel...done.
source env/bin/activate
pip install /Users/robweaver/Projects/aws-transit-vpc/deployment/../source/transit-vpc-push-cisco-config/. --target=/Users/robweaver/Projects/aws-transit-vpc/deployment/dist/env/lib/python2.7/site-packages/
Processing /Users/robweaver/Projects/aws-transit-vpc/source/transit-vpc-push-cisco-config
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/pr/59hffzcn3xn3rl2tv8tr27t00000gp/T/pip-req-build-If0il5/setup.py", line 4, in <module>
        from pip.req import parse_requirements
    ImportError: No module named req
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/pr/59hffzcn3xn3rl2tv8tr27t00000gp/T/pip-req-build-If0il5/
  adding: pip-10.0.1.dist-info/ (stored 0%)

Saw some references to this being a problem with pip version 10, so tried downgrading with no luck.

@roboweaver
Copy link
Author

Was able to get around the issue by patching the setup.py as:

diff --git a/source/transit-vpc-push-cisco-config/setup.py b/source/transit-vpc-push-cisco-config/setup.py
index ca311f2..5caf36b 100644
--- a/source/transit-vpc-push-cisco-config/setup.py
+++ b/source/transit-vpc-push-cisco-config/setup.py
@@ -1,7 +1,14 @@
 # coding: utf-8
 
 from setuptools import setup, find_packages
-from pip.req import parse_requirements
+
+def parse_requirements(filename):
+    """ load requirements from a pip requirements file """
+    lineiter = (line.strip() for line in open(filename))
+    return [line for line in lineiter if line and not line.startswith("#")]
+    
+    install_reqs = parse_requirements('requirements.txt')
+    reqs = install_reqs
 
 setup(
     name='transit_vpc_push_cisco_config',

@roboweaver
Copy link
Author

Let me know if you need me to create a pull request - I don't see anything on the repo about how to contribute, so maybe this project has gone stale?

@roboweaver
Copy link
Author

One more minor issue - the build script uses 'sed -i -e' which OSX version of sed doesn't understand. You can install gnu-sed to fix this (along with the above fix) and it builds fine brew install gnu-sed --with-default-names

@lucymhdavies
Copy link

I had the same issue.

In my case, my workaround was:

diff --git a/source/transit-vpc-push-cisco-config/setup.py b/source/transit-vpc-push-cisco-config/setup.py
index ca311f2..027ba5d 100644
--- a/source/transit-vpc-push-cisco-config/setup.py
+++ b/source/transit-vpc-push-cisco-config/setup.py
@@ -1,7 +1,7 @@
 # coding: utf-8

 from setuptools import setup, find_packages
-from pip.req import parse_requirements
+from pip._internal.req import parse_requirements

 setup(
     name='transit_vpc_push_cisco_config',

@shsenior
Copy link
Contributor

Updated with release 5.2.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants