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

source-google-sheets: use poetry for dependency management #34944

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Feb 7, 2024

What

Closes #34954

We want to make our connectors use poetry for dependency management (see tech spec)

This PR is migrating source-google-sheets, a certified connector, to poetry.
The changes were generated by a new airbyte-ci command I'm currently working on (PR to come).
The idea is to get early feedback and address problems on the migration flow if any.

How

  • Create pyproject.toml and poetry.lock
  • Pin main dependencies to the version used in the previous connector version
  • Delete setup.py
  • Update connector README.md with new instructions

🚨 User Impact 🚨

please note that, unlike setup.py based packages, packages managed with poetry must declare the version of python with which they are compatible. I picked ^3.9 which means the connector can work on Python 3.9 or higher (3.10).
It's a requirement to work with airbyte-lib as:

  • airbyte-lib python dependency is also ^3.9, which means airbyte-lib is not forcing users to use an old python version in their environment.

Our base image is still based on Python 3.9.18 which means the released connector will still used a consistent python version.

Copy link

vercel bot commented Feb 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 9:04am

Copy link
Contributor Author

alafanechere commented Feb 7, 2024

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Feb 7, 2024
Copy link
Contributor

github-actions bot commented Feb 7, 2024

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from 1c5ffcd to fef6a42 Compare February 7, 2024 09:53
@alafanechere alafanechere changed the base branch from master to augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install February 7, 2024 09:53
@alafanechere alafanechere force-pushed the augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install branch from f81e501 to 8e7457f Compare February 7, 2024 09:54
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from fef6a42 to f562554 Compare February 7, 2024 09:54
@alafanechere alafanechere force-pushed the augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install branch from 8e7457f to 8a0003a Compare February 7, 2024 10:03
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from f562554 to 390d9d3 Compare February 7, 2024 10:03
@alafanechere alafanechere marked this pull request as ready for review February 7, 2024 10:08
@alafanechere alafanechere requested review from flash1293 and a team February 7, 2024 10:08
@octavia-squidington-iv octavia-squidington-iv requested a review from a team February 7, 2024 10:09
@alafanechere alafanechere force-pushed the augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install branch from 8a0003a to 7dd4717 Compare February 7, 2024 10:16
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from 390d9d3 to 574b6a3 Compare February 7, 2024 10:16
@alafanechere alafanechere force-pushed the augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install branch from 7dd4717 to 8a909b1 Compare February 7, 2024 10:17
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from 574b6a3 to 9abc45c Compare February 7, 2024 10:17
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from 9abc45c to 65dfb08 Compare February 7, 2024 10:31
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

LGTM from the airbyte-lib side - validated locally and it works as expected

@alafanechere alafanechere force-pushed the augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install branch from 8a909b1 to 1b1e55b Compare February 7, 2024 16:36
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from 65dfb08 to e52fc7b Compare February 7, 2024 16:36
Copy link
Contributor

@girarda girarda left a comment

Choose a reason for hiding this comment

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

docs changes look good to me, but I haven't tested the new commands ✅

Copy link
Contributor

@natikgadzhi natikgadzhi left a comment

Choose a reason for hiding this comment

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

I like this!

Re: python version — I remember @girarda mentioned that someone reported a bug in the CDK when running a newer Python, and I'm very curious to look at what an upgrade to 3.12 could give us.

This would not be an urgent project, but I would like the cleaner typing syntax, and the performance improvements — and would love to see how much of performance gains we can get overall when the CDK and all connectors and our tools switch.

Another prereq for this might be to start testing connectors with Pythons matrix from 3.9 to 3.12.

@@ -1,67 +1,91 @@
# Pypi Source
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, the previous version here weirds me out. Was it just a completely wrong doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it was ...


[tool.poetry.dependencies]
python = "^3.9"
requests = "==2.31.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why hard pin? I get it if we're just moving from setup.py as it was, but figured in theory we want to unpin most dependencies to major get at least patch / minor version upgrades for free?

Copy link
Contributor

Choose a reason for hiding this comment

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

My take is that Poetry.lock gives us the deterministic build, but the actual dependency list should be as flexible as possible. If it was previously hard-pinned in setup.py, it might be because we were trying to do the lock thing with the deps list. I would try and err on the side of unpinning.

Perhaps, though, this should be another step after this all is done. For example, note that the CDK is pinned. I don't think we should unpin it right now, that might cause issues ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@natikgadzhi the idea there is to force this new connector version to have the same dependency version as the previous one. Even if the previous version was not pinning a version I want to pin main deps in this newest version to guarantee no regression.
These pins can be relaxed without issues in upcoming PRs if needed.

@alafanechere alafanechere force-pushed the augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install branch from 1b1e55b to 05c08a5 Compare February 8, 2024 08:33
Base automatically changed from augustin/02-07-airbyte-ci_only_install_main_dependencies_when_calling_poetry_install to master February 8, 2024 08:55
@alafanechere alafanechere force-pushed the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch from e52fc7b to 76acaef Compare February 8, 2024 08:59
@alafanechere alafanechere enabled auto-merge (squash) February 8, 2024 09:00
@alafanechere alafanechere merged commit 0a1cd31 into master Feb 8, 2024
25 of 26 checks passed
@alafanechere alafanechere deleted the augustin/02-07-source-google-sheets_use_poetry_for_dependency_management branch February 8, 2024 09:08
alafanechere added a commit that referenced this pull request Feb 8, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 21, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/google-sheets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate one certified python source to Poetry
6 participants