pact-python-cli 2.5.7.0__tar.gz → 2.6.0.0__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.
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/.gitignore +0 -1
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/PKG-INFO +1 -1
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/hatch_build.py +103 -9
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/pact_cli/__init__.py +39 -28
- pact_python_cli-2.6.0.0/pact_cli/__version__.py +10 -0
- pact_python_cli-2.6.0.0/pyproject.toml +155 -0
- pact_python_cli-2.5.7.0/pact_cli/__version__.py +0 -6
- pact_python_cli-2.5.7.0/pyproject.toml +0 -202
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/LICENSE +0 -0
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/README.md +0 -0
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/pact_cli/.gitkeep +0 -0
- {pact_python_cli-2.5.7.0 → pact_python_cli-2.6.0.0}/pact_cli/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pact-python-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.6.0.0
|
|
4
4
|
Summary: Pact CLI bundle for Python
|
|
5
5
|
Project-URL: Bug Tracker, https://github.com/pact-foundation/pact-python/issues
|
|
6
6
|
Project-URL: Changelog, https://github.com/pact-foundation/pact-python/blob/main/pact-python-cli/CHANGELOG.md
|
|
@@ -24,8 +24,15 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
|
24
24
|
from packaging.tags import sys_tags
|
|
25
25
|
|
|
26
26
|
PKG_DIR = Path(__file__).parent.resolve() / "src" / "pact_cli"
|
|
27
|
+
|
|
28
|
+
# Remove when pact-standalone is removed
|
|
27
29
|
PACT_CLI_URL = "https://github.com/pact-foundation/pact-standalone/releases/download/v{version}/pact-{version}-{os}-{machine}.{ext}"
|
|
28
30
|
|
|
31
|
+
# Remove fixed version and infer from package metadata when pact-cli versioning
|
|
32
|
+
# is adopted.
|
|
33
|
+
PACT_RUST_CLI_VERSION = "0.9.5"
|
|
34
|
+
PACT_RUST_CLI_URL = "https://github.com/pact-foundation/pact-cli/releases/download/v{version}/pact-{arch}-{os}{ext}"
|
|
35
|
+
|
|
29
36
|
|
|
30
37
|
class UnsupportedPlatformError(RuntimeError):
|
|
31
38
|
"""
|
|
@@ -83,6 +90,7 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
83
90
|
passed to `hatch build`.
|
|
84
91
|
"""
|
|
85
92
|
for subdir in ["bin", "lib", "data"]:
|
|
93
|
+
# TODO(epoch-transition): Remove "lib" when standalone dropped # noqa: TD003
|
|
86
94
|
shutil.rmtree(PKG_DIR / subdir, ignore_errors=True)
|
|
87
95
|
|
|
88
96
|
def initialize(
|
|
@@ -116,12 +124,24 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
116
124
|
raise ValueError(msg)
|
|
117
125
|
|
|
118
126
|
try:
|
|
119
|
-
|
|
127
|
+
force_include = self._install_ruby_cli(cli_version)
|
|
128
|
+
except UnsupportedPlatformError as err:
|
|
129
|
+
# The Ruby standalone is deprecated and not available on all
|
|
130
|
+
# platforms (e.g. Windows ARM). Warn and continue rather than
|
|
131
|
+
# failing the build.
|
|
132
|
+
self.app.display_warning(
|
|
133
|
+
f"Pact Ruby standalone CLI not available for {err.platform}; skipping."
|
|
134
|
+
)
|
|
135
|
+
force_include = {}
|
|
136
|
+
|
|
137
|
+
try:
|
|
138
|
+
force_include = {**force_include, **self._install_rust_cli()}
|
|
120
139
|
except UnsupportedPlatformError as err:
|
|
121
140
|
msg = f"Pact CLI is not available for {err.platform}."
|
|
122
141
|
self.app.display_error(msg)
|
|
123
142
|
raise
|
|
124
143
|
|
|
144
|
+
build_data["force_include"] = force_include
|
|
125
145
|
build_data["tag"] = self._infer_tag()
|
|
126
146
|
|
|
127
147
|
def _sys_tag_platform(self) -> str:
|
|
@@ -132,9 +152,9 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
132
152
|
"""
|
|
133
153
|
return next(t.platform for t in sys_tags())
|
|
134
154
|
|
|
135
|
-
def
|
|
155
|
+
def _install_ruby_cli(self, version: str) -> Mapping[str, str]:
|
|
136
156
|
"""
|
|
137
|
-
Install the Pact standalone binaries.
|
|
157
|
+
Install the Pact Ruby standalone binaries.
|
|
138
158
|
|
|
139
159
|
The binaries are installed in `src/pact_cli/bin`, and the relevant
|
|
140
160
|
version for the current operating system is determined automatically.
|
|
@@ -148,7 +168,7 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
148
168
|
wheel. Each `src` is a full path in the current filesystem, and the
|
|
149
169
|
`dst` is the corresponding path within the wheel.
|
|
150
170
|
"""
|
|
151
|
-
url = self.
|
|
171
|
+
url = self._pact_ruby_bin_url(version)
|
|
152
172
|
artefact = self._download(url)
|
|
153
173
|
self._extract(artefact)
|
|
154
174
|
return {
|
|
@@ -156,17 +176,17 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
156
176
|
str(PKG_DIR / "lib"): "pact_cli/lib",
|
|
157
177
|
}
|
|
158
178
|
|
|
159
|
-
def
|
|
179
|
+
def _pact_ruby_bin_url(self, version: str) -> str:
|
|
160
180
|
"""
|
|
161
|
-
Generate the download URL for the Pact binaries.
|
|
181
|
+
Generate the download URL for the Pact Ruby binaries.
|
|
162
182
|
|
|
163
183
|
Args:
|
|
164
184
|
version:
|
|
165
185
|
The Pact CLI version to download.
|
|
166
186
|
|
|
167
187
|
Returns:
|
|
168
|
-
The URL to download the Pact binaries from. If the platform is
|
|
169
|
-
supported, the resulting URL may be invalid.
|
|
188
|
+
The URL to download the Pact Ruby binaries from. If the platform is
|
|
189
|
+
not supported, the resulting URL may be invalid.
|
|
170
190
|
"""
|
|
171
191
|
platform = self._sys_tag_platform()
|
|
172
192
|
|
|
@@ -177,6 +197,9 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
177
197
|
os_name = "linux"
|
|
178
198
|
ext = "tar.gz"
|
|
179
199
|
elif platform.startswith("win"):
|
|
200
|
+
if platform.endswith(("arm64", "aarch64")):
|
|
201
|
+
# The Ruby standalone has no Windows ARM release.
|
|
202
|
+
raise UnsupportedPlatformError(platform)
|
|
180
203
|
os_name = "windows"
|
|
181
204
|
ext = "zip"
|
|
182
205
|
else:
|
|
@@ -196,6 +219,77 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
196
219
|
ext=ext,
|
|
197
220
|
)
|
|
198
221
|
|
|
222
|
+
def _pact_rust_bin_url(self, version: str) -> str:
|
|
223
|
+
"""
|
|
224
|
+
Generate the download URL for the Rust pact binary from pact-cli.
|
|
225
|
+
|
|
226
|
+
The pact-cli release assets are plain binaries (not archives) named
|
|
227
|
+
``pact-{arch}-{os}`` (e.g. ``pact-aarch64-macos``), with ``.exe``
|
|
228
|
+
appended on Windows.
|
|
229
|
+
|
|
230
|
+
Args:
|
|
231
|
+
version:
|
|
232
|
+
The pact-cli version to download.
|
|
233
|
+
|
|
234
|
+
Returns:
|
|
235
|
+
The URL to the pact binary asset.
|
|
236
|
+
|
|
237
|
+
Raises:
|
|
238
|
+
UnsupportedPlatformError:
|
|
239
|
+
If the current platform's OS or architecture is not recognised.
|
|
240
|
+
"""
|
|
241
|
+
platform = self._sys_tag_platform()
|
|
242
|
+
|
|
243
|
+
if platform.startswith("macosx"):
|
|
244
|
+
os_name = "macos"
|
|
245
|
+
ext = ""
|
|
246
|
+
elif "linux" in platform:
|
|
247
|
+
# musl-based Linux targets (e.g. Alpine) are not distinguished;
|
|
248
|
+
# the linux-gnu binary is used for all Linux targets.
|
|
249
|
+
os_name = "linux-gnu"
|
|
250
|
+
ext = ""
|
|
251
|
+
elif platform.startswith("win"):
|
|
252
|
+
os_name = "windows-msvc"
|
|
253
|
+
ext = ".exe"
|
|
254
|
+
else:
|
|
255
|
+
raise UnsupportedPlatformError(platform)
|
|
256
|
+
|
|
257
|
+
if platform.endswith(("arm64", "aarch64")):
|
|
258
|
+
arch = "aarch64"
|
|
259
|
+
elif platform.endswith(("x86_64", "amd64")):
|
|
260
|
+
arch = "x86_64"
|
|
261
|
+
else:
|
|
262
|
+
raise UnsupportedPlatformError(platform)
|
|
263
|
+
|
|
264
|
+
return PACT_RUST_CLI_URL.format(
|
|
265
|
+
version=version,
|
|
266
|
+
arch=arch,
|
|
267
|
+
os=os_name,
|
|
268
|
+
ext=ext,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
def _install_rust_cli(self) -> Mapping[str, str]:
|
|
272
|
+
"""
|
|
273
|
+
Install the Rust pact binary from pact-cli.
|
|
274
|
+
|
|
275
|
+
Overwrites the `pact` binary bundled with pact-standalone.
|
|
276
|
+
|
|
277
|
+
The binary is downloaded from the pact-cli GitHub release as a plain
|
|
278
|
+
executable (not an archive) and placed in `bin/` as `pact`
|
|
279
|
+
(or `pact.exe` on Windows).
|
|
280
|
+
"""
|
|
281
|
+
url = self._pact_rust_bin_url(PACT_RUST_CLI_VERSION)
|
|
282
|
+
artefact = self._download(url)
|
|
283
|
+
|
|
284
|
+
bin_name = "pact.exe" if sys.platform == "win32" else "pact"
|
|
285
|
+
dest = PKG_DIR / "bin" / bin_name
|
|
286
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
287
|
+
shutil.copy2(artefact, dest)
|
|
288
|
+
if sys.platform != "win32":
|
|
289
|
+
dest.chmod(0o755)
|
|
290
|
+
|
|
291
|
+
return {str(PKG_DIR / "bin"): "pact_cli/bin"}
|
|
292
|
+
|
|
199
293
|
def _extract(self, artefact: Path) -> None:
|
|
200
294
|
"""
|
|
201
295
|
Extract the Pact binaries.
|
|
@@ -238,7 +332,7 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
|
|
|
238
332
|
Returns:
|
|
239
333
|
The path to the downloaded artefact.
|
|
240
334
|
"""
|
|
241
|
-
filename = url.
|
|
335
|
+
filename = url.rsplit("/", maxsplit=1)[-1]
|
|
242
336
|
artefact = PKG_DIR / "data" / filename
|
|
243
337
|
artefact.parent.mkdir(parents=True, exist_ok=True)
|
|
244
338
|
|
|
@@ -43,16 +43,22 @@ from pact_cli.__version__ import (
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
if TYPE_CHECKING:
|
|
46
|
-
from collections.abc import
|
|
46
|
+
from collections.abc import Mapping
|
|
47
47
|
|
|
48
48
|
_USE_SYSTEM_BINS = os.getenv("PACT_USE_SYSTEM_BINS", "").upper() in ("TRUE", "YES")
|
|
49
49
|
_BIN_DIR = Path(__file__).parent.resolve() / "bin"
|
|
50
|
-
|
|
51
|
-
"pact-
|
|
52
|
-
"pact-
|
|
53
|
-
"pact-
|
|
54
|
-
"pact-
|
|
55
|
-
|
|
50
|
+
_DEPRECATED_COMMANDS: Mapping[str, str | None] = {
|
|
51
|
+
"pact-broker": "pact broker",
|
|
52
|
+
"pact-message": None, # being removed; no Rust equivalent
|
|
53
|
+
"pact-mock-service": "pact mock",
|
|
54
|
+
"pact-plugin-cli": "pact plugin",
|
|
55
|
+
"pact-provider-verifier": "pact verifier",
|
|
56
|
+
"pact-stub-server": "pact stub",
|
|
57
|
+
"pact-stub-service": "pact stub",
|
|
58
|
+
"pact_mock_server_cli": "pact mock",
|
|
59
|
+
"pact_verifier_cli": "pact verifier",
|
|
60
|
+
"pactflow": "pact pactflow",
|
|
61
|
+
}
|
|
56
62
|
|
|
57
63
|
|
|
58
64
|
def _telemetry_env() -> Mapping[str, str]:
|
|
@@ -108,27 +114,32 @@ def _exec() -> None:
|
|
|
108
114
|
print("Unknown command:", command, file=sys.stderr) # noqa: T201
|
|
109
115
|
sys.exit(1)
|
|
110
116
|
|
|
111
|
-
if command in
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
117
|
+
if command in _DEPRECATED_COMMANDS:
|
|
118
|
+
replacement = _DEPRECATED_COMMANDS[command]
|
|
119
|
+
if replacement:
|
|
120
|
+
print( # noqa: T201
|
|
121
|
+
f"WARNING: '{command}' is deprecated and will be removed in a "
|
|
122
|
+
f"future release. Use '{replacement}' instead.\n",
|
|
123
|
+
file=sys.stderr,
|
|
124
|
+
flush=True,
|
|
125
|
+
)
|
|
126
|
+
else:
|
|
127
|
+
print( # noqa: T201
|
|
128
|
+
f"WARNING: '{command}' is deprecated and will be removed in a "
|
|
129
|
+
"future release.\n",
|
|
130
|
+
file=sys.stderr,
|
|
131
|
+
flush=True,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# To avoid finding the same executable, remove the current entry point's
|
|
135
|
+
# directory from PATH before searching.
|
|
136
|
+
script_dir = Path(sys.argv[0]).parent.resolve()
|
|
137
|
+
os.environ["PATH"] = os.pathsep.join(
|
|
138
|
+
p
|
|
139
|
+
for p in os.getenv("PATH", "").split(os.pathsep)
|
|
140
|
+
if Path(p).resolve() != script_dir
|
|
141
|
+
)
|
|
142
|
+
executable = _find_executable(command)
|
|
132
143
|
|
|
133
144
|
if not executable:
|
|
134
145
|
print(f"Command '{command}' not found.", file=sys.stderr) # noqa: T201
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Version information for pact-python-cli."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("pact-python-cli")
|
|
7
|
+
except PackageNotFoundError:
|
|
8
|
+
__version__ = "unknown"
|
|
9
|
+
|
|
10
|
+
__version_tuple__ = tuple(int(x) for x in __version__.split(".") if x.isdigit())
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#:schema https://www.schemastore.org/pyproject.json
|
|
2
|
+
|
|
3
|
+
[project]
|
|
4
|
+
name = "pact-python-cli"
|
|
5
|
+
version = "2.6.0.0"
|
|
6
|
+
description = "Pact CLI bundle for Python"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
license = "MIT"
|
|
9
|
+
keywords = ["cli", "contract-testing", "pact", "pact-python"]
|
|
10
|
+
|
|
11
|
+
authors = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }]
|
|
12
|
+
maintainers = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }]
|
|
13
|
+
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: MacOS :: MacOS X",
|
|
20
|
+
"Operating System :: Microsoft :: Windows",
|
|
21
|
+
"Operating System :: POSIX :: Linux",
|
|
22
|
+
"Programming Language :: Python",
|
|
23
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Programming Language :: Python :: 3.14",
|
|
29
|
+
"Topic :: Software Development :: Testing",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
requires-python = ">=3.10"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
"Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues"
|
|
36
|
+
"Changelog" = "https://github.com/pact-foundation/pact-python/blob/main/pact-python-cli/CHANGELOG.md"
|
|
37
|
+
"Documentation" = "https://docs.pact.io"
|
|
38
|
+
"Homepage" = "https://pact.io"
|
|
39
|
+
"Repository" = "https://github.com/pact-foundation/pact-python"
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
pact = "pact_cli:_exec"
|
|
43
|
+
pact-broker = "pact_cli:_exec"
|
|
44
|
+
pact-message = "pact_cli:_exec"
|
|
45
|
+
pact_mock_server_cli = "pact_cli:_exec"
|
|
46
|
+
pact-mock-service = "pact_cli:_exec"
|
|
47
|
+
pact-plugin-cli = "pact_cli:_exec"
|
|
48
|
+
pact-provider-verifier = "pact_cli:_exec"
|
|
49
|
+
pact-stub-server = "pact_cli:_exec"
|
|
50
|
+
pact-stub-service = "pact_cli:_exec"
|
|
51
|
+
pact_verifier_cli = "pact_cli:_exec"
|
|
52
|
+
pactflow = "pact_cli:_exec"
|
|
53
|
+
|
|
54
|
+
[dependency-groups]
|
|
55
|
+
# Linting and formatting tools use a more narrow specification to ensure
|
|
56
|
+
# developper consistency. All other dependencies are as above.
|
|
57
|
+
dev = ["ruff==0.15.10", { include-group = "test" }, { include-group = "types" }]
|
|
58
|
+
test = ["pytest~=9.0", "pytest-cov~=7.0"]
|
|
59
|
+
types = ["mypy==1.20.1"]
|
|
60
|
+
|
|
61
|
+
## Build System
|
|
62
|
+
[build-system]
|
|
63
|
+
requires = ["hatchling", "packaging"]
|
|
64
|
+
build-backend = "hatchling.build"
|
|
65
|
+
|
|
66
|
+
[tool]
|
|
67
|
+
[tool.cibuildwheel]
|
|
68
|
+
# The repair tool unfortunately did not like the bundled Ruby distributable,
|
|
69
|
+
# with false-positives missing libraries despite being bundled.
|
|
70
|
+
repair-wheel-command = ""
|
|
71
|
+
|
|
72
|
+
[tool.cibuildwheel.windows]
|
|
73
|
+
archs = ["auto64"]
|
|
74
|
+
|
|
75
|
+
[[tool.cibuildwheel.overrides]]
|
|
76
|
+
environment.MACOSX_DEPLOYMENT_TARGET = "10.13"
|
|
77
|
+
select = "*-macosx_x86_64"
|
|
78
|
+
|
|
79
|
+
[[tool.cibuildwheel.overrides]]
|
|
80
|
+
environment.MACOSX_DEPLOYMENT_TARGET = "11.0"
|
|
81
|
+
select = "*-macosx_arm64"
|
|
82
|
+
|
|
83
|
+
[tool.coverage]
|
|
84
|
+
[tool.coverage.paths]
|
|
85
|
+
pact-cli = ["/src/pact_cli"]
|
|
86
|
+
tests = ["/tests"]
|
|
87
|
+
|
|
88
|
+
[tool.coverage.report]
|
|
89
|
+
exclude_lines = [
|
|
90
|
+
"@(abc\\.)?abstractmethod", # Ignore abstract methods
|
|
91
|
+
"if TYPE_CHECKING:", # Ignore typing
|
|
92
|
+
"if __name__ == .__main__.:", # Ignore non-runnable code
|
|
93
|
+
"raise NotImplementedError", # Ignore defensive assertions
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[tool.hatch]
|
|
97
|
+
[tool.hatch.build]
|
|
98
|
+
packages = ["src/pact_cli"]
|
|
99
|
+
|
|
100
|
+
[tool.hatch.build.targets.wheel.hooks.custom]
|
|
101
|
+
patch = "hatch_build.py"
|
|
102
|
+
|
|
103
|
+
[tool.hatch.envs]
|
|
104
|
+
[tool.hatch.envs.default]
|
|
105
|
+
installer = "uv"
|
|
106
|
+
path = ".venv"
|
|
107
|
+
extra-dependencies = [
|
|
108
|
+
"hatchling",
|
|
109
|
+
"packaging",
|
|
110
|
+
"requests",
|
|
111
|
+
"setuptools ; python_version >= '3.12'",
|
|
112
|
+
]
|
|
113
|
+
dependency-groups = ["dev"]
|
|
114
|
+
|
|
115
|
+
[tool.hatch.envs.default.scripts]
|
|
116
|
+
all = ["format", "lint", "test", "typecheck"]
|
|
117
|
+
format = "ruff format {args}"
|
|
118
|
+
lint = "ruff check --show-fixes {args}"
|
|
119
|
+
test = "pytest tests/ {args}"
|
|
120
|
+
typecheck = ["typecheck-src", "typecheck-tests"]
|
|
121
|
+
typecheck-src = "mypy src/ {args}"
|
|
122
|
+
typecheck-tests = "mypy tests/ {args}"
|
|
123
|
+
|
|
124
|
+
# Test environment for running unit tests.
|
|
125
|
+
[tool.hatch.envs.test]
|
|
126
|
+
installer = "uv"
|
|
127
|
+
path = ".venv/test"
|
|
128
|
+
dependency-groups = ["test"]
|
|
129
|
+
|
|
130
|
+
[[tool.hatch.envs.test.matrix]]
|
|
131
|
+
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
132
|
+
|
|
133
|
+
[tool.mypy]
|
|
134
|
+
# Overwrite the exclusions from the root pyproject.toml.
|
|
135
|
+
exclude = ""
|
|
136
|
+
|
|
137
|
+
## PyTest Configuration
|
|
138
|
+
[tool.pytest]
|
|
139
|
+
addopts = [
|
|
140
|
+
# Coverage options
|
|
141
|
+
"--cov-config=pyproject.toml",
|
|
142
|
+
"--cov-report=xml",
|
|
143
|
+
"--cov=pact_cli",
|
|
144
|
+
"--import-mode=importlib",
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
log_date_format = "%H:%M:%S"
|
|
148
|
+
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
|
|
149
|
+
log_level = "NOTSET"
|
|
150
|
+
|
|
151
|
+
## Ruff Configuration
|
|
152
|
+
[tool.ruff]
|
|
153
|
+
extend = "../pyproject.toml"
|
|
154
|
+
|
|
155
|
+
exclude = []
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
#:schema https://www.schemastore.org/pyproject.json
|
|
2
|
-
[project]
|
|
3
|
-
description = "Pact CLI bundle for Python"
|
|
4
|
-
name = "pact-python-cli"
|
|
5
|
-
|
|
6
|
-
dynamic = ["version"]
|
|
7
|
-
keywords = ["pact", "cli", "pact-python", "contract-testing"]
|
|
8
|
-
license = "MIT"
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
|
|
11
|
-
authors = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }]
|
|
12
|
-
maintainers = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }]
|
|
13
|
-
|
|
14
|
-
classifiers = [
|
|
15
|
-
"Development Status :: 5 - Production/Stable",
|
|
16
|
-
"Environment :: Console",
|
|
17
|
-
"Intended Audience :: Developers",
|
|
18
|
-
"License :: OSI Approved :: MIT License",
|
|
19
|
-
"Operating System :: MacOS :: MacOS X",
|
|
20
|
-
"Operating System :: Microsoft :: Windows",
|
|
21
|
-
"Operating System :: POSIX :: Linux",
|
|
22
|
-
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
-
"Programming Language :: Python :: 3.10",
|
|
24
|
-
"Programming Language :: Python :: 3.11",
|
|
25
|
-
"Programming Language :: Python :: 3.12",
|
|
26
|
-
"Programming Language :: Python :: 3.13",
|
|
27
|
-
"Programming Language :: Python :: 3.14",
|
|
28
|
-
"Programming Language :: Python",
|
|
29
|
-
"Topic :: Software Development :: Testing",
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
requires-python = ">=3.10"
|
|
33
|
-
|
|
34
|
-
[project.urls]
|
|
35
|
-
"Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues"
|
|
36
|
-
"Changelog" = "https://github.com/pact-foundation/pact-python/blob/main/pact-python-cli/CHANGELOG.md"
|
|
37
|
-
"Documentation" = "https://docs.pact.io"
|
|
38
|
-
"Homepage" = "https://pact.io"
|
|
39
|
-
"Repository" = "https://github.com/pact-foundation/pact-python"
|
|
40
|
-
|
|
41
|
-
[project.scripts]
|
|
42
|
-
pact = "pact_cli:_exec"
|
|
43
|
-
pact-broker = "pact_cli:_exec"
|
|
44
|
-
pact-message = "pact_cli:_exec"
|
|
45
|
-
pact-mock-service = "pact_cli:_exec"
|
|
46
|
-
pact-plugin-cli = "pact_cli:_exec"
|
|
47
|
-
pact-provider-verifier = "pact_cli:_exec"
|
|
48
|
-
pact-stub-server = "pact_cli:_exec"
|
|
49
|
-
pact-stub-service = "pact_cli:_exec"
|
|
50
|
-
pact_mock_server_cli = "pact_cli:_exec"
|
|
51
|
-
pact_verifier_cli = "pact_cli:_exec"
|
|
52
|
-
pactflow = "pact_cli:_exec"
|
|
53
|
-
|
|
54
|
-
[dependency-groups]
|
|
55
|
-
# Linting and formatting tools use a more narrow specification to ensure
|
|
56
|
-
# developper consistency. All other dependencies are as above.
|
|
57
|
-
dev = ["ruff==0.14.8", { include-group = "test" }, { include-group = "types" }]
|
|
58
|
-
test = ["pytest-cov~=7.0", "pytest~=9.0"]
|
|
59
|
-
types = ["mypy==1.19.0"]
|
|
60
|
-
|
|
61
|
-
################################################################################
|
|
62
|
-
## Build System
|
|
63
|
-
################################################################################
|
|
64
|
-
[build-system]
|
|
65
|
-
build-backend = "hatchling.build"
|
|
66
|
-
requires = ["hatchling", "packaging", "versioningit"]
|
|
67
|
-
|
|
68
|
-
[tool.hatch]
|
|
69
|
-
|
|
70
|
-
[tool.hatch.version]
|
|
71
|
-
source = "versioningit"
|
|
72
|
-
|
|
73
|
-
[tool.hatch.build]
|
|
74
|
-
artifacts = ["src/pact_cli/__version__.py"]
|
|
75
|
-
packages = ["src/pact_cli"]
|
|
76
|
-
|
|
77
|
-
[tool.hatch.build.targets.wheel.hooks.custom]
|
|
78
|
-
patch = "hatch_build.py"
|
|
79
|
-
|
|
80
|
-
########################################
|
|
81
|
-
## Hatch Environment Configuration
|
|
82
|
-
########################################
|
|
83
|
-
[tool.hatch.envs]
|
|
84
|
-
|
|
85
|
-
# Install dev dependencies in the default environment to simplify the developer
|
|
86
|
-
# workflow.
|
|
87
|
-
[tool.hatch.envs.default]
|
|
88
|
-
extra-dependencies = [
|
|
89
|
-
"hatchling",
|
|
90
|
-
"packaging",
|
|
91
|
-
"requests",
|
|
92
|
-
"setuptools ; python_version >= '3.12'",
|
|
93
|
-
]
|
|
94
|
-
installer = "uv"
|
|
95
|
-
path = ".venv"
|
|
96
|
-
pre-install-commands = ["uv pip install --group dev -e ."]
|
|
97
|
-
|
|
98
|
-
[tool.hatch.envs.default.scripts]
|
|
99
|
-
all = ["format", "lint", "test", "typecheck"]
|
|
100
|
-
format = "ruff format {args}"
|
|
101
|
-
lint = "ruff check --show-fixes {args}"
|
|
102
|
-
test = "pytest tests/ {args}"
|
|
103
|
-
typecheck = ["typecheck-src", "typecheck-tests"]
|
|
104
|
-
typecheck-src = "mypy src/ {args}"
|
|
105
|
-
typecheck-tests = "mypy tests/ {args}"
|
|
106
|
-
|
|
107
|
-
# Test environment for running unit tests. This automatically tests against all
|
|
108
|
-
# supported Python versions.
|
|
109
|
-
[tool.hatch.envs.test]
|
|
110
|
-
installer = "uv"
|
|
111
|
-
path = ".venv/test"
|
|
112
|
-
pre-install-commands = ["uv pip install --group test -e ."]
|
|
113
|
-
|
|
114
|
-
[[tool.hatch.envs.test.matrix]]
|
|
115
|
-
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
116
|
-
|
|
117
|
-
################################################################################
|
|
118
|
-
## Versioningit Configuration
|
|
119
|
-
################################################################################
|
|
120
|
-
[tool.versioningit]
|
|
121
|
-
[tool.versioningit.vcs]
|
|
122
|
-
match = ["pact-python-cli/*"]
|
|
123
|
-
method = "git"
|
|
124
|
-
|
|
125
|
-
[tool.versioningit.tag2version]
|
|
126
|
-
rmprefix = "pact-python-cli/"
|
|
127
|
-
|
|
128
|
-
[tool.versioningit.write]
|
|
129
|
-
file = "src/pact_cli/__version__.py"
|
|
130
|
-
template = '''\
|
|
131
|
-
# This file is auto-generated by versioningit. Do not edit.
|
|
132
|
-
__version__ = "{version}"
|
|
133
|
-
__version_tuple__ = {version_tuple}
|
|
134
|
-
__commit_id__ = "{revision}"
|
|
135
|
-
'''
|
|
136
|
-
|
|
137
|
-
################################################################################
|
|
138
|
-
## PyTest Configuration
|
|
139
|
-
################################################################################
|
|
140
|
-
[tool.pytest]
|
|
141
|
-
addopts = [
|
|
142
|
-
"--import-mode=importlib",
|
|
143
|
-
# Coverage options
|
|
144
|
-
"--cov-config=pyproject.toml",
|
|
145
|
-
"--cov-report=xml",
|
|
146
|
-
"--cov=pact_cli",
|
|
147
|
-
]
|
|
148
|
-
|
|
149
|
-
log_date_format = "%H:%M:%S"
|
|
150
|
-
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
|
|
151
|
-
log_level = "NOTSET"
|
|
152
|
-
|
|
153
|
-
################################################################################
|
|
154
|
-
## Coverage
|
|
155
|
-
################################################################################
|
|
156
|
-
[tool.coverage]
|
|
157
|
-
|
|
158
|
-
[tool.coverage.paths]
|
|
159
|
-
pact-cli = ["/src/pact_cli"]
|
|
160
|
-
tests = ["/tests"]
|
|
161
|
-
|
|
162
|
-
[tool.coverage.report]
|
|
163
|
-
exclude_lines = [
|
|
164
|
-
"@(abc\\.)?abstractmethod", # Ignore abstract methods
|
|
165
|
-
"if TYPE_CHECKING:", # Ignore typing
|
|
166
|
-
"if __name__ == .__main__.:", # Ignore non-runnable code
|
|
167
|
-
"raise NotImplementedError", # Ignore defensive assertions
|
|
168
|
-
]
|
|
169
|
-
|
|
170
|
-
################################################################################
|
|
171
|
-
## Ruff Configuration
|
|
172
|
-
################################################################################
|
|
173
|
-
[tool.ruff]
|
|
174
|
-
extend = "../pyproject.toml"
|
|
175
|
-
|
|
176
|
-
exclude = []
|
|
177
|
-
|
|
178
|
-
################################################################################
|
|
179
|
-
## Mypy Configuration
|
|
180
|
-
################################################################################
|
|
181
|
-
[tool.mypy]
|
|
182
|
-
# Overwrite the exclusions from the root pyproject.toml.
|
|
183
|
-
exclude = ''
|
|
184
|
-
|
|
185
|
-
################################################################################
|
|
186
|
-
## CI Build Wheel
|
|
187
|
-
################################################################################
|
|
188
|
-
[tool.cibuildwheel]
|
|
189
|
-
# The repair tool unfortunately did not like the bundled Ruby distributable,
|
|
190
|
-
# with false-positives missing libraries despite being bundled.
|
|
191
|
-
repair-wheel-command = ""
|
|
192
|
-
|
|
193
|
-
[tool.cibuildwheel.windows]
|
|
194
|
-
archs = ["auto64"]
|
|
195
|
-
|
|
196
|
-
[[tool.cibuildwheel.overrides]]
|
|
197
|
-
environment.MACOSX_DEPLOYMENT_TARGET = "10.13"
|
|
198
|
-
select = "*-macosx_x86_64"
|
|
199
|
-
|
|
200
|
-
[[tool.cibuildwheel.overrides]]
|
|
201
|
-
environment.MACOSX_DEPLOYMENT_TARGET = "11.0"
|
|
202
|
-
select = "*-macosx_arm64"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|