Skip to content

feat: poetry builder #5734

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

Merged
merged 9 commits into from
Apr 25, 2025
Merged

feat: poetry builder #5734

merged 9 commits into from
Apr 25, 2025

Conversation

caarlos0
Copy link
Member

this adds Poetry support to goreleaser.

the implementation is very similar to that of uv.

@caarlos0 caarlos0 added the enhancement New feature or request label Apr 24, 2025
@caarlos0 caarlos0 requested a review from Copilot April 24, 2025 02:07
@caarlos0 caarlos0 self-assigned this Apr 24, 2025
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 24, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Poetry support to GoReleaser by introducing new configuration files, updating documentation, and integrating a Poetry build process similar to the UV builder.

  • Added comprehensive documentation for Poetry builds.
  • Introduced new static config files and associated tests for Poetry.
  • Updated the initialization and language detection logic to support Poetry.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
www/docs/customization/builds/uv.md Minor documentation update for UV builds.
www/docs/customization/builds/poetry.md Added documentation for Poetry builds with examples and options.
internal/static/config.poetry.yaml New static configuration file for Poetry builds.
internal/static/config.go Added embedding for the new Poetry configuration.
internal/pyproject/pyproject_test.go Removed an assertion related to Python version requirements.
internal/pyproject/pyproject.go Extended the PyProject struct and methods to support Poetry.
internal/builders/poetry/*.go & tests Implemented the Poetry builder with tests for both wheel and sdist.
cmd/init.go Integrated Poetry support into the init command and language detection.
cmd/init_test.go Added tests to verify language detection and config generation for Poetry.

Copy link

cloudflare-workers-and-pages bot commented Apr 24, 2025

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: be5f3f6
Status: ✅  Deploy successful!
Preview URL: https://5482bc10.goreleaser.pages.dev
Branch Preview URL: https://poetry.goreleaser.pages.dev

View logs

@caarlos0 caarlos0 requested a review from Copilot April 24, 2025 02:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Poetry support to GoReleaser by introducing a new poetry builder, configuration, documentation, and tests. Key changes include the addition of a new documentation file and configuration file for Poetry, implementation of a Poetry builder with associated tests, and updates to language detection and initialization logic to recognize Poetry projects.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
www/docs/customization/builds/uv.md Updated clarification text in UV documentation.
www/docs/customization/builds/poetry.md New documentation detailing the Poetry build support and configuration options.
internal/static/config.poetry.yaml Added configuration file with defaults for Poetry builds.
internal/static/config.go Exposed PoetryExampleConfig for use during initialization.
internal/pyproject/pyproject_test.go Added tests for poetry detection and project naming.
internal/pyproject/pyproject.go Updated pyproject structure and added IsPoetry and Name methods.
internal/builders/poetry/* New poetry builder implementation and its tests.
cmd/init.go and cmd/init_test.go Updated language detection and init command to support Poetry alongside UV.
Comments suppressed due to low confidence (2)

cmd/init.go:162

  • [nitpick] Consider defining a constant for the filename "pyproject.toml" to improve maintainability and avoid repetition.
file = "pyproject.toml"

internal/pyproject/pyproject_test.go:14

  • [nitpick] A comment clarifying that the test expects a non-Poetry pyproject.toml (i.e. one without [tool.poetry]) would help future readers understand the intent.
require.False(t, proj.IsPoetry())

@caarlos0 caarlos0 changed the title feat(build): poetry support feat: poetry builder4 Apr 24, 2025
@caarlos0 caarlos0 changed the title feat: poetry builder4 feat: poetry builder Apr 24, 2025
@caarlos0 caarlos0 requested a review from Copilot April 24, 2025 02:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for building Python projects using Poetry, mirroring the functionality previously available for uv. Key changes include:

  • Updated documentation with a new builds/poetry.md file and adjustments in uv.md.
  • New configuration files and embedded examples for Poetry (config.poetry.yaml and PoetryExampleConfig).
  • Implementation changes and tests in the pyproject and builders packages, as well as language detection updates in the init commands.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
www/docs/customization/builds/uv.md Removed duplicated text regarding checksumming.
www/docs/customization/builds/poetry.md Added comprehensive documentation and configuration examples for the poetry builder.
internal/static/config.poetry.yaml Provides default configuration for poetry builds.
internal/static/config.go Embedded Poetry config example file along with uv and rust configs.
internal/pyproject/* Introduced IsPoetry() and Name() methods, and added tests for poetry detection.
internal/builders/uv/build.go Updated artifact naming by using the new Name() method from pyproject package.
internal/builders/poetry/* New builder implementation and tests for supporting Poetry builds.
cmd/init*.go Updated language detection and init logic to support poetry as a language option.

@caarlos0 caarlos0 requested a review from Copilot April 24, 2025 02:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Poetry builder support to goreleaser by introducing new documentation, configuration files, tests, and builder implementation.

  • Updated documentation and index files to include Poetry support.
  • Added new configuration examples and tests for the Poetry builder.
  • Implemented the Poetry builder in the codebase and updated project initialization logic to detect Poetry projects.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
www/docs/customization/builds/uv.md Cleaned up documentation text.
www/docs/customization/builds/poetry.md Added comprehensive documentation for Poetry builds.
www/docs/customization/builds/index.md Updated build index to include new UV and Poetry entries.
internal/static/config.poetry.yaml New configuration file example for Poetry builder.
internal/static/config.go Embedded the new Poetry configuration.
internal/pyproject/pyproject.go Extended pyproject parsing for Poetry with added IsPoetry and Name methods.
internal/builders/uv/build.go Updated artifact naming to call the new Name() method from the pyproject.
internal/builders/poetry/* Added Poetry-specific builder implementation, tests, and testdata configuration.
cmd/init_test.go Added tests to verify proper detection and initialization for Poetry projects.
cmd/init.go Updated project initialization to detect Poetry projects and to generate the correct config.
Comments suppressed due to low confidence (1)

cmd/init.go:143

  • The language flag completions do not include the new 'uv' and 'poetry' options. Please update the completions list to include these values to ensure users can select them via auto-completion.
[]string{"go", "bun", "deno", "rust", "zig"}

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 79.19463% with 31 lines in your changes missing coverage. Please review.

Project coverage is 82.92%. Comparing base (4ccdef5) to head (be5f3f6).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
internal/builders/poetry/build.go 76.33% 23 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5734      +/-   ##
==========================================
- Coverage   82.94%   82.92%   -0.03%     
==========================================
  Files         160      161       +1     
  Lines       15775    15916     +141     
==========================================
+ Hits        13085    13198     +113     
- Misses       2124     2144      +20     
- Partials      566      574       +8     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caarlos0 caarlos0 merged commit bff6510 into main Apr 25, 2025
17 of 19 checks passed
@caarlos0 caarlos0 deleted the poetry branch April 25, 2025 22:36
@caarlos0 caarlos0 mentioned this pull request Apr 30, 2025
24 tasks
caarlos0 pushed a commit that referenced this pull request Aug 14, 2025
I was about to prepare and send you PRs for Python support… then I
noticed you already added it:
- #5652
- #5734

This PR updates your docs | site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant