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

fix: Use uv in tap, target and mapper templates #2859

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

edgarrmondragon
Copy link
Collaborator

@edgarrmondragon edgarrmondragon commented Jan 31, 2025

Related

Summary by Sourcery

Build:

  • Update the build system to use hatchling instead of poetry.

📚 Documentation preview 📚: https://meltano-sdk--2859.org.readthedocs.build/en/2859/

Summary by Sourcery

Switch from Poetry to Hatchling for project management and builds.

Build:

  • Update the build system to use hatchling instead of poetry.

CI:

  • Update the CI workflow to use uv instead of poetry and add twine for checking distribution builds.

Documentation:

  • Update the documentation to reflect the change in build system and package manager.

Tests:

  • Update the test suite to use uv run instead of poetry run.

@edgarrmondragon edgarrmondragon self-assigned this Jan 31, 2025
Copy link
Contributor

sourcery-ai bot commented Jan 31, 2025

Reviewer's Guide by Sourcery

This pull request migrates the cookiecutter templates to use uv instead of poetry for dependency management and build tooling. This includes changes to the pyproject.toml files, the github workflows, the README files, the pre-commit configuration, and the noxfile.

Flow diagram: Updated development workflow with UV

flowchart TD
    start["Start Development"]
    install["Install UV"]
    sync["uv sync"]
    test["uv run pytest"]
    build["uv build"]
    check["twine check dist/*"]

    start --> install
    install --> sync
    sync --> test
    test --> build
    build --> check
Loading

File-Level Changes

Change Details Files
Replaced poetry with uv for dependency management and build tooling.
  • Updated pyproject.toml to use hatchling as the build backend instead of poetry.
  • Modified pyproject.toml to declare dependencies using the dependencies key instead of tool.poetry.dependencies.
  • Modified pyproject.toml to declare optional dependencies using project.optional-dependencies instead of tool.poetry.extras.
  • Modified pyproject.toml to declare scripts using project.scripts instead of tool.poetry.scripts.
  • Modified pyproject.toml to declare dev dependencies using dependency-groups instead of tool.poetry.group.dev.dependencies.
  • Removed poetry installation from the cookiecutter-e2e.yml workflow.
  • Added twine installation to the cookiecutter-e2e.yml workflow.
  • Updated the test_cookiecutter function in noxfile.py to use uv instead of poetry.
  • Updated requirements.txt to remove poetry and add twine.
cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml
cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml
cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/pyproject.toml
.github/workflows/cookiecutter-e2e.yml
noxfile.py
.github/workflows/resources/requirements.txt
Updated documentation and development instructions to use uv.
  • Updated the README files to use uv sync instead of poetry install.
  • Updated the README files to use uv run pytest instead of poetry run pytest.
  • Updated the README files to use uv run <cli> instead of poetry run <cli>.
  • Added a prerequisites section to the README files to include uv.
cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/README.md
cookiecutter/tap-template/{{cookiecutter.tap_id}}/README.md
cookiecutter/target-template/{{cookiecutter.target_id}}/README.md
Updated pre-commit configuration to include uv hooks.
  • Added uv-lock and uv-sync hooks to the pre-commit configuration.
  • Added uv-lock to the skip list in the pre-commit configuration.
cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.pre-commit-config.yaml
cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml
cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml
Updated github workflows to remove poetry lock files.
  • Removed poetry.lock from the list of files that trigger the test workflow.
  • Added uv.lock to the list of files that trigger the test workflow.
cookiecutter/mapper-template/{{cookiecutter.mapper_id}}/.github/workflows/test.yml
cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/test.yml
cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/test.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#2689 Switch templates over to uv for dependency and package management
#2689 Update build system from Poetry to a more flexible approach
#2689 Prepare templates for easier transition between dependency management tools

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.34%. Comparing base (6dc84d6) to head (7bbd2d9).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2859   +/-   ##
=======================================
  Coverage   91.34%   91.34%           
=======================================
  Files          62       62           
  Lines        5209     5209           
  Branches      673      673           
=======================================
  Hits         4758     4758           
  Misses        319      319           
  Partials      132      132           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented Jan 31, 2025

CodSpeed Performance Report

Merging #2859 will not alter performance

Comparing edgarrmondragon/fix/templates-uv (7bbd2d9) with main (6dc84d6)

Summary

✅ 7 untouched benchmarks

@edgarrmondragon edgarrmondragon force-pushed the edgarrmondragon/fix/templates-uv branch 2 times, most recently from a8145cd to 40fda8e Compare January 31, 2025 15:49
@edgarrmondragon edgarrmondragon force-pushed the edgarrmondragon/fix/templates-uv branch from 40fda8e to 7bbd2d9 Compare January 31, 2025 16:27
@edgarrmondragon edgarrmondragon marked this pull request as ready for review January 31, 2025 16:39
@edgarrmondragon edgarrmondragon requested a review from a team as a code owner January 31, 2025 16:39
@edgarrmondragon edgarrmondragon merged commit 8e297df into main Jan 31, 2025
36 checks passed
@edgarrmondragon edgarrmondragon deleted the edgarrmondragon/fix/templates-uv branch January 31, 2025 16:39
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @edgarrmondragon - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@edgarrmondragon edgarrmondragon restored the edgarrmondragon/fix/templates-uv branch January 31, 2025 16:40
@edgarrmondragon edgarrmondragon added the Cookiecutter Tap, target and mapper templates label Jan 31, 2025
github-merge-queue bot pushed a commit to meltano/meltano that referenced this pull request Feb 1, 2025
<!--

Please, go through these steps when you submit a PR.

1. Make sure your branch is not protected. In particular, avoid making
PRs from the `main` branch of your fork.

2. Give a descriptive title to your PR. We use semantic titles, and the
accepted types and scopes are listed in
https://github.com/meltano/meltano/blob/main/.github/semantic.yml.

   A good title should look like this:

   ```
feat(cli): The `meltano run` command now accepts a `--timeout` option to
limit the time it runs
   ```

3. Provide a description of your changes.

4. Put "Closes #XXXX" in your comment to auto-close the issue that your
PR fixes (if such).

-->

## Description

<!-- Describe the changes introduced by this PR -->

The SDK templates now use uv.

-
https://deploy-preview-9069--meltano.netlify.app/guide/debugging-custom-extractor
-
https://deploy-preview-9069--meltano.netlify.app/tutorials/custom-extractor/

## Related Issues

* meltano/sdk#2859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cookiecutter Tap, target and mapper templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Switch templates over to uv
1 participant