openapi-generator-cli 7.10.0__tar.gz → 7.10.0.post0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openapi-generator-cli
3
- Version: 7.10.0
3
+ Version: 7.10.0.post0
4
4
  Summary: CLI for openapi generator
5
5
  Home-page: https://openapi-generator.tech
6
6
  License: APACHE 2.0
7
- Keywords: opeapi,generator,cli
7
+ Keywords: openapi,generator,cli
8
8
  Author: OpenAPI Generator community
9
9
  Author-email: team@openapitools.org
10
10
  Requires-Python: >=3.9,<4
@@ -20,16 +20,22 @@ Classifier: Programming Language :: Python :: 3.13
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
+ Provides-Extra: jdk4py
24
+ Requires-Dist: jdk4py (>=21.0.4.1,<22.0.0.0) ; (python_version >= "3.10") and (extra == "jdk4py")
23
25
  Project-URL: Documentation, https://github.com/OpenAPITools/openapi-generator#3---usage
24
26
  Project-URL: Repository, https://github.com/OpenAPITools/openapi-generator
25
27
  Description-Content-Type: text/markdown
26
28
 
27
- # OpenApi Generator PIP Package Generator
29
+ # OpenAPI Generator in Package Installer for Python (PIP)
28
30
 
29
31
  [![Join the Slack chat room](
30
32
  <https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange>
31
33
  )](
32
34
  <https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g>
35
+ ) [![PyPI version](
36
+ <https://badge.fury.io/py/openapi-generator-cli.svg>
37
+ )](
38
+ <https://badge.fury.io/py/openapi-generator-cli>
33
39
  ) [![Code style: black](
34
40
  <https://img.shields.io/badge/code%20style-black-000000.svg>
35
41
  )](
@@ -60,6 +66,12 @@ pip install openapi-generator-cli
60
66
  pip install openapi-generator-cli==4.3.1
61
67
  ```
62
68
 
69
+ You can also install with [`jdk4py`] instead of `java` binary. (`python>=3.10` is required)
70
+
71
+ ```sh
72
+ pip install openapi-generator-cli[jdk4py]
73
+ ```
74
+
63
75
  After installation `openapi-generator-cli` command will be available in your virtual environment or globally depending on your installation.
64
76
 
65
77
  To check the version, for example. Type the following command
@@ -83,5 +95,6 @@ Please raise an issue, happy to hear from you :)
83
95
 
84
96
  [OpenAPITools/openapi-generator]: <https://github.com/OpenAPITools/openapi-generator>
85
97
  [maven repository]: <https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli>
98
+ [`jdk4py`]: <https://github.com/activeviam/jdk4py>
86
99
  [official openapi-generator docs]: <https://github.com/OpenAPITools/openapi-generator#3---usage>
87
100
 
@@ -1,9 +1,13 @@
1
- # OpenApi Generator PIP Package Generator
1
+ # OpenAPI Generator in Package Installer for Python (PIP)
2
2
 
3
3
  [![Join the Slack chat room](
4
4
  <https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange>
5
5
  )](
6
6
  <https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g>
7
+ ) [![PyPI version](
8
+ <https://badge.fury.io/py/openapi-generator-cli.svg>
9
+ )](
10
+ <https://badge.fury.io/py/openapi-generator-cli>
7
11
  ) [![Code style: black](
8
12
  <https://img.shields.io/badge/code%20style-black-000000.svg>
9
13
  )](
@@ -34,6 +38,12 @@ pip install openapi-generator-cli
34
38
  pip install openapi-generator-cli==4.3.1
35
39
  ```
36
40
 
41
+ You can also install with [`jdk4py`] instead of `java` binary. (`python>=3.10` is required)
42
+
43
+ ```sh
44
+ pip install openapi-generator-cli[jdk4py]
45
+ ```
46
+
37
47
  After installation `openapi-generator-cli` command will be available in your virtual environment or globally depending on your installation.
38
48
 
39
49
  To check the version, for example. Type the following command
@@ -57,4 +67,5 @@ Please raise an issue, happy to hear from you :)
57
67
 
58
68
  [OpenAPITools/openapi-generator]: <https://github.com/OpenAPITools/openapi-generator>
59
69
  [maven repository]: <https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli>
70
+ [`jdk4py`]: <https://github.com/activeviam/jdk4py>
60
71
  [official openapi-generator docs]: <https://github.com/OpenAPITools/openapi-generator#3---usage>
@@ -0,0 +1,66 @@
1
+ """A Python wrapper for the OpenAPI Generator CLI."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib.resources
6
+ import os
7
+ import shutil
8
+ import subprocess
9
+ import sys
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from pathlib import Path
14
+
15
+
16
+ def run(args: list[str] | None = None) -> subprocess.CompletedProcess[bytes]:
17
+ """Run the OpenAPI Generator CLI with the given arguments.
18
+
19
+ Args:
20
+ args (list[str], optional):
21
+ The list of arguments to pass to the Open
22
+ API Generator CLI. If not provided, the CLI will
23
+ be run without any arguments.
24
+
25
+ Returns:
26
+ subprocess.CompletedProcess[bytes]: The result of running the OpenAPI Generator CLI.
27
+
28
+ """
29
+ java_path: Path | str | None
30
+ try:
31
+ from jdk4py import JAVA
32
+
33
+ java_path = JAVA
34
+ except ImportError:
35
+ java_path = shutil.which("java")
36
+ if not java_path:
37
+ msg = "java runtime is not found in PATH"
38
+ raise RuntimeError(msg)
39
+
40
+ arguments = [java_path]
41
+
42
+ java_opts = os.getenv("JAVA_OPTS")
43
+ if java_opts:
44
+ arguments.append(java_opts)
45
+
46
+ arguments.append("-jar")
47
+
48
+ jar_path = importlib.resources.files("openapi_generator_cli") / "openapi-generator.jar"
49
+ arguments.append(str(jar_path))
50
+
51
+ if args and isinstance(args, list):
52
+ arguments.extend(args)
53
+
54
+ return subprocess.run(arguments, check=False) # noqa: S603
55
+
56
+
57
+ def cli() -> None:
58
+ """Run the OpenAPI Generator CLI with the arguments provided on the command line."""
59
+ args = []
60
+ if len(sys.argv) > 1:
61
+ args = sys.argv[1:]
62
+ run(args)
63
+
64
+
65
+ if __name__ == "__main__":
66
+ cli()
@@ -7,7 +7,7 @@ requires = [
7
7
  ]
8
8
 
9
9
  [tool.poetry]
10
- version = "7.10.0"
10
+ version = "7.10.0.post0"
11
11
  authors = [
12
12
  "OpenAPI Generator community <team@openapitools.org>",
13
13
  ]
@@ -21,7 +21,7 @@ classifiers = [
21
21
  ]
22
22
  description = "CLI for openapi generator"
23
23
  keywords = [
24
- "opeapi",
24
+ "openapi",
25
25
  "generator",
26
26
  "cli",
27
27
  ]
@@ -38,12 +38,17 @@ documentation = "https://github.com/OpenAPITools/openapi-generator#3---usage"
38
38
 
39
39
  [tool.poetry.dependencies]
40
40
  python = ">=3.9,<4"
41
+ jdk4py = { version = "^21.0.4.1", optional = true, python = ">=3.10" }
41
42
 
42
43
  [tool.poetry.group.dev.dependencies]
43
44
  mypy = ">=0.991,<1.14"
44
- pre-commit = ">=2.20,<4.0"
45
+ pre-commit = ">=2.20,<5.0"
45
46
  taskipy = "^1.10.3"
46
47
  pytest = ">=7.2.2,<9.0.0"
48
+ natsort = "^8.4.0"
49
+
50
+ [tool.poetry.extras]
51
+ jdk4py = [ "jdk4py" ]
47
52
 
48
53
  [tool.poetry.scripts]
49
54
  openapi-generator-cli = "openapi_generator_cli:cli"
@@ -61,11 +66,18 @@ lint.select = [
61
66
  "ALL",
62
67
  ]
63
68
  lint.ignore = [
64
- "D",
69
+ "D211", # No blank lines allowed before class docstring
70
+ "D213", # Multi-line docstring summary should start at the second line
65
71
  ]
66
72
  lint.per-file-ignores."publish.py" = [
73
+ "D",
74
+ "S603", # `subprocess` call: check for execution of untrusted input
67
75
  "T201", # `print` found
68
76
  ]
77
+ lint.per-file-ignores."tests/*" = [
78
+ "D",
79
+ "S101", # Use of `assert` detected
80
+ ]
69
81
 
70
82
  [tool.mypy]
71
83
  pretty = true
@@ -74,6 +86,9 @@ show_error_codes = true
74
86
  strict = true
75
87
 
76
88
  [tool.taskipy.tasks]
89
+ download-latest-jar = "DOWNLOAD_LATEST_ONLY=1 task publish"
77
90
  test = "pytest"
91
+ test-unpublished-versions = "DRYRUN=1 task publish"
78
92
  lint = "pre-commit run -a"
93
+ publish = "python publish.py"
79
94
  profile = "python -m cProfile"
@@ -1,35 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import importlib.resources
4
- import os
5
- import subprocess
6
- import sys
7
-
8
-
9
- def run(args: list[str] | None = None) -> None:
10
- arguments = ["java"]
11
-
12
- java_opts = os.getenv("JAVA_OPTS")
13
- if java_opts:
14
- arguments.append(java_opts)
15
-
16
- arguments.append("-jar")
17
-
18
- jar_path = importlib.resources.files("openapi_generator_cli") / "openapi-generator.jar"
19
- arguments.append(str(jar_path))
20
-
21
- if args and type(args) == list:
22
- arguments.extend(args)
23
-
24
- subprocess.call(arguments) # noqa: S603
25
-
26
-
27
- def cli() -> None:
28
- args = []
29
- if len(sys.argv) > 1:
30
- args = sys.argv[1:]
31
- run(args)
32
-
33
-
34
- if __name__ == "__main__":
35
- cli()