Skip to content

Conversation

@MonkeyCanCode
Copy link
Contributor

Per discussion in https://lists.apache.org/thread/2hlh3rvmgo7ol3qn08xmyf85grck2p35, team preferred uv over poetry. Couple major changes with this PR:

  1. Switched from poetry to uv
  2. Installed uv in virtualenv instead of system level to avoid potential conflict and keep system clean
  3. Used hatch instead of poetry-core/setuptool for build management
  4. Used hatch hook for openapi code generator

For the next PR, we can do more cleanup to remove unnecessary code/scripts around virtualenv management and let uv handles those natively if preferred. Currently, it is backward compatible as existed one in term of how to invoke the CLI and run docker-compose.

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

generally lgtm, i would double check the build artifacts to make sure that its the same as packaged previously using poetry. That tripped us up during the pyiceberg migration

# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
Copy link
Contributor

Choose a reason for hiding this comment

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

unintentional?

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like it just removes a duplicate header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intensional. This file has slightly diff license header (extra space after hashtag) compared to the rest of the python files.

@MonkeyCanCode
Copy link
Contributor Author

generally lgtm, i would double check the build artifacts to make sure that its the same as packaged previously using poetry. That tripped us up during the pyiceberg migration

Yes, I did that earlier. Most of them are same except wheel one doesn't have the root level init.py (which is fine). One thing caught me earlier was spec as that got excluded from hatch build due to we have spec in gitignore.

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

LGTM, but please wait for more reviews from people who deal with our python CLI more regularly than me :)

Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Thanks for migrating this! I believe this could also make the release process easier in the future.

One thing I noticed was that the spark getting-started example now miss the ipynb in jupyter lab:

Image

But this may not be relevant to this PR.

requires = ["poetry-core==2.2.1", "openapi-generator-cli==7.12.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling", "openapi-generator-cli==7.12.0"]
build-backend = "hatchling.build"
Copy link
Contributor

Choose a reason for hiding this comment

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

This solves the problem with poetry.core.masonry.api that we cannot build universal wheel if using custom build script. I checked that now with make client-build, we will get

Successfully built dist/apache_polaris-1.4.0.tar.gz
Successfully built dist/apache_polaris-1.4.0-py3-none-any.whl

This could significantly simplify the nightly build/release process that we do not need the additional wheel build workflow anymore: #3036

Comment on lines -23 to -24
# This file, if checked in after running for example regtests, contains unmanaged dependencies that eventually
# cause unnecessary "security alerts" like https://github.com/apache/polaris/pull/718.
Copy link
Contributor

Choose a reason for hiding this comment

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

[Question] Should we keep this comment since it explains why we exclude `*.lock" file from git? To be honest, I also wondered for a while why poetry.lock was excluded intially.

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.

4 participants