Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support pipenv users whose Pipfile is not in servicePath (serverless.yml location) #858

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alanmun
Copy link

@alanmun alanmun commented Mar 13, 2025

if you have a project hierarchy like:

root/
└── src/
    ├── **/*.py
    ├── test/*.py
    └── serverless.yml
├── .env
├── Pipfile.lock
├── Pipfile
├── README.md
├── mypy.ini
└── pyproject.toml

And run sls deploy in the same dir as the serverless.yml like:

~/MyCode/root/src$ pipenv run sls deploy

Currently this plugin silently fails to detect your Pipfile. This PR adds code to bubble up until either your operating system's root dir is reached or Pipfile is found. This matches with pipenv's behavior, which is to support executing pipenv commands such as pipenv run , pipenv shell, and pipenv requirements in any subdirectory of a directory containing your Pipfile/the directory where you created your virtualenv.

With this code change, my project hierarchy which looks like the above now successfully packages my serverless project with all of the pipenv generated requirements.

Resolves #857

@alanmun alanmun changed the title Support pipenv users whose Pipfile is not in servicePath (serverless.yml location) feat: Support pipenv users whose Pipfile is not in servicePath (serverless.yml location) Mar 17, 2025
@alanmun
Copy link
Author

alanmun commented Mar 20, 2025

@Mmarzex Hi sorry to be a bother but any chance this could get looked at? My company would appreciate the functionality :)

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

Successfully merging this pull request may close these issues.

No requirements are generated when using pipenv while Pipfile and lock are in root dir
1 participant