terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
886 stars 656 forks source link

feat: Allow defining direct path to pyproject.toml #525

Closed n8felton closed 5 months ago

n8felton commented 6 months ago

Description

This change allows you to define the location of a pyproject.toml file, rather than relying on the discovery of the file in a given directory.

Example 1

  source_path = [
    "src",
    "pyproject.toml"
  ]

Example 2

  source_path = [
    "src",
    {
      path = "pyproject.toml",
      poetry_install = true
    }
  ]

Motivation and Context

Previously, discovery and execution of poetry related commands required discovery of the pyproject.toml, poetry.lock, and poetry.toml in a given directory, which required the entire directory to be included in the resulting Zip file, which is not always desired. This PR allows you to define the direct path to the pyproject.toml without needing to rely on it being discovered.

Addition context in #524

Breaking Changes

In my testing, this does not cause any breaking changes with existing poetry deployments.

How Has This Been Tested?

I have also validated these changes against the existing package_dir_poetry module.

Fixes #524

mar-pan commented 5 months ago

Hello module devs. Can we have this reviewed and merged? I'm facing issue which this one will solve

antonbabenko commented 5 months ago

@pdecat Could you please take a look at this one?

pdecat commented 5 months ago

Hi, I left some comments in the issue. Right now, I believe changes should not be needed to make this work.

n8felton commented 5 months ago

🎉

Thank you for working through this PR with me, I appreciate the timely back and forth to get things answered and resolved. 🙇

@antonbabenko - I believe this is ready for your review.

antonbabenko commented 5 months ago

This PR is included in version 6.8.0 :tada:

antonbabenko commented 5 months ago

Awesome! Thanks to both of you for the cooperation & review!

github-actions[bot] commented 4 months ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.