Skip to content

Update poetry to 2.0 #24

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 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -27,6 +27,10 @@ repos:
rev: v2.5.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/python-poetry/poetry
rev: 2.0.0
hooks:
- id: poetry-check
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
33 changes: 30 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion publish.py
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ def get_published_vesions() -> set[str]:

def update_package_version(version: str) -> None:
updated_toml = re.sub(
r'(?<=\[tool.poetry\]\nversion = ")[^"]+(?=")',
r'(?<=name = "openapi-generator-cli"\nversion = ")[^"]+(?=")',
version,
Path("pyproject.toml").open("r").read(), # noqa: SIM115
count=1,
56 changes: 30 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,51 @@
# TODO: In Poetry 2.0 move into PEP 621 compatible configuration

[build-system]
build-backend = "poetry.core.masonry.api"
requires = [
"poetry-core",
"poetry-core>=2",
]

[tool.poetry]
[project]
name = "openapi-generator-cli"
version = "0"
description = "CLI for openapi generator"
readme = "README.md"
keywords = [
"cli",
"generator",
"openapi",
]
license = { text = "APACHE 2.0" }
authors = [
"OpenAPI Generator community <team@openapitools.org>",
{ name = "OpenAPI Generator community", email = "team@openapitools.org" },
]
requires-python = ">=3.9,<4"
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Typing :: Typed",
]
description = "CLI for openapi generator"
keywords = [
"openapi",
"generator",
"cli",
optional-dependencies.jdk4py = [
"jdk4py>=21.0.4.1,<22; python_version>='3.10'",
]
name = "openapi-generator-cli"
urls.Documentation = "https://github.com/OpenAPITools/openapi-generator#3---usage"
urls.Homepage = "https://openapi-generator.tech"
urls.Repository = "https://github.com/OpenAPITools/openapi-generator"
scripts.openapi-generator-cli = "openapi_generator_cli:cli"

[tool.poetry]
requires-poetry = ">=2.0"
packages = [
{ include = "openapi_generator_cli" },
]
include = [ "openapi_generator_cli/*.jar" ]
license = "APACHE 2.0"
readme = "README.md"
homepage = "https://openapi-generator.tech"
repository = "https://github.com/OpenAPITools/openapi-generator"
documentation = "https://github.com/OpenAPITools/openapi-generator#3---usage"

[tool.poetry.dependencies]
python = ">=3.9,<4"
jdk4py = { version = "^21.0.4.1", optional = true, python = ">=3.10" }

[tool.poetry.group.dev.dependencies]
mypy = ">=0.991,<1.15"
@@ -47,11 +54,8 @@ taskipy = "^1.10.3"
pytest = ">=7.2.2,<9.0.0"
natsort = "^8.4.0"

[tool.poetry.extras]
jdk4py = [ "jdk4py" ]

[tool.poetry.scripts]
openapi-generator-cli = "openapi_generator_cli:cli"
[tool.poetry.requires-plugins]
poetry-plugin-shell = ">=1.0"

[tool.black]
line-length = 120
Loading