pact-python-cli 2.6.0.0__tar.gz → 2.6.4.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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: pact-python-cli
3
- Version: 2.6.0.0
3
+ Version: 2.6.4.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
@@ -21,13 +21,13 @@ Classifier: Operating System :: Microsoft :: Windows
21
21
  Classifier: Operating System :: POSIX :: Linux
22
22
  Classifier: Programming Language :: Python
23
23
  Classifier: Programming Language :: Python :: 3 :: Only
24
- Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
26
25
  Classifier: Programming Language :: Python :: 3.12
27
26
  Classifier: Programming Language :: Python :: 3.13
28
27
  Classifier: Programming Language :: Python :: 3.14
28
+ Classifier: Programming Language :: Python :: 3.15
29
29
  Classifier: Topic :: Software Development :: Testing
30
- Requires-Python: >=3.10
30
+ Requires-Python: >=3.11
31
31
  Description-Content-Type: text/markdown
32
32
 
33
33
 
@@ -22,6 +22,7 @@ if TYPE_CHECKING:
22
22
  from hatchling.builders.config import BuilderConfig
23
23
  from hatchling.builders.hooks.plugin.interface import BuildHookInterface
24
24
  from packaging.tags import sys_tags
25
+ from packaging.version import Version
25
26
 
26
27
  PKG_DIR = Path(__file__).parent.resolve() / "src" / "pact_cli"
27
28
 
@@ -30,7 +31,7 @@ PACT_CLI_URL = "https://github.com/pact-foundation/pact-standalone/releases/down
30
31
 
31
32
  # Remove fixed version and infer from package metadata when pact-cli versioning
32
33
  # is adopted.
33
- PACT_RUST_CLI_VERSION = "0.9.5"
34
+ PACT_RUST_CLI_VERSION = "0.10.2"
34
35
  PACT_RUST_CLI_URL = "https://github.com/pact-foundation/pact-cli/releases/download/v{version}/pact-{arch}-{os}{ext}"
35
36
 
36
37
 
@@ -149,8 +150,22 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
149
150
  Get the platform tag from the current system tags.
150
151
 
151
152
  This is used to determine the target platform for the Pact binaries.
153
+
154
+ On Linux, the generic `linux_{arch}` tag conveys no information about
155
+ the platform's C library, so the more specific `manylinux`/`musllinux`
156
+ tag is preferred when one is available.
157
+
158
+ Returns:
159
+ The most specific platform tag supported by the current system.
152
160
  """
153
- return next(t.platform for t in sys_tags())
161
+ platforms = (t.platform for t in sys_tags())
162
+ preferred = next(platforms)
163
+ if preferred.startswith("linux_"):
164
+ return next(
165
+ (p for p in platforms if not p.startswith("linux_")),
166
+ preferred,
167
+ )
168
+ return preferred
154
169
 
155
170
  def _install_ruby_cli(self, version: str) -> Mapping[str, str]:
156
171
  """
@@ -191,7 +206,8 @@ class PactCliBuildHook(BuildHookInterface[BuilderConfig]):
191
206
  platform = self._sys_tag_platform()
192
207
 
193
208
  if platform.startswith("macosx"):
194
- os_name = "osx"
209
+ # Upstream renamed the macOS assets from `osx` to `macos` in 2.6.1.
210
+ os_name = "macos" if Version(version) >= Version("2.6.1") else "osx"
195
211
  ext = "tar.gz"
196
212
  elif "linux" in platform:
197
213
  os_name = "linux"
@@ -31,6 +31,7 @@ __url__ = "https://github.com/pact-foundation/pact-python"
31
31
  import os
32
32
  import shutil
33
33
  import sys
34
+ import sysconfig
34
35
  import warnings
35
36
  from pathlib import Path
36
37
  from typing import TYPE_CHECKING
@@ -43,7 +44,7 @@ from pact_cli.__version__ import (
43
44
  )
44
45
 
45
46
  if TYPE_CHECKING:
46
- from collections.abc import Mapping
47
+ from collections.abc import Iterator, Mapping
47
48
 
48
49
  _USE_SYSTEM_BINS = os.getenv("PACT_USE_SYSTEM_BINS", "").upper() in ("TRUE", "YES")
49
50
  _BIN_DIR = Path(__file__).parent.resolve() / "bin"
@@ -148,6 +149,39 @@ def _exec() -> None:
148
149
  os.execve(executable, [executable, *args], _telemetry_env()) # noqa: S606
149
150
 
150
151
 
152
+ def _bundled_bin_dirs() -> Iterator[Path]:
153
+ """
154
+ Determine the directories that may contain the bundled Pact binaries.
155
+
156
+ The binaries are normally bundled in a `bin` directory alongside this
157
+ module, which is the first location searched. Relying solely on the
158
+ module-relative path is fragile, however: for editable or relocated
159
+ installs, or when a virtual environment is reused across several checkouts,
160
+ `__file__` may resolve to a directory that no longer contains the binaries.
161
+ The installation's `site-packages` directories are therefore also derived
162
+ from `sysconfig` so the bundled `bin` directory can be located independently
163
+ of `__file__`.
164
+
165
+ Returns:
166
+ The candidate directories to search, in order of preference and
167
+ deduplicated.
168
+ """
169
+ seen: set[Path] = set()
170
+ resolved_bin_dir = _BIN_DIR.resolve()
171
+ if resolved_bin_dir.is_dir():
172
+ yield resolved_bin_dir
173
+ seen.add(resolved_bin_dir)
174
+ for name in ("platlib", "purelib"):
175
+ if (
176
+ (path := sysconfig.get_path(name))
177
+ and (candidate := Path(path).resolve() / "pact_cli" / "bin")
178
+ and candidate.is_dir()
179
+ and candidate not in seen
180
+ ):
181
+ yield candidate
182
+ seen.add(candidate)
183
+
184
+
151
185
  def _find_executable(executable: str) -> str | None:
152
186
  """
153
187
  Find the path to an executable.
@@ -173,7 +207,8 @@ def _find_executable(executable: str) -> str | None:
173
207
  if _USE_SYSTEM_BINS:
174
208
  bin_path = shutil.which(executable)
175
209
  else:
176
- bin_path = shutil.which(executable, path=str(_BIN_DIR))
210
+ search_path = os.pathsep.join(str(d) for d in _bundled_bin_dirs())
211
+ bin_path = shutil.which(executable, path=search_path) if search_path else None
177
212
  if bin_path is None:
178
213
  system_path = shutil.which(executable)
179
214
  if system_path is not None:
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "pact-python-cli"
5
- version = "2.6.0.0"
5
+ version = "2.6.4.0"
6
6
  description = "Pact CLI bundle for Python"
7
7
  readme = "README.md"
8
8
  license = "MIT"
@@ -21,15 +21,15 @@ classifiers = [
21
21
  "Operating System :: POSIX :: Linux",
22
22
  "Programming Language :: Python",
23
23
  "Programming Language :: Python :: 3 :: Only",
24
- "Programming Language :: Python :: 3.10",
25
24
  "Programming Language :: Python :: 3.11",
26
25
  "Programming Language :: Python :: 3.12",
27
26
  "Programming Language :: Python :: 3.13",
28
27
  "Programming Language :: Python :: 3.14",
28
+ "Programming Language :: Python :: 3.15",
29
29
  "Topic :: Software Development :: Testing",
30
30
  ]
31
31
 
32
- requires-python = ">=3.10"
32
+ requires-python = ">=3.11"
33
33
 
34
34
  [project.urls]
35
35
  "Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues"
@@ -54,9 +54,9 @@ requires-python = ">=3.10"
54
54
  [dependency-groups]
55
55
  # Linting and formatting tools use a more narrow specification to ensure
56
56
  # developper consistency. All other dependencies are as above.
57
- dev = ["ruff==0.15.10", { include-group = "test" }, { include-group = "types" }]
57
+ dev = ["ruff==0.17.0", { include-group = "test" }, { include-group = "types" }]
58
58
  test = ["pytest~=9.0", "pytest-cov~=7.0"]
59
- types = ["mypy==1.20.1"]
59
+ types = ["mypy==2.4.0"]
60
60
 
61
61
  ## Build System
62
62
  [build-system]
@@ -72,14 +72,6 @@ build-backend = "hatchling.build"
72
72
  [tool.cibuildwheel.windows]
73
73
  archs = ["auto64"]
74
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
75
  [tool.coverage]
84
76
  [tool.coverage.paths]
85
77
  pact-cli = ["/src/pact_cli"]
@@ -128,7 +120,7 @@ build-backend = "hatchling.build"
128
120
  dependency-groups = ["test"]
129
121
 
130
122
  [[tool.hatch.envs.test.matrix]]
131
- python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
123
+ python = ["3.11", "3.12", "3.13", "3.14", "3.15"]
132
124
 
133
125
  [tool.mypy]
134
126
  # Overwrite the exclusions from the root pyproject.toml.