Skip to content

Feature request: Add pydantic-settings to v3 Layer #5508

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

Closed
1 of 2 tasks
tkasuz opened this issue Nov 6, 2024 · 3 comments · Fixed by #5516
Closed
1 of 2 tasks

Feature request: Add pydantic-settings to v3 Layer #5508

tkasuz opened this issue Nov 6, 2024 · 3 comments · Fixed by #5516
Assignees
Labels
feature-request feature request layers Lambda Layers work

Comments

@tkasuz
Copy link
Contributor

tkasuz commented Nov 6, 2024

Use case

To facilitate migration from v2 to v3, it would be advantageous to include pydantic-settings as an optional dependency in the v3 layer. This is because v3 relies on Pydantic v2, necessitating the import of BaseSettings from pydantic-settings, which is currently absent from the v3 layer.

Solution/User Experience

Since this is not directly related to parser library, it would be better to included in the all option like the following:

[tool.poetry.extras]
parser = ["pydantic"]
validation = ["fastjsonschema"]
tracer = ["aws-xray-sdk"]
redis = ["redis"]
all = [
  "pydantic",
  "pydantic-settings",
  "aws-xray-sdk",
  "fastjsonschema",
  "aws-encryption-sdk",
  "jsonpath-ng"
]

Alternative solutions

No response

Acknowledgment

@tkasuz tkasuz added feature-request feature request triage Pending triage from maintainers labels Nov 6, 2024
Copy link

boring-cyborg bot commented Nov 6, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@leandrodamascena
Copy link
Contributor

Hi @tkasuz! Thanks for raising this issue! I agree with you that this might make the migration from Powertools v2 to v3 easier for those who are building Lambda exclusively with Powertools layers and not installing anything with pip. Even Pydantic v2 changed the way BaseSettings is imported and force you change your code, I think it might make life easier for those who are migrating. I don't think this is a big issue from a performance/size perspective, because both pydantic_settings and dotenv (transitive dependency) are less than 500kb.

(venv) ➜ du -sh venv/lib/python3.12/site-packages/*dotenv* 
116K	venv/lib/python3.12/site-packages/dotenv
 48K	venv/lib/python3.12/site-packages/python_dotenv-1.0.1.dist-info
(venv) ➜ du -sh venv/lib/python3.12/site-packages/pydantic_settings*
276K	venv/lib/python3.12/site-packages/pydantic_settings
 20K	venv/lib/python3.12/site-packages/pydantic_settings-2.6.1.dist-info
(venv) ➜  

Can you please send a PR to add this support?

@leandrodamascena leandrodamascena self-assigned this Nov 6, 2024
@leandrodamascena leandrodamascena added layers Lambda Layers work and removed triage Pending triage from maintainers labels Nov 6, 2024
@leandrodamascena leandrodamascena moved this from Triage to Pending customer in Powertools for AWS Lambda (Python) Nov 6, 2024
@leandrodamascena leandrodamascena linked a pull request Nov 7, 2024 that will close this issue
7 tasks
@github-project-automation github-project-automation bot moved this from Pending customer to Coming soon in Powertools for AWS Lambda (Python) Nov 7, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@leandrodamascena leandrodamascena moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request layers Lambda Layers work
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

2 participants