From 7e63248fb60b52ee04c241bf95697b9178075ec7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= <edgarrm358@gmail.com>
Date: Thu, 2 May 2024 22:40:38 -0600
Subject: [PATCH] chore: Use Poetry support for PEP 621

---
 .github/workflows/constraints.txt |  2 +-
 .pre-commit-config.yaml           |  8 +++----
 poetry.lock                       |  4 ++--
 pyproject.toml                    | 40 ++++++++++++++++++++-----------
 4 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt
index 52415d85bd..ace6032e2d 100644
--- a/.github/workflows/constraints.txt
+++ b/.github/workflows/constraints.txt
@@ -1,6 +1,6 @@
 griffe==1.2.0
 pip==24.2
-poetry==1.8.3
+poetry @ git+https://github.com/radoering/poetry.git@pep621-support
 poetry-plugin-export==1.8.0
 poetry-dynamic-versioning==1.4.0
 pre-commit==3.8.0
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 587f7a2138..8bc101a556 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -64,7 +64,7 @@ repos:
         cookiecutter/.*
       )$
 
-- repo: https://github.com/python-poetry/poetry
-  rev: 1.8.0
-  hooks:
-  - id: poetry-check
+# - repo: https://github.com/python-poetry/poetry
+#   rev: 1.8.0
+#   hooks:
+#   - id: poetry-check
diff --git a/poetry.lock b/poetry.lock
index e80a8ace3b..f7b51c42d1 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.9.0.dev0 and should not be changed by hand.
 
 [[package]]
 name = "alabaster"
@@ -2592,4 +2592,4 @@ testing = ["pytest"]
 [metadata]
 lock-version = "2.0"
 python-versions = ">=3.8"
-content-hash = "cdb61b3c2edc05495046425e778c37240b7035bbed822153ec4d5c38c8e54d57"
+content-hash = "ead41599babcc5434451f88a773a0ebf73ea372bfe0a430f21b0b40767889275"
diff --git a/pyproject.toml b/pyproject.toml
index b79ae36159..85822121bd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,13 +1,12 @@
-[tool.poetry]
+[project]
 name = "singer-sdk"
-version = "0.0.0"
+dynamic = [
+    "dependencies",
+    "version",
+]
 description = "A framework for building Singer taps"
-authors = ["Meltano Team and Contributors <hello@meltano.com>"]
-maintainers = ["Meltano Team and Contributors <hello@meltano.com>"]
-readme = "README.md"
-homepage = "https://sdk.meltano.com/en/latest/"
-repository = "https://github.com/meltano/sdk"
-documentation = "https://sdk.meltano.com/en/latest/"
+authors = [{ name = "Meltano Team and Contributors", email = "hello@meltano.com" }]
+maintainers = [{ name = "Meltano Team and Contributors", email = "hello@meltano.com" }]
 keywords = [
     "Meltano",
     "Singer",
@@ -28,15 +27,26 @@ classifiers = [
     "Topic :: Software Development :: Libraries :: Application Frameworks",
     "Typing :: Typed",
 ]
-license = "Apache-2.0"
+readme = "README.md"
+license.file = "LICENSE"
+requires-python = ">=3.8"
 
-[tool.poetry.urls]
+[project.urls]
+Homepage = "https://sdk.meltano.com/en/latest/"
+Repository = "https://github.com/meltano/sdk"
+Documentation = "https://sdk.meltano.com/en/latest/"
 "Issue Tracker" = "https://github.com/meltano/sdk/issues"
 "Twitter" = "https://twitter.com/meltanodata/"
 "Changelog" = "https://github.com/meltano/sdk/blob/main/CHANGELOG.md"
 "Slack" = "https://meltano.com/slack"
 "Youtube" = "https://www.youtube.com/meltano"
 
+[tool.poetry]
+# TODO: remove this duplicate name when nox-poetry supports PEP 621
+# https://github.com/cjolowicz/nox-poetry/pull/1223
+name = "singer-sdk"
+version = "0.0.0"
+
 [tool.poetry.dependencies]
 python = ">=3.8"
 backoff = { version = ">=2.0.0", python = "<4" }
@@ -279,13 +289,16 @@ enable = true
 style = "pep440"
 
 [build-system]
-requires = ["poetry-core==1.9.0", "poetry-dynamic-versioning==1.4.0"]
+requires = [
+    "poetry-core@ git+https://github.com/radoering/poetry-core.git@main",
+    "poetry-dynamic-versioning==1.4.0",
+]
 build-backend = "poetry_dynamic_versioning.backend"
 
-[tool.poetry.plugins."pytest11"]
+[project.entry-points."pytest11"]
 singer_testing = "singer_sdk.testing.pytest_plugin"
 
-[tool.poetry.plugins."singer_sdk.batch_encoders"]
+[project.entry-points."singer_sdk.batch_encoders"]
 jsonl = "singer_sdk.contrib.batch_encoder_jsonl:JSONLinesBatcher"
 parquet = "singer_sdk.contrib.batch_encoder_parquet:ParquetBatcher"
 
@@ -296,7 +309,6 @@ extend-exclude = [
 ]
 line-length = 88
 src = ["samples", "singer_sdk", "tests"]
-target-version = "py38"
 
 [tool.ruff.format]
 docstring-code-format = true