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

Integrate python SDK into main python project #4625

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

dgarros
Copy link
Collaborator

@dgarros dgarros commented Oct 14, 2024

Fixes #4234

This PR integrates the Python SDK directly into the main python project for Infrahub.
The end goal is to be able to publish infrahub-server to Pypi in order to use it to build integration tests for any projects depending on Infrahub.

Not sure what happened in CI but the changes in this PR highlighted some issues with how we are configuring poetry in our own runner.

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Oct 14, 2024
Copy link

codspeed-hq bot commented Oct 14, 2024

CodSpeed Performance Report

Merging #4625 will not alter performance

Comparing dga-20241014-fix-4234 (7598cd5) with develop (94b35cd)

Summary

✅ 10 untouched benchmarks

@github-actions github-actions bot added the group/ci Issue related to the CI pipeline label Oct 14, 2024
@dgarros dgarros marked this pull request as ready for review October 14, 2024 17:55
@dgarros dgarros requested review from a team and fatih-acar October 14, 2024 18:05
Copy link
Contributor

@ogenstad ogenstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I added some questions. Do you know about the name conflict thing? I think we said that we'd include the SDK using another name, but that's perhaps step two. It might not be a problem but my hunch is that it would be.


from pydantic import BaseModel, Field
from typing_extensions import Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes something that happened when the wrong Python version was running? It doesn't seem like something that would be required.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and No
it was uncovered because the tests did run with 3.10 instead of 3.12 but officially we should support 3.10 (pyproject.toml) so we shouldn't use a 3.11 feature.

optional = true
packages = [
{ include = "infrahub", from = "backend" },
{ include = "infrahub_sdk", from = "python_sdk" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering how this will behave on systems where where we want to install both the SDK and infrahub-server if one of them overwrites the other. It should mostly be relevant for testing purposes like when we want to install infrahub-server within the SDK repo during CI. I.e if the infrahub_sdk folder gets overwritten by the latest package of what happens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for now there will be a conflict but I think the risk is limited for now.
it will take a few more steps to fix that, I've opened a new PR earlier today in the SDK repo that will get us closer opsmill/infrahub-sdk-python#80

# locust = "^2.20.1"
# docker = "^7.0.0"
# matplotlib = "^3.8"
# pandas = "^2.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like it keep it for now because we need to fix the scale tests altogether

pyproject.toml Outdated Show resolved Hide resolved
@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Oct 15, 2024
@dgarros dgarros merged commit bbc7d6f into develop Oct 15, 2024
31 checks passed
@dgarros dgarros deleted the dga-20241014-fix-4234 branch October 15, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) group/ci Issue related to the CI pipeline type/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Embed the python SDK into infrahub with a different module name
3 participants