brysontyrrell / Possum

A packaging tool for Python based AWS serverless applications.
MIT License
21 stars 2 forks source link

Creating Fresh Pipenv Generates Error For Missing Site Packages #23

Open mam8cc opened 5 years ago

mam8cc commented 5 years ago

Given the following file structure, where my two functions are defined in app.py and their dependencies are declared in Pipfile:

$ tree tweetframe 
tweetframe
├── README.md
├── deploy.yml
├── hello_world
│   ├── Pipfile
│   ├── Pipfile.lock
│   ├── __init__.py
│   ├── __pycache__
│   │   ├── __init__.cpython-37.pyc
│   │   └── app.cpython-37.pyc
│   └── app.py
└── template.yaml

When trying to generate a clean venv for the deploy:

$ PIPENV_IGNORE_VIRTUALENVS=1 possum -c 'my-deploy-bucket' -o deploy.yml

The following functions will be packaged and deployed:
  - HelloWorldFunction
  - AlertGetterFunction

The following swagger files will be deployed:

Build directory: /var/folders/y0/2w_x37191zn7tnl1jkht0c4c0000gn/T/possum-_hzr78x_-build

HelloWorldFunction: Working dir: /var/folders/y0/2w_x37191zn7tnl1jkht0c4c0000gn/T/possum-_hzr78x_-build/HelloWorldFunction
HelloWorldFunction: Creating virtual environment...
HelloWorldFunction: Virtual environment created at /Users/mikemcclannahan/Envs/HelloWorldFunction-SDXPSn-6
Traceback (most recent call last):
  File "/Users/myuser/Envs/tweetframe-zeEN213U/bin/possum", line 15, in <module>
    main()
  File "/Users/myuser/Envs/tweetframe-zeEN213U/lib/python3.6/site-packages/possum/__init__.py", line 594, in main
    do_not_copy = get_existing_site_packages(venv_path)
  File "/Users/myuser/Envs/tweetframe-zeEN213U/lib/python3.6/site-packages/possum/__init__.py", line 260, in get_existing_site_packages
    return os.listdir(path)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/myuser/Envs/HelloWorldFunction-SDXPSn-6/lib/python3.6/site-packages'

I've attempted to run the above build within the venv and outside of it and the error is the same.